Skip to contentSkip to conversation

Fix warning in aty128fb

PATCH In review Daniele Venzano 2 participants 5 messages Jan 20, 2009 – Jan 23, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix warning in aty128fb

The attached patch fixes a "defined but not used" warning in aty128fb when CONFIG_PMAC_BACKLIGHT is not defined. Made against 2.6.28.1.

If all is well I think I will make other similar patches, fixing warnings and errors found with randconfig.

drivers/video/aty/aty128fb.c renamed from drivers/video/aty/aty128fb.c.old +0 -2
@@ -359,8 +359,6 @@ static int mtrr = 1;
 
 #ifdef CONFIG_PMAC_BACKLIGHT
 static int backlight __devinitdata = 1;
-#else
-static int backlight __devinitdata = 0;
 #endif
 
 /* PLL constants */
#1 lore raw

2009/1/20 Daniele Venzano <[email protected]>:

Quoted 7 lines

The attached patch fixes a "defined but not used" warning in aty128fb when CONFIG_PMAC_BACKLIGHT is not defined. Made against 2.6.28.1.

If all is well I think I will make other similar patches, fixing warnings and errors found with randconfig.

This patch breaks the kernel compilation if aty128fb is compiled in the kernel (not as a module) see line 1660 :

<http://lxr.linux.no/linux+v2.6.28.1/drivers/video/aty/aty128fb.c#L1660>

(and please, try to post the patch in the email body, not as an attachement if you can (cf Documentation/email-clients.txt ))

richard.

#2 lore raw
In reply to Daniele Venzano

I changed the patch to not define backlight only in case the driver is compiled as module. Now it compiles both statically or as module without errors or warnings.

Patch is against 2.6.28.1

drivers/video/aty/aty128fb.c renamed from drivers/video/aty/aty128fb.c.old +2 -0
@@ -360,8 +360,10 @@ static int mtrr = 1;
 #ifdef CONFIG_PMAC_BACKLIGHT
 static int backlight __devinitdata = 1;
 #else
+#ifndef MODULE
 static int backlight __devinitdata = 0;
 #endif
+#endif
 
 /* PLL constants */
 struct aty128_constants {
Reviewed-by on v1 1/1
#3 lore raw
In reply to Daniele Venzano

2009/1/23 Daniele Venzano <[email protected]>:

Quoted 12 lines

I changed the patch to not define backlight only in case the driver is compiled as module. Now it compiles both statically or as module without errors or warnings.

Patch is against 2.6.28.1

drivers/video/aty/aty128fb.c 2009-01-23 11:34:16.000000000 +0100 static int mtrr = 1; · line 369

Quoted 10 lines
drivers/video/aty/aty128fb.c 2009-01-23 11:34:16.000000000 +0100 renamed from drivers/video/aty/aty128fb.c.old 2009-01-20 16:08:06.000000000 +0100 +2 -0
@@ -360,8 +360,10 @@ static int mtrr = 1;
 #ifdef CONFIG_PMAC_BACKLIGHT
 static int backlight __devinitdata = 1;
 #else
+#ifndef MODULE
 static int backlight __devinitdata = 0;
 #endif
+#endif
 
 /* PLL constants */
 struct aty128_constants {

[Added CC:Brad]

#4 lore raw
In reply to Daniele Venzano

2009/1/23 Richard Genoud <[email protected]>:

Quoted 20 lines

2009/1/23 Daniele Venzano <[email protected]>:

Quoted 19 lines

I changed the patch to not define backlight only in case the driver is compiled as module. Now it compiles both statically or as module without errors or warnings.

Patch is against 2.6.28.1

drivers/video/aty/aty128fb.c 2009-01-23 11:34:16.000000000 +0100 renamed from drivers/video/aty/aty128fb.c.old 2009-01-20 16:08:06.000000000 +0100 +2 -0
@@ -360,8 +360,10 @@ static int mtrr = 1;
 #ifdef CONFIG_PMAC_BACKLIGHT
 static int backlight __devinitdata = 1;
 #else
+#ifndef MODULE
 static int backlight __devinitdata = 0;
 #endif
+#endif
 
Quoted 8 lines

drivers/video/aty/aty128fb.c 2009-01-23 11:34:16.000000000 +0100 static int mtrr = 1; · line 369

Quoted 3 lines
drivers/video/aty/aty128fb.c 2009-01-23 11:34:16.000000000 +0100 renamed from drivers/video/aty/aty128fb.c.old 2009-01-20 16:08:06.000000000 +0100 +0 -0
 /* PLL constants */
 struct aty128_constants {

[Added CC:Brad]

sorry, there's still an error in the path (I reviewed a little bit to fast...). the compilation breaks if "ATI Rage128 display support" is compile as a module and "Support for backlight control (FB_ATY128_BACKLIGHT)" is set
(cf line 1997)