[PATCH] drivers/video: Use ARRAY_SIZE macro

Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove
duplicates of ARRAY_SIZE.  Some coding style and trailing whitespaces are
also fixed.

Compile-tested where possible (some are other arch or BROKEN)

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Tobias Klauser
2006-03-27 01:17:39 -08:00
committed by Linus Torvalds
parent b0c8797821
commit d1ae418eef
17 changed files with 58 additions and 57 deletions
+4 -4
View File
@@ -165,20 +165,20 @@ static int neoFindMode(int xres, int yres, int depth)
switch (depth) {
case 8:
size = sizeof(bios8) / sizeof(biosMode);
size = ARRAY_SIZE(bios8);
mode = bios8;
break;
case 16:
size = sizeof(bios16) / sizeof(biosMode);
size = ARRAY_SIZE(bios16);
mode = bios16;
break;
case 24:
size = sizeof(bios24) / sizeof(biosMode);
size = ARRAY_SIZE(bios24);
mode = bios24;
break;
#ifdef NO_32BIT_SUPPORT_YET
case 32:
size = sizeof(bios32) / sizeof(biosMode);
size = ARRAY_SIZE(bios32);
mode = bios32;
break;
#endif