Skip to contentSkip to conversation

arch/arm: fixes static strings declaration

PATCH In review Ricardo Nabinger Sanchez 1 participant 2 messages May 26, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/arm: fixes static strings declaration

o Fixes strings declaration from char *str = ""; to char str[] = "";, avoiding the extra pointer, as noted by Jeff Garzik. The strings' contents are not changed after declared.

 arch/arm/mm/mm-armv.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mm/mm-armv.c +2 -2
diff -urNp -X dontdiff linux-2.6.11.10/arch/arm/mm/mm-armv.c mod-linux-2.6.11.10/arch/arm/mm/mm-armv.c
@@ -102,14 +102,14 @@ static void __init early_cachepolicy(cha
 
 static void __init early_nocache(char **__unused)
 {
-	char *p = "buffered";
+	char p[] = "buffered";
 	printk(KERN_WARNING "nocache is deprecated; use cachepolicy=%s\n", p);
 	early_cachepolicy(&p);
 }
 
 static void __init early_nowrite(char **__unused)
 {
-	char *p = "uncached";
+	char p[] = "uncached";
 	printk(KERN_WARNING "nowb is deprecated; use cachepolicy=%s\n", p);
 	early_cachepolicy(&p);
 }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

Quoting Ricardo Nabinger Sanchez <[email protected]> Sent on Thu, 26 May 2005 12:07:24 -0300

Quoted 3 lines

o Fixes strings declaration from char *str = ""; to char str[] = "";, avoiding the extra pointer, as noted by Jeff Garzik. The strings' contents are not changed after declared.

Domen pointed me that this patch is likely to be incorrect, and in fact is.

Please drop this, I'll try to fix this and then submit a new patch.

Sorry for the noise.

Signature · 6 lines
Ricardo Nabinger Sanchez
GNU/Linux #140696 [http://counter.li.org]
Slackware Linux + FreeBSD

    How long a minute is depends on which 
    side of the bathroom door you're on.

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors