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

login
register
mail settings
Submitter Uwe Kleine-König
Date Oct. 12, 2012, 7:41 a.m.
Message ID <1350027693-19528-2-git-send-email-u.kleine-koenig@pengutronix.de>
Download mbox | patch
Permalink /patch/191067/
State New
Headers show

Comments

Uwe Kleine-König - Oct. 12, 2012, 7:41 a.m.
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@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(+)
Mike Frysinger - Oct. 12, 2012, 4:23 p.m.
On Fri, Oct 12, 2012 at 3:41 AM, Uwe Kleine-König wrote:
> 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.

Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
Greg Ungerer - Oct. 15, 2012, 4:15 a.m.
On 12/10/12 17:41, Uwe Kleine-König wrote:
> 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@pengutronix.de>

Acked-by: Greg Ungerer <gerg@uclinux.org>


> ---
> 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,
>   };
>

Patch

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,
 };