diff options
author | zhong jiang <zhongjiang@huawei.com> | 2018-08-03 14:53:14 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-04 13:23:15 -0700 |
commit | bf37afceaf549ce9ef50e3042f64d257a3d4be80 (patch) | |
tree | 3404c313fa03e4b5b31789e170a6883984d33dd6 /drivers | |
parent | f13b546847ff5862ea313f3e79010c52c3fe32b4 (diff) |
net:usb: Use ARRAY_SIZE instead of calculating the array size
We use ARRAY_SIZE to replace open code sizeof(lan78xx_regs) / sizeof(u32).
It make the code concise.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/usb/lan78xx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 4662fa0381f9..a9991c5f4736 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -1649,7 +1649,7 @@ lan78xx_get_regs(struct net_device *netdev, struct ethtool_regs *regs, struct lan78xx_net *dev = netdev_priv(netdev); /* Read Device/MAC registers */ - for (i = 0; i < (sizeof(lan78xx_regs) / sizeof(u32)); i++) + for (i = 0; i < ARRAY_SIZE(lan78xx_regs); i++) lan78xx_read_reg(dev, lan78xx_regs[i], &data[i]); if (!netdev->phydev) |