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/skgesirq.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/skgesirq.c')
-rw-r--r-- | drivers/net/sk98lin/skgesirq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/sk98lin/skgesirq.c b/drivers/net/sk98lin/skgesirq.c index 3e7aa49afd00..e5ee6d63ba4e 100644 --- a/drivers/net/sk98lin/skgesirq.c +++ b/drivers/net/sk98lin/skgesirq.c | |||
@@ -892,7 +892,7 @@ int Port) /* Which port should be checked */ | |||
892 | */ | 892 | */ |
893 | RxCts = 0; | 893 | RxCts = 0; |
894 | 894 | ||
895 | for (i = 0; i < sizeof(SkGeRxRegs)/sizeof(SkGeRxRegs[0]); i++) { | 895 | for (i = 0; i < ARRAY_SIZE(SkGeRxRegs); i++) { |
896 | 896 | ||
897 | (void)SkXmMacStatistic(pAC, IoC, Port, SkGeRxRegs[i], &RxTmp); | 897 | (void)SkXmMacStatistic(pAC, IoC, Port, SkGeRxRegs[i], &RxTmp); |
898 | 898 | ||