diff options
author | Alejandro Martinez Ruiz <alex@flawedcode.org> | 2007-10-18 04:00:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:03:36 -0500 |
commit | 4c3616cdda0632a3d0e39069765f9ea0e6bd093e (patch) | |
tree | d913f63996d479394bcdabd21ebfbdbe16bd1844 /drivers/net/s2io.c | |
parent | f59d9782751bf1a2c51e7e1e9f614ffec35fb52e (diff) |
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>
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r-- | drivers/net/s2io.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index f2ba944e035e..67e0a65fc28c 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -335,10 +335,9 @@ static char ethtool_driver_stats_keys[][ETH_GSTRING_LEN] = { | |||
335 | {"mc_err_cnt"} | 335 | {"mc_err_cnt"} |
336 | }; | 336 | }; |
337 | 337 | ||
338 | #define S2IO_XENA_STAT_LEN sizeof(ethtool_xena_stats_keys)/ ETH_GSTRING_LEN | 338 | #define S2IO_XENA_STAT_LEN ARRAY_SIZE(ethtool_xena_stats_keys) |
339 | #define S2IO_ENHANCED_STAT_LEN sizeof(ethtool_enhanced_stats_keys)/ \ | 339 | #define S2IO_ENHANCED_STAT_LEN ARRAY_SIZE(ethtool_enhanced_stats_keys) |
340 | ETH_GSTRING_LEN | 340 | #define S2IO_DRIVER_STAT_LEN ARRAY_SIZE(ethtool_driver_stats_keys) |
341 | #define S2IO_DRIVER_STAT_LEN sizeof(ethtool_driver_stats_keys)/ ETH_GSTRING_LEN | ||
342 | 341 | ||
343 | #define XFRAME_I_STAT_LEN (S2IO_XENA_STAT_LEN + S2IO_DRIVER_STAT_LEN ) | 342 | #define XFRAME_I_STAT_LEN (S2IO_XENA_STAT_LEN + S2IO_DRIVER_STAT_LEN ) |
344 | #define XFRAME_II_STAT_LEN (XFRAME_I_STAT_LEN + S2IO_ENHANCED_STAT_LEN ) | 343 | #define XFRAME_II_STAT_LEN (XFRAME_I_STAT_LEN + S2IO_ENHANCED_STAT_LEN ) |
@@ -346,7 +345,7 @@ static char ethtool_driver_stats_keys[][ETH_GSTRING_LEN] = { | |||
346 | #define XFRAME_I_STAT_STRINGS_LEN ( XFRAME_I_STAT_LEN * ETH_GSTRING_LEN ) | 345 | #define XFRAME_I_STAT_STRINGS_LEN ( XFRAME_I_STAT_LEN * ETH_GSTRING_LEN ) |
347 | #define XFRAME_II_STAT_STRINGS_LEN ( XFRAME_II_STAT_LEN * ETH_GSTRING_LEN ) | 346 | #define XFRAME_II_STAT_STRINGS_LEN ( XFRAME_II_STAT_LEN * ETH_GSTRING_LEN ) |
348 | 347 | ||
349 | #define S2IO_TEST_LEN sizeof(s2io_gstrings) / ETH_GSTRING_LEN | 348 | #define S2IO_TEST_LEN ARRAY_SIZE(s2io_gstrings) |
350 | #define S2IO_STRINGS_LEN S2IO_TEST_LEN * ETH_GSTRING_LEN | 349 | #define S2IO_STRINGS_LEN S2IO_TEST_LEN * ETH_GSTRING_LEN |
351 | 350 | ||
352 | #define S2IO_TIMER_CONF(timer, handle, arg, exp) \ | 351 | #define S2IO_TIMER_CONF(timer, handle, arg, exp) \ |