]> git.baikalelectronics.ru Git - kernel.git/commit
sk98lin: kill bogus check and convert to use ARRAY_SIZE()
authorAlejandro Martinez Ruiz <alex@flawedcode.org>
Thu, 18 Oct 2007 08:22:02 +0000 (10:22 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:03:38 +0000 (15:03 -0800)
commitbbb69ba028032a047fae5ec723131a93aaffa817
treea30097123359ad444ad718564168adcd716f00e3
parent5c8c9bf1e672bba84d8e34d612c496594e059a0c
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>
drivers/net/sk98lin/skgemib.c
drivers/net/sk98lin/skgepnmi.c
drivers/net/sk98lin/skgesirq.c