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 ]
[[email protected]: coding-syle fixes]
Signed-off-by: Alejandro Martinez Ruiz <[email protected]>
Signed-off-by: Geert Uytterhoeven <[email protected]>
Cc: Richard Knutsson <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • 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 <[email protected]>!";

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.