Skip to contentSkip to conversation

powerpc/32: Make some functions static

PATCH Superseded Mathieu Malaterre 2 participants 6 messages Apr 8, 2018 – Jun 27, 2018 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/32: Make some functions static

In commit 4aea909eeba3 ("powerpc: Add missing prototypes in setup_32.c") prototypes for

- ppc_setup_l2cr
- ppc_setup_l3cr
- ppc_init

were added but at the same time in commit d15a261d876d ("powerpc/32: Make some functions static") those same functions were made static. Fix conflicting changes by removing the prototypes and leave the function as static. Fix the following warnings, treated as errors with W=1:

arch/powerpc/kernel/setup_32.c:127:19: error: static declaration of ‘ppc_setup_l2cr’ follows non-static declaration arch/powerpc/kernel/setup_32.c:140:19: error: static declaration of ‘ppc_setup_l3cr’ follows non-static declaration arch/powerpc/kernel/setup_32.c:186:19: error: static declaration of ‘ppc_init’ follows non-static declaration

---
 arch/powerpc/kernel/setup_32.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/kernel/setup_32.c +3 -3
index 9827b6b3aaaa..9e79be13b937 100644
@@ -124,7 +124,7 @@ notrace void __init machine_init(u64 dt_ptr)
 }
 
 /* Checks "l2cr=xxxx" command-line option */
