[PATCH 2/2] fb: fix atyfb unused data warnings

STALE4791d

4 messages, 3 authors, 2013-06-26 · open the first message on its own page

[PATCH 2/2] fb: fix atyfb unused data warnings

From: Randy Dunlap <hidden>
Date: 2013-06-20 02:39:35

From: Randy Dunlap <redacted>

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]

Signed-off-by: Randy Dunlap <redacted>
Cc:	Paul Mackerras <redacted>
Cc:	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc:	linux-fbdev@vger.kernel.org
Cc:	Jean-Christophe Plagniol-Villard <redacted>
Cc:	Tomi Valkeinen <redacted>
---
 drivers/video/aty/atyfb_base.c |    2 ++
 1 file changed, 2 insertions(+)
--- linux-next-20130619.orig/drivers/video/aty/atyfb_base.c
+++ linux-next-20130619/drivers/video/aty/atyfb_base.c
@@ -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 */

Re: [PATCH 2/2] fb: fix atyfb unused data warnings

From: Jean-Christophe PLAGNIOL-VILLARD <hidden>
Date: 2013-06-24 14:51:34

On 19:39 Wed 19 Jun     , Randy Dunlap wrote:
quoted hunk
From: Randy Dunlap <redacted>

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]

Signed-off-by: Randy Dunlap <redacted>
Cc:	Paul Mackerras <redacted>
Cc:	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc:	linux-fbdev@vger.kernel.org
Cc:	Jean-Christophe Plagniol-Villard <redacted>
Cc:	Tomi Valkeinen <redacted>
---
 drivers/video/aty/atyfb_base.c |    2 ++
 1 file changed, 2 insertions(+)
--- linux-next-20130619.orig/drivers/video/aty/atyfb_base.c
+++ linux-next-20130619/drivers/video/aty/atyfb_base.c
@@ -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
+#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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

From: Randy Dunlap <hidden>
Date: 2013-06-24 17:54:46

From: Randy Dunlap <redacted>

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]

Signed-off-by: Randy Dunlap <redacted>
Cc:	Paul Mackerras <redacted>
Cc:	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc:	linux-fbdev@vger.kernel.org
Cc:	Jean-Christophe Plagniol-Villard <redacted>
Cc:	Tomi Valkeinen <redacted>
---
 drivers/video/aty/atyfb_base.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--- lnx-310-rc7.orig/drivers/video/aty/atyfb_base.c
+++ lnx-310-rc7/drivers/video/aty/atyfb_base.c
@@ -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 */

Re: [PATCH 2/2 v2] fb: fix atyfb unused data warnings

From: Tomi Valkeinen <hidden>
Date: 2013-06-26 12:16:37

On 24/06/13 20:54, Randy Dunlap wrote:
From: Randy Dunlap <redacted>

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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help