Skip to content

Commit 35e729a

Browse files
elopezdavem330
authored andcommitted
net: ethernet: davicom: dm9000: initialize variables directly
Clean up the code a bit to initialize the variables directly when defining them. Signed-off-by: Emilio López <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3b0aaef commit 35e729a

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/net/ethernet/davicom/dm9000.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -827,21 +827,14 @@ dm9000_hash_table_unlocked(struct net_device *dev)
827827
struct netdev_hw_addr *ha;
828828
int i, oft;
829829
u32 hash_val;
830-
u16 hash_table[4];
830+
u16 hash_table[4] = { 0, 0, 0, 0x8000 }; /* broadcast address */
831831
u8 rcr = RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN;
832832

833833
dm9000_dbg(db, 1, "entering %s\n", __func__);
834834

835835
for (i = 0, oft = DM9000_PAR; i < 6; i++, oft++)
836836
iow(db, oft, dev->dev_addr[i]);
837837

838-
/* Clear Hash Table */
839-
for (i = 0; i < 4; i++)
840-
hash_table[i] = 0x0;
841-
842-
/* broadcast address */
843-
hash_table[3] = 0x8000;
844-
845838
if (dev->flags & IFF_PROMISC)
846839
rcr |= RCR_PRMSC;
847840

0 commit comments

Comments
 (0)