diff mbox

[02/25] arch/powerpc: Use static const char arrays

Message ID a2d6296e9aabed2de77ae0b44f16b13008129e48.1284406638.git.joe@perches.com (mailing list archive)
State Accepted, archived
Delegated to: Benjamin Herrenschmidt
Headers show

Commit Message

Joe Perches Sept. 13, 2010, 7:47 p.m. UTC
Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/powerpc/boot/addnote.c    |    4 ++--
 arch/powerpc/boot/cuboot-c2k.c |    4 ++--
 arch/powerpc/kernel/irq.c      |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

Comments

Stephen Rothwell Sept. 14, 2010, 2:02 a.m. UTC | #1
Hi Joe,

On Mon, 13 Sep 2010 12:47:40 -0700 Joe Perches <joe@perches.com> wrote:
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  arch/powerpc/boot/addnote.c    |    4 ++--
>  arch/powerpc/boot/cuboot-c2k.c |    4 ++--
>  arch/powerpc/kernel/irq.c      |    2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)

I am also unsure that the transformation to cuboot-c2k.c adds anything.
Other than that

Reviewed-by: Stephen Rothwell <sfr@canb.auug.org.au>
Stephen Rothwell Sept. 14, 2010, 2:04 a.m. UTC | #2
BTW, Ben Herrenschmidt is the current PowerPC maintainer.
diff mbox

Patch

diff --git a/arch/powerpc/boot/addnote.c b/arch/powerpc/boot/addnote.c
index b1e5611..349b553 100644
--- a/arch/powerpc/boot/addnote.c
+++ b/arch/powerpc/boot/addnote.c
@@ -20,7 +20,7 @@ 
 #include <string.h>
 
 /* CHRP note section */
-char arch[] = "PowerPC";
+static const char arch[] = "PowerPC";
 
 #define N_DESCR	6
 unsigned int descr[N_DESCR] = {
@@ -33,7 +33,7 @@  unsigned int descr[N_DESCR] = {
 };
 
 /* RPA note section */
-char rpaname[] = "IBM,RPA-Client-Config";
+static const char rpaname[] = "IBM,RPA-Client-Config";
 
 /*
  * Note: setting ignore_my_client_config *should* mean that OF ignores
diff --git a/arch/powerpc/boot/cuboot-c2k.c b/arch/powerpc/boot/cuboot-c2k.c
index e435949..030d7db 100644
--- a/arch/powerpc/boot/cuboot-c2k.c
+++ b/arch/powerpc/boot/cuboot-c2k.c
@@ -62,9 +62,9 @@  static void c2k_bridge_setup(u32 mem_size)
 	/* Get the cpu -> pci i/o & mem mappings from the device tree */
 	devp = NULL;
 	for (bus = 0; ; bus++) {
-		char name[] = "pci ";
+		char name[sizeof("pciX")];
 
-		name[strlen(name)-1] = bus+'0';
+		sprintf(name, "pci%c", bus + '0');
 
 		devp = find_node_by_alias(name);
 		if (devp == NULL)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 4a65386..47fbc56 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -1143,7 +1143,7 @@  static int virq_debug_show(struct seq_file *m, void *private)
 	unsigned long flags;
 	struct irq_desc *desc;
 	const char *p;
-	char none[] = "none";
+	static const char none[] = "none";
 	int i;
 
 	seq_printf(m, "%-5s  %-7s  %-15s  %s\n", "virq", "hwirq",