From: "Emilio López" <emilio@elopez.com.ar>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"Emilio López" <emilio@elopez.com.ar>
Subject: [PATCH v2 3/4] net: ethernet: davicom: dm9000: initialize variables directly
Date: Fri, 17 May 2013 17:42:55 -0300 [thread overview]
Message-ID: <1368823376-13104-3-git-send-email-emilio@elopez.com.ar> (raw)
In-Reply-To: <1368823376-13104-1-git-send-email-emilio@elopez.com.ar>
Clean up the code a bit to initialize the variables directly when
defining them.
Signed-off-by: Emilio López <emilio@elopez.com.ar>
---
Please note that this patch is untested.
Changes from v1:
- {0} -> { 0 } as suggested by David Miller
drivers/net/ethernet/davicom/dm9000.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 9105465..e4ed05e 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -827,7 +827,7 @@ dm9000_hash_table_unlocked(struct net_device *dev)
struct netdev_hw_addr *ha;
int i, oft;
u32 hash_val;
- u16 hash_table[4];
+ u16 hash_table[4] = { 0, 0, 0, 0x8000 }; /* broadcast address */
u8 rcr = RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN;
dm9000_dbg(db, 1, "entering %s\n", __func__);
@@ -835,13 +835,6 @@ dm9000_hash_table_unlocked(struct net_device *dev)
for (i = 0, oft = DM9000_PAR; i < 6; i++, oft++)
iow(db, oft, dev->dev_addr[i]);
- /* Clear Hash Table */
- for (i = 0; i < 4; i++)
- hash_table[i] = 0x0;
-
- /* broadcast address */
- hash_table[3] = 0x8000;
-
if (dev->flags & IFF_PROMISC)
rcr |= RCR_PRMSC;
--
1.8.2.3
next prev parent reply other threads:[~2013-05-17 20:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-17 15:07 [PATCH 1/4] net: ethernet: sun: " Emilio López
2013-05-17 15:07 ` [PATCH 2/4] net: ethernet: apple: " Emilio López
2013-05-17 20:23 ` David Miller
2013-05-17 15:07 ` [PATCH 3/4] net: ethernet: davicom: dm9000: " Emilio López
2013-05-17 15:07 ` [PATCH 4/4] net: ethernet: korina: " Emilio López
2013-05-17 20:23 ` [PATCH 1/4] net: ethernet: sun: " David Miller
2013-05-17 20:42 ` [PATCH v2 " Emilio López
2013-05-17 20:42 ` [PATCH v2 2/4] net: ethernet: apple: " Emilio López
2013-05-17 20:59 ` David Miller
2013-05-17 20:42 ` Emilio López [this message]
2013-05-17 20:59 ` [PATCH v2 3/4] net: ethernet: davicom: dm9000: " David Miller
2013-05-17 20:42 ` [PATCH v2 4/4] net: ethernet: korina: " Emilio López
2013-05-17 20:59 ` David Miller
2013-05-17 20:59 ` [PATCH v2 1/4] net: ethernet: sun: " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1368823376-13104-3-git-send-email-emilio@elopez.com.ar \
--to=emilio@elopez.com.ar \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®