diff options
author | Mark Einon <mark.einon@gmail.com> | 2014-08-20 23:17:53 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-30 13:33:23 -0700 |
commit | 6697b8705196f090dc564fd3bfca9173b30cd288 (patch) | |
tree | 6d771b4ef028e645624bb84af5f2dadaf60058ae /drivers/staging/et131x | |
parent | staging: et131x: Don't handle rx/tx packets when changing mtu (diff) | |
download | linux-dev-6697b8705196f090dc564fd3bfca9173b30cd288.tar.xz linux-dev-6697b8705196f090dc564fd3bfca9173b30cd288.zip |
staging: et131x: Use for loop to initialise contiguous registers to zero
Replace a long list of contiguous writel() calls with a for loop iterating
over the same values.
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/et131x')
-rw-r--r-- | drivers/staging/et131x/et131x.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 83b3b1eb468f..38e2cfe4c015 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -1138,6 +1138,7 @@ static void et1310_config_rxmac_regs(struct et131x_adapter *adapter) u32 sa_lo; u32 sa_hi = 0; u32 pf_ctrl = 0; + u32 *wolw; /* Disable the MAC while it is being configured (also disable WOL) */ writel(0x8, &rxmac->ctrl); @@ -1151,30 +1152,8 @@ static void et1310_config_rxmac_regs(struct et131x_adapter *adapter) * its default Values of 0x00000000 because there are not WOL masks * as of this time. */ - writel(0, &rxmac->mask0_word0); - writel(0, &rxmac->mask0_word1); - writel(0, &rxmac->mask0_word2); - writel(0, &rxmac->mask0_word3); - - writel(0, &rxmac->mask1_word0); - writel(0, &rxmac->mask1_word1); - writel(0, &rxmac->mask1_word2); - writel(0, &rxmac->mask1_word3); - - writel(0, &rxmac->mask2_word0); - writel(0, &rxmac->mask2_word1); - writel(0, &rxmac->mask2_word2); - writel(0, &rxmac->mask2_word3); - - writel(0, &rxmac->mask3_word0); - writel(0, &rxmac->mask3_word1); - writel(0, &rxmac->mask3_word2); - writel(0, &rxmac->mask3_word3); - - writel(0, &rxmac->mask4_word0); - writel(0, &rxmac->mask4_word1); - writel(0, &rxmac->mask4_word2); - writel(0, &rxmac->mask4_word3); + for (wolw = &rxmac->mask0_word0; wolw <= &rxmac->mask4_word3; wolw++) + writel(0, wolw); /* Lets setup the WOL Source Address */ sa_lo = (adapter->addr[2] << ET_RX_WOL_LO_SA3_SHIFT) | |