Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sgivwfb: Make use of ARRAY_SIZE.

Cleanup the usage of DBE_VT_SIZE since the kernel already defines the
same macro for the same propose.

Also clean up a surrounding whitespaces.

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Thiago Farina and committed by
Jiri Kosina
96c085db 809aaaae

+7 -8
+2 -2
drivers/video/sgivwfb.c
··· 260 260 var->grayscale = 0; /* No grayscale for now */ 261 261 262 262 /* determine valid resolution and timing */ 263 - for (min_mode = 0; min_mode < DBE_VT_SIZE; min_mode++) { 263 + for (min_mode = 0; min_mode < ARRAY_SIZE(dbeVTimings); min_mode++) { 264 264 if (dbeVTimings[min_mode].width >= var->xres && 265 265 dbeVTimings[min_mode].height >= var->yres) 266 266 break; 267 267 } 268 268 269 - if (min_mode == DBE_VT_SIZE) 269 + if (min_mode == ARRAY_SIZE(dbeVTimings)) 270 270 return -EINVAL; /* Resolution to high */ 271 271 272 272 /* XXX FIXME - should try to pick best refresh rate */
+5 -6
include/video/sgivw.h
··· 351 351 struct dbe_timing_info 352 352 { 353 353 dbe_timing_t type; 354 - int flags; 354 + int flags; 355 355 short width; /* Monitor resolution */ 356 356 short height; 357 357 int fields_sec; /* fields/sec (Hz -3 dec. places */ ··· 389 389 { 390 390 DBE_VT_640_480_60, 391 391 /* flags, width, height, fields_sec, cfreq */ 392 - 0, 640, 480, 59940, 25175, 392 + 0, 640, 480, 59940, 25175, 393 393 /* htotal, hblank_start, hblank_end, hsync_start, hsync_end */ 394 - 800, 640, 800, 656, 752, 394 + 800, 640, 800, 656, 752, 395 395 /* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */ 396 - 525, 480, 525, 490, 492, 396 + 525, 480, 525, 490, 492, 397 397 /* pll_m, pll_n, pll_p */ 398 398 15, 2, 3 399 399 }, ··· 650 650 /* pll_m, pll_n, pll_p */ 651 651 6, 1, 0 652 652 }, 653 - 653 + 654 654 { 655 655 DBE_VT_1920_1200_60, 656 656 /* flags, width, height, fields_sec, cfreq */ ··· 676 676 } 677 677 }; 678 678 679 - #define DBE_VT_SIZE (sizeof(dbeVTimings)/sizeof(dbeVTimings[0])) 680 679 #endif // INCLUDE_TIMING_TABLE_DATA 681 680 682 681 #endif // ! __SGIVWFB_H__