aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/chipsfb.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@nuerscht.ch>2006-03-27 04:17:39 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 11:44:58 -0500
commitd1ae418eef4ce763a95edec0b5fc095af5daca2e (patch)
tree251158f7887435cd058293c2532eafd722adff3a /drivers/video/chipsfb.c
parentb0c87978216836455ef5fbcac6df1ce6679750b0 (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/chipsfb.c')
-rw-r--r--drivers/video/chipsfb.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c
index bc061d4ec786..72ff6bf75e5e 100644
--- a/drivers/video/chipsfb.c
+++ b/drivers/video/chipsfb.c
@@ -178,8 +178,6 @@ struct chips_init_reg {
178 unsigned char data; 178 unsigned char data;
179}; 179};
180 180
181#define N_ELTS(x) (sizeof(x) / sizeof(x[0]))
182
183static struct chips_init_reg chips_init_sr[] = { 181static struct chips_init_reg chips_init_sr[] = {
184 { 0x00, 0x03 }, 182 { 0x00, 0x03 },
185 { 0x01, 0x01 }, 183 { 0x01, 0x01 },
@@ -287,18 +285,18 @@ static void __init chips_hw_init(void)
287{ 285{
288 int i; 286 int i;
289 287
290 for (i = 0; i < N_ELTS(chips_init_xr); ++i) 288 for (i = 0; i < ARRAY_SIZE(chips_init_xr); ++i)
291 write_xr(chips_init_xr[i].addr, chips_init_xr[i].data); 289 write_xr(chips_init_xr[i].addr, chips_init_xr[i].data);
292 outb(0x29, 0x3c2); /* set misc output reg */ 290 outb(0x29, 0x3c2); /* set misc output reg */
293 for (i = 0; i < N_ELTS(chips_init_sr); ++i) 291 for (i = 0; i < ARRAY_SIZE(chips_init_sr); ++i)
294 write_sr(chips_init_sr[i].addr, chips_init_sr[i].data); 292 write_sr(chips_init_sr[i].addr, chips_init_sr[i].data);
295 for (i = 0; i < N_ELTS(chips_init_gr); ++i) 293 for (i = 0; i < ARRAY_SIZE(chips_init_gr); ++i)
296 write_gr(chips_init_gr[i].addr, chips_init_gr[i].data); 294 write_gr(chips_init_gr[i].addr, chips_init_gr[i].data);
297 for (i = 0; i < N_ELTS(chips_init_ar); ++i) 295 for (i = 0; i < ARRAY_SIZE(chips_init_ar); ++i)
298 write_ar(chips_init_ar[i].addr, chips_init_ar[i].data); 296 write_ar(chips_init_ar[i].addr, chips_init_ar[i].data);
299 for (i = 0; i < N_ELTS(chips_init_cr); ++i) 297 for (i = 0; i < ARRAY_SIZE(chips_init_cr); ++i)
300 write_cr(chips_init_cr[i].addr, chips_init_cr[i].data); 298 write_cr(chips_init_cr[i].addr, chips_init_cr[i].data);
301 for (i = 0; i < N_ELTS(chips_init_fr); ++i) 299 for (i = 0; i < ARRAY_SIZE(chips_init_fr); ++i)
302 write_fr(chips_init_fr[i].addr, chips_init_fr[i].data); 300 write_fr(chips_init_fr[i].addr, chips_init_fr[i].data);
303} 301}
304 302