diff options
author | Alejandro Martinez Ruiz <alex@flawedcode.org> | 2007-10-18 04:22:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:03:38 -0500 |
commit | ef878b889907f29af1b5f34734f14eca1aa43cf6 (patch) | |
tree | a30097123359ad444ad718564168adcd716f00e3 /drivers/net/sk98lin/skgepnmi.c | |
parent | c00acf46deb18926931ba264510353cf22b98a79 (diff) |
sk98lin: kill bogus check and convert to use ARRAY_SIZE()
This converts uses of ARRAY_SIZE(), and while at it also kills
unreachable code as far as I can say. I can't tell what was the author
trying to do with the following check. First we have:
PNMI_STATIC const SK_PNMI_STATADDR
StatAddr[SK_PNMI_MAX_IDX][SK_PNMI_MAC_TYPES];
and then a check goes like this:
if (SK_PNMI_MAX_IDX !=
(sizeof(StatAddr) / (sizeof(SK_PNMI_STATADDR) * SK_PNMI_MAC_TYPES)))
with the second line being just ARRAY_SIZE(StatAddr), which will always
return SK_PNMI_MAX_IDX, rendering the check useless.
Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/sk98lin/skgepnmi.c')
-rw-r--r-- | drivers/net/sk98lin/skgepnmi.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/net/sk98lin/skgepnmi.c b/drivers/net/sk98lin/skgepnmi.c index b36dd9ac6b2..3c19d98fcfa 100644 --- a/drivers/net/sk98lin/skgepnmi.c +++ b/drivers/net/sk98lin/skgepnmi.c | |||
@@ -388,18 +388,6 @@ int Level) /* Initialization level */ | |||
388 | SK_PNMI_CNT_NO, SK_PNMI_MAX_IDX)); | 388 | SK_PNMI_CNT_NO, SK_PNMI_MAX_IDX)); |
389 | } | 389 | } |
390 | 390 | ||
391 | if (SK_PNMI_MAX_IDX != | ||
392 | (sizeof(StatAddr) / (sizeof(SK_PNMI_STATADDR) * SK_PNMI_MAC_TYPES))) { | ||
393 | |||
394 | SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR050, SK_PNMI_ERR050MSG); | ||
395 | |||
396 | SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_INIT | SK_DBGCAT_FATAL, | ||
397 | ("StatAddr table size (%d) differs from " | ||
398 | "SK_PNMI_MAX_IDX (%d)\n", | ||
399 | (sizeof(StatAddr) / | ||
400 | (sizeof(SK_PNMI_STATADDR) * SK_PNMI_MAC_TYPES)), | ||
401 | SK_PNMI_MAX_IDX)); | ||
402 | } | ||
403 | #endif /* SK_PNMI_CHECK */ | 391 | #endif /* SK_PNMI_CHECK */ |
404 | break; | 392 | break; |
405 | 393 | ||