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

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Thu Jan 10 11:31:38 EST 2013


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 and add an extern declaration to
make sparse happy.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
Acked-by: Mike Frysinger <vapier at gentoo.org>
Acked-by: Greg Ungerer <gerg at uclinux.org>
---
Changes since v2, sent with
Message-Id: 1350027693-19528-2-git-send-email-u.kleine-koenig at pengutronix.de:

- note in the commit log that an extern declaration was added for sparse

 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 b3a9c54..fe1c83c 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