-static int __init ppc_setup_l2cr(char *str)
+int __init ppc_setup_l2cr(char *str)
 {
 	if (cpu_has_feature(CPU_FTR_L2CR)) {
 		unsigned long val = simple_strtoul(str, NULL, 0);
@@ -137,7 +137,7 @@ static int __init ppc_setup_l2cr(char *str)
 __setup("l2cr=", ppc_setup_l2cr);
 
 /* Checks "l3cr=xxxx" command-line option */
-static int __init ppc_setup_l3cr(char *str)
+int __init ppc_setup_l3cr(char *str)
 {
 	if (cpu_has_feature(CPU_FTR_L3CR)) {
 		unsigned long val = simple_strtoul(str, NULL, 0);
@@ -183,7 +183,7 @@ EXPORT_SYMBOL(nvram_sync);
 
 #endif /* CONFIG_NVRAM */
 
-static int __init ppc_init(void)
+int __init ppc_init(void)
 {
 	/* clear the progress line */
 	if (ppc_md.progress)
Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 1/1 powerpc/32: Make some functions static

In commit 4aea909eeba3 ("powerpc: Add missing prototypes in setup_32.c") prototypes for

- ppc_setup_l2cr
- ppc_setup_l3cr
- ppc_init

were added but at the same time in commit d15a261d876d ("powerpc/32: Make some functions static") those same functions were made static. Fix conflicting changes by removing the prototypes and leave the function as static. Fix the following warnings, treated as errors with W=1:

arch/powerpc/kernel/setup_32.c:127:19: error: static declaration of ‘ppc_setup_l2cr’ follows non-static declaration arch/powerpc/kernel/setup_32.c:140:19: error: static declaration of ‘ppc_setup_l3cr’ follows non-static declaration arch/powerpc/kernel/setup_32.c:186:19: error: static declaration of ‘ppc_init’ follows non-static declaration

---
v2: Previous version contained the reverted patch, correct that.

 arch/powerpc/kernel/setup.h | 3 ---
 1 file changed, 3 deletions(-)
arch/powerpc/kernel/setup.h +0 -3
index 35ca309848d7..829ed66f0a40 100644
@@ -19,9 +19,6 @@ void irqstack_early_init(void);
 void setup_power_save(void);
 unsigned long __init early_init(unsigned long dt_ptr);
 void __init machine_init(u64 dt_ptr);
-int __init ppc_setup_l2cr(char *str);
-int __init ppc_setup_l3cr(char *str);
-int __init ppc_init(void);
 #else
 static inline void setup_power_save(void) { };
 #endif
Signature · 1 line
2.11.0
#2 lore raw

PATCH v3 1/1 powerpc/32: Remove left over function prototypes

In commit 4aea909eeba3 ("powerpc: Add missing prototypes in setup_32.c") prototypes for

- ppc_setup_l2cr
- ppc_setup_l3cr
- ppc_init

were added but at the same time in commit d15a261d876d ("powerpc/32: Make some functions static") those same functions were made static. Fix conflicting changes by removing the prototypes and leave the function as static. Fix the following warnings, treated as errors with W=1:

arch/powerpc/kernel/setup_32.c:127:19: error: static declaration of ‘ppc_setup_l2cr’ follows non-static declaration arch/powerpc/kernel/setup_32.c:140:19: error: static declaration of ‘ppc_setup_l3cr’ follows non-static declaration arch/powerpc/kernel/setup_32.c:186:19: error: static declaration of ‘ppc_init’ follows non-static declaration

---
v3: correct subject line to be less confusing
v2: Previous version contained the reverted patch, correct that.

 arch/powerpc/kernel/setup.h | 3 ---
 1 file changed, 3 deletions(-)
arch/powerpc/kernel/setup.h +0 -3
index 35ca309848d7..829ed66f0a40 100644
@@ -19,9 +19,6 @@ void irqstack_early_init(void);
 void setup_power_save(void);
 unsigned long __init early_init(unsigned long dt_ptr);
 void __init machine_init(u64 dt_ptr);
-int __init ppc_setup_l2cr(char *str);
-int __init ppc_setup_l3cr(char *str);
-int __init ppc_init(void);
 #else
 static inline void setup_power_save(void) { };
 #endif
Signature · 1 line
2.11.0
#3 lore raw

Re: [PATCH v3] powerpc/32: Remove left over function prototypes

Quoted 1 line · Mathieu Malaterre

In commit 4aea909eeba3 ("powerpc: Add missing prototypes in setup_32.c")

I don't have that commit ^ ?

That might be because I squashed some of your fixes together or something?

Quoted 5 lines
arch/powerpc/kernel/setup.h +0 -0
index 35ca309848d7..829ed66f0a40 100644

arch/powerpc/kernel/setup.h void irqstack_early_init(void); · line 24

Quoted 9 lines
arch/powerpc/kernel/setup.h +0 -3
@@ -19,9 +19,6 @@ void irqstack_early_init(void);
 void setup_power_save(void);
 unsigned long __init early_init(unsigned long dt_ptr);
 void __init machine_init(u64 dt_ptr);
-int __init ppc_setup_l2cr(char *str);
-int __init ppc_setup_l3cr(char *str);
-int __init ppc_init(void);
 #else
 static inline void setup_power_save(void) { };
 #endif

I have:

#ifdef CONFIG_PPC32
void setup_power_save(void);
#else
static inline void setup_power_save(void) { };
#endif

cheers

#4 lore raw

Re: [PATCH v3] powerpc/32: Remove left over function prototypes

Quoted 8 lines · Michael Ellerman
Quoted 1 line · Mathieu Malaterre

In commit 4aea909eeba3 ("powerpc: Add missing prototypes in setup_32.c")

I don't have that commit ^ ?

That might be because I squashed some of your fixes together or something?

I am doing an awful lots of mistakes these days. Indeed you've changed one of my patch:

https://patchwork.kernel.org/patch/10240997/

This one appeared after a git rebase on my side.

Quoted 17 lines
Quoted 5 lines
arch/powerpc/kernel/setup.h +0 -0
index 35ca309848d7..829ed66f0a40 100644

arch/powerpc/kernel/setup.h void irqstack_early_init(void); · line 24

Quoted 9 lines
arch/powerpc/kernel/setup.h +0 -3
@@ -19,9 +19,6 @@ void irqstack_early_init(void);
 void setup_power_save(void);
 unsigned long __init early_init(unsigned long dt_ptr);
 void __init machine_init(u64 dt_ptr);
-int __init ppc_setup_l2cr(char *str);
-int __init ppc_setup_l3cr(char *str);
-int __init ppc_init(void);
 #else
 static inline void setup_power_save(void) { };
 #endif

I have:

Quoted 5 lines

#ifdef CONFIG_PPC32
void setup_power_save(void);
#else
static inline void setup_power_save(void) { };
#endif

Correct.

Sorry for the noise.

Quoted 2 lines

cheers

#5 lore raw

Re: [PATCH v3] powerpc/32: Remove left over function prototypes

Quoted 39 lines · Mathieu Malaterre
Quoted 7 lines · Michael Ellerman
Quoted 1 line · Mathieu Malaterre

In commit 4aea909eeba3 ("powerpc: Add missing prototypes in setup_32.c")

I don't have that commit ^ ?

That might be because I squashed some of your fixes together or something?

I am doing an awful lots of mistakes these days. Indeed you've changed one of my patch:

https://patchwork.kernel.org/patch/10240997/

This one appeared after a git rebase on my side.

Quoted 17 lines
Quoted 5 lines
arch/powerpc/kernel/setup.h +0 -0
index 35ca309848d7..829ed66f0a40 100644

arch/powerpc/kernel/setup.h void irqstack_early_init(void); · line 24

Quoted 9 lines
arch/powerpc/kernel/setup.h +0 -3
@@ -19,9 +19,6 @@ void irqstack_early_init(void);
 void setup_power_save(void);
 unsigned long __init early_init(unsigned long dt_ptr);
 void __init machine_init(u64 dt_ptr);
-int __init ppc_setup_l2cr(char *str);
-int __init ppc_setup_l3cr(char *str);
-int __init ppc_init(void);
 #else
 static inline void setup_power_save(void) { };
 #endif

I have:

Quoted 5 lines

#ifdef CONFIG_PPC32
void setup_power_save(void);
#else
static inline void setup_power_save(void) { };
#endif

Quoted 3 lines

Correct.

Sorry for the noise.

OK, no worries. Thanks for persisting.

cheers