netdev: use ARRAY_SIZE() instead of sizeof(array) / ETH_GSTRING_LEN
Using ARRAY_SIZE() on arrays of the form array[][K] makes it unnecessary to know the value of K when checking its size. Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
committed by
David S. Miller
parent
f59d978275
commit
4c3616cdda
@@ -110,7 +110,7 @@ static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
|
||||
"Interrupt test (offline)", "Loopback test (offline)",
|
||||
"Link test (on/offline)"
|
||||
};
|
||||
#define E1000_TEST_LEN sizeof(e1000_gstrings_test) / ETH_GSTRING_LEN
|
||||
#define E1000_TEST_LEN ARRAY_SIZE(e1000_gstrings_test)
|
||||
|
||||
static int
|
||||
e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||
|
Reference in New Issue
Block a user