Skip to contentSkip to conversation

fb: fix atyfb unused data warnings

PATCH In review Randy Dunlap 3 participants 4 messages Jun 20, 2013 – Jun 26, 2013 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 fb: fix atyfb unused data warnings

From: Randy Dunlap <[email protected]>

Fix compiler warnings of data defined but not used. They are only used with certain kconfig settings.

drivers/video/aty/atyfb_base.c:534:13: warning: 'ram_dram' defined but not used [-Wunused-variable] drivers/video/aty/atyfb_base.c:535:13: warning: 'ram_resv' defined but not used [-Wunused-variable]

Cc Paul Mackerras <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Jean-Christophe Plagniol-Villard <[email protected]>
Cc Tomi Valkeinen <[email protected]>
---
 drivers/video/aty/atyfb_base.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/video/aty/atyfb_base.c +2 -0
@@ -531,8 +531,10 @@ static int correct_chipset(struct atyfb_
 	return 0;
 }
 
+#if defined(CONFIG_FB_ATY_GX) || defined(CONFIG_FB_ATY_CT)
 static char ram_dram[] = "DRAM";
 static char ram_resv[] = "RESV";
+#endif
 #ifdef CONFIG_FB_ATY_GX
 static char ram_vram[] = "VRAM";
 #endif /* CONFIG_FB_ATY_GX */
#1 lore raw
Quoted 21 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Fix compiler warnings of data defined but not used. They are only used with certain kconfig settings.

drivers/video/aty/atyfb_base.c:534:13: warning: 'ram_dram' defined but not used [-Wunused-variable] drivers/video/aty/atyfb_base.c:535:13: warning: 'ram_resv' defined but not used [-Wunused-variable]

Cc Paul Mackerras <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Jean-Christophe Plagniol-Villard <[email protected]>
Cc Tomi Valkeinen <[email protected]>
---
 drivers/video/aty/atyfb_base.c |    2 ++
 1 file changed, 2 insertions(+)

drivers/video/aty/atyfb_base.c static int correct_chipset(struct atyfb_ · line 536

Quoted 6 lines
drivers/video/aty/atyfb_base.c +1 -0
@@ -531,8 +531,10 @@ static int correct_chipset(struct atyfb_
 	return 0;
 }
 
+#if defined(CONFIG_FB_ATY_GX) || defined(CONFIG_FB_ATY_CT)
 static char ram_dram[] = "DRAM";
 static char ram_resv[] = "RESV";

use __maybe_unused macro instead of the ifdef

Quoted 8 lines
drivers/video/aty/atyfb_base.c +1 -1
+#endif
 #ifdef CONFIG_FB_ATY_GX
 static char ram_vram[] = "VRAM";
 #endif /* CONFIG_FB_ATY_GX */
--

To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

PATCH v2 2/2 fb: fix atyfb unused data warnings

From: Randy Dunlap <[email protected]>

Fix compiler warnings of data defined but not used by using the __maybe_unused attribute. The date are only used with certain kconfig settings.

drivers/video/aty/atyfb_base.c:534:13: warning: 'ram_dram' defined but not used [-Wunused-variable] drivers/video/aty/atyfb_base.c:535:13: warning: 'ram_resv' defined but not used [-Wunused-variable]

Cc Paul Mackerras <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Jean-Christophe Plagniol-Villard <[email protected]>
Cc Tomi Valkeinen <[email protected]>
---
 drivers/video/aty/atyfb_base.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/video/aty/atyfb_base.c +3 -2
@@ -58,6 +58,7 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
+#include <linux/compiler.h>
 #include <linux/console.h>
 #include <linux/fb.h>
 #include <linux/init.h>
@@ -531,8 +532,8 @@ static int correct_chipset(struct atyfb_
 	return 0;
 }
 
-static char ram_dram[] = "DRAM";
-static char ram_resv[] = "RESV";
+static char ram_dram[] __maybe_unused = "DRAM";
+static char ram_resv[] __maybe_unused = "RESV";
 #ifdef CONFIG_FB_ATY_GX
 static char ram_vram[] = "VRAM";
 #endif /* CONFIG_FB_ATY_GX */
#3 lore raw
Quoted 9 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Fix compiler warnings of data defined but not used by using the __maybe_unused attribute. The date are only used with certain kconfig settings.

drivers/video/aty/atyfb_base.c:534:13: warning: 'ram_dram' defined but not used [-Wunused-variable] drivers/video/aty/atyfb_base.c:535:13: warning: 'ram_resv' defined but not used [-Wunused-variable]

I've added this and the first patch in the series to my fbdev-3.11 branch.

Tomi