Skip to contentSkip to conversation

radeonfb: screeninfo initialization cleanup

PATCH New Geert Uytterhoeven 2 participants 2 messages Oct 29, 2004 1 message not in the archive Framebuffer layer

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 14 lines · Linux Kernel Mailing List

ChangeSet 1.2265, 2004/10/28 08:23:51-07:00, [email protected]

[PATCH] radeonfb: screeninfo initialization cleanup

This patch changes the initialization of radeonfb_default_var to use named initializers and avoids explicitly setting fields that are automatically zeroed.

drivers/video/aty/radeon_monitor.c +0 -0
@@ -7,10 +7,25 @@
 #endif /* CONFIG_PPC_OF */
 
 static struct fb_var_screeninfo radeonfb_default_var = {

drivers/video/aty/radeon_monitor.c line 15

Quoted 10 lines
drivers/video/aty/radeon_monitor.c +6 -4
-        640, 480, 640, 480, 0, 0, 8, 0,
-        {0, 6, 0}, {0, 6, 0}, {0, 6, 0}, {0, 0, 0},
-        0, 0, -1, -1, 0, 39721, 40, 24, 32, 11, 96, 2,
-        0, FB_VMODE_NONINTERLACED
+	.xres		= 640,
+	.yres		= 480,
+	.xres_virtual	= 640,
+	.yres_virtual	= 480,
+	.bits_per_pixel = 8,
+	.red		= { 0, 6, 0 },
                               ^

drivers/video/aty/radeon_monitor.c line 16

Quoted 1 line
drivers/video/aty/radeon_monitor.c +1 -0
+	.green		= { 0, 6, 0 },
                               ^

drivers/video/aty/radeon_monitor.c line 17

Quoted 1 line
drivers/video/aty/radeon_monitor.c +1 -0
+	.blue		= { 0, 6, 0 },
                               ^

Should be 8 these days (256 usable color palette entries).
And why not use `{ .length = 8 }' if you don't care about automatically zeroed fields?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

#2 lore raw

PATCH 1/1 radeonfb: more initializer fixes

Use 8-bit palette entries for radeonfb and avoid zero-initialization as suggested by Geert Uytterhoeven.

---

 radeon_monitor.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/video/aty/radeon_monitor.c +3 -3
Index: 2.6.10-rc1-mm1/drivers/video/aty/radeon_monitor.c
===================================================================
@@ -12,9 +12,9 @@
 	.xres_virtual	= 640,
 	.yres_virtual	= 480,
 	.bits_per_pixel = 8,
-	.red		= { 0, 6, 0 },
-	.green		= { 0, 6, 0 },
-	.blue		= { 0, 6, 0 },
+	.red		= { .length = 8 },
+	.green		= { .length = 8 },
+	.blue		= { .length = 8 },
 	.activate	= FB_ACTIVATE_NOW,
 	.height		= -1,
 	.width		= -1,