diff options
author | Tobias Klauser <tklauser@nuerscht.ch> | 2006-03-27 04:17:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:44:58 -0500 |
commit | d1ae418eef4ce763a95edec0b5fc095af5daca2e (patch) | |
tree | 251158f7887435cd058293c2532eafd722adff3a /drivers/video/asiliantfb.c | |
parent | b0c87978216836455ef5fbcac6df1ce6679750b0 (diff) |
[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>
Diffstat (limited to 'drivers/video/asiliantfb.c')
-rw-r--r-- | drivers/video/asiliantfb.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/video/asiliantfb.c b/drivers/video/asiliantfb.c index c924d81f7978..29f9f0dfe3b4 100644 --- a/drivers/video/asiliantfb.c +++ b/drivers/video/asiliantfb.c | |||
@@ -353,8 +353,6 @@ struct chips_init_reg { | |||
353 | unsigned char data; | 353 | unsigned char data; |
354 | }; | 354 | }; |
355 | 355 | ||
356 | #define N_ELTS(x) (sizeof(x) / sizeof(x[0])) | ||
357 | |||
358 | static struct chips_init_reg chips_init_sr[] = | 356 | static struct chips_init_reg chips_init_sr[] = |
359 | { | 357 | { |
360 | {0x00, 0x03}, /* Reset register */ | 358 | {0x00, 0x03}, /* Reset register */ |
@@ -460,22 +458,22 @@ static void __devinit chips_hw_init(struct fb_info *p) | |||
460 | { | 458 | { |
461 | int i; | 459 | int i; |
462 | 460 | ||
463 | for (i = 0; i < N_ELTS(chips_init_xr); ++i) | 461 | for (i = 0; i < ARRAY_SIZE(chips_init_xr); ++i) |
464 | write_xr(chips_init_xr[i].addr, chips_init_xr[i].data); | 462 | write_xr(chips_init_xr[i].addr, chips_init_xr[i].data); |
465 | write_xr(0x81, 0x12); | 463 | write_xr(0x81, 0x12); |
466 | write_xr(0x82, 0x08); | 464 | write_xr(0x82, 0x08); |
467 | write_xr(0x20, 0x00); | 465 | write_xr(0x20, 0x00); |
468 | for (i = 0; i < N_ELTS(chips_init_sr); ++i) | 466 | for (i = 0; i < ARRAY_SIZE(chips_init_sr); ++i) |
469 | write_sr(chips_init_sr[i].addr, chips_init_sr[i].data); | 467 | write_sr(chips_init_sr[i].addr, chips_init_sr[i].data); |
470 | for (i = 0; i < N_ELTS(chips_init_gr); ++i) | 468 | for (i = 0; i < ARRAY_SIZE(chips_init_gr); ++i) |
471 | write_gr(chips_init_gr[i].addr, chips_init_gr[i].data); | 469 | write_gr(chips_init_gr[i].addr, chips_init_gr[i].data); |
472 | for (i = 0; i < N_ELTS(chips_init_ar); ++i) | 470 | for (i = 0; i < ARRAY_SIZE(chips_init_ar); ++i) |
473 | write_ar(chips_init_ar[i].addr, chips_init_ar[i].data); | 471 | write_ar(chips_init_ar[i].addr, chips_init_ar[i].data); |
474 | /* Enable video output in attribute index register */ | 472 | /* Enable video output in attribute index register */ |
475 | writeb(0x20, mmio_base + 0x780); | 473 | writeb(0x20, mmio_base + 0x780); |
476 | for (i = 0; i < N_ELTS(chips_init_cr); ++i) | 474 | for (i = 0; i < ARRAY_SIZE(chips_init_cr); ++i) |
477 | write_cr(chips_init_cr[i].addr, chips_init_cr[i].data); | 475 | write_cr(chips_init_cr[i].addr, chips_init_cr[i].data); |
478 | for (i = 0; i < N_ELTS(chips_init_fr); ++i) | 476 | for (i = 0; i < ARRAY_SIZE(chips_init_fr); ++i) |
479 | write_fr(chips_init_fr[i].addr, chips_init_fr[i].data); | 477 | write_fr(chips_init_fr[i].addr, chips_init_fr[i].data); |
480 | } | 478 | } |
481 | 479 | ||