Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf37afce authored by zhong jiang's avatar zhong jiang Committed by David S. Miller
Browse files

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: default avatarzhong jiang <zhongjiang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f13b5468
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1649,7 +1649,7 @@ lan78xx_get_regs(struct net_device *netdev, struct ethtool_regs *regs,
	struct lan78xx_net *dev = netdev_priv(netdev);
	struct lan78xx_net *dev = netdev_priv(netdev);


	/* Read Device/MAC registers */
	/* 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]);
		lan78xx_read_reg(dev, lan78xx_regs[i], &data[i]);


	if (!netdev->phydev)
	if (!netdev->phydev)