[PATCH 2/2] mtd/uclinux: add a comment about why uclinux_ram_map must not be static

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Fri Oct 12 03:41:33 EDT 2012


I was (at least) the second person trying to fix a warning by sparse, so
document in the code why this is a bad idea.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
Hello,

it's a bit exaggerated to claim that sparse is happy now, but at least
we have one warning less :-)

Uwe
 drivers/mtd/maps/uclinux.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c
index f5e8e9a..18cf6d0 100644
--- a/drivers/mtd/maps/uclinux.c
+++ b/drivers/mtd/maps/uclinux.c
@@ -23,6 +23,12 @@
 
 /****************************************************************************/
 
+/*
+ * Blackfin uses uclinux_ram_map during startup, so it must not be static.
+ * Provide a dummy declaration to make sparse happy.
+ */
+extern struct map_info uclinux_ram_map;
+
 struct map_info uclinux_ram_map = {
 	.size = 0,
 };
-- 
1.7.10.4




More information about the linux-mtd mailing list