Commit 28f39ef6 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

tulip: cleanup by using ARRAY_SIZE()

In this situation then ARRAY_SIZE() and sizeof() are the same, but we're
really dealing with array indexes and not byte offsets so ARRAY_SIZE()
is cleaner.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarGrant Grundler <grundler@parisc-linux.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 11c21a30
...@@ -457,7 +457,7 @@ void tulip_find_mii(struct net_device *dev, int board_idx) ...@@ -457,7 +457,7 @@ void tulip_find_mii(struct net_device *dev, int board_idx)
/* Find the connected MII xcvrs. /* Find the connected MII xcvrs.
Doing this in open() would allow detecting external xcvrs later, Doing this in open() would allow detecting external xcvrs later,
but takes much time. */ but takes much time. */
for (phyn = 1; phyn <= 32 && phy_idx < sizeof (tp->phys); phyn++) { for (phyn = 1; phyn <= 32 && phy_idx < ARRAY_SIZE(tp->phys); phyn++) {
int phy = phyn & 0x1f; int phy = phyn & 0x1f;
int mii_status = tulip_mdio_read (dev, phy, MII_BMSR); int mii_status = tulip_mdio_read (dev, phy, MII_BMSR);
if ((mii_status & 0x8301) == 0x8001 || if ((mii_status & 0x8301) == 0x8001 ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment