From patchwork Wed Jan 16 14:36:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [v4, 2/2] mtd/uclinux: add a comment about why uclinux_ram_map must not be static From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 212537 Message-Id: <1358347016-507-2-git-send-email-u.kleine-koenig@pengutronix.de> To: linux-mtd@lists.infradead.org Cc: Mike Frysinger , kernel@pengutronix.de, Greg Ungerer Date: Wed, 16 Jan 2013 15:36:56 +0100 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 Acked-by: Mike Frysinger Acked-by: Greg Ungerer --- No changes between v3 and v4. Changes since v2, id:1350027693-19528-2-git-send-email-u.kleine-koenig@pengutronix.de: - note in the commit log that an extern declaration was added for sparse Changes since v1: - new patch --- 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 f56d0aa..c1af83d 100644 --- a/drivers/mtd/maps/uclinux.c +++ b/drivers/mtd/maps/uclinux.c @@ -29,6 +29,12 @@ #define MAP_NAME "ram" #endif +/* + * 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 = { .name = MAP_NAME, .size = 0,