Skip to content

Commit

Permalink
dio: ARRAY_SIZE() cleanup
Browse files Browse the repository at this point in the history
[Geert: eliminate NUMNAMES, as suggested by Richard Knutsson ]
[akpm@linux-foundation.org: coding-syle fixes]
Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
unleashed authored and Linus Torvalds committed Feb 5, 2008
1 parent b9e5e11 commit 0a8320b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/dio/dio.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,14 @@ static struct dioname names[] =
#undef DIONAME
#undef DIOFBNAME

#define NUMNAMES (sizeof(names) / sizeof(struct dioname))

static const char *unknowndioname
= "unknown DIO board -- please email <linux-m68k@lists.linux-m68k.org>!";

static const char *dio_getname(int id)
{
/* return pointer to a constant string describing the board with given ID */
unsigned int i;
for (i = 0; i < NUMNAMES; i++)
for (i = 0; i < ARRAY_SIZE(names); i++)
if (names[i].id == id)
return names[i].name;

Expand Down

0 comments on commit 0a8320b

Please sign in to comment.