From ef878b889907f29af1b5f34734f14eca1aa43cf6 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Ruiz Date: Thu, 18 Oct 2007 10:22:02 +0200 Subject: 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 Signed-off-by: Jeff Garzik --- drivers/net/sk98lin/skgemib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/sk98lin/skgemib.c') diff --git a/drivers/net/sk98lin/skgemib.c b/drivers/net/sk98lin/skgemib.c index 0a6f67a7a39..fde45083eb7 100644 --- a/drivers/net/sk98lin/skgemib.c +++ b/drivers/net/sk98lin/skgemib.c @@ -82,7 +82,7 @@ PNMI_STATIC int DiagActions(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id, /* defines *******************************************************************/ -#define ID_TABLE_SIZE (sizeof(IdTable)/sizeof(IdTable[0])) +#define ID_TABLE_SIZE ARRAY_SIZE(IdTable) /* global variables **********************************************************/ -- cgit v1.2.3