* [PATCH -next] powerpc/powermac: Fix symbol not declared warnings
@ 2022-08-19 7:43 Chen Lifu
2022-08-19 8:12 ` Christophe Leroy
0 siblings, 1 reply; 2+ messages in thread
From: Chen Lifu @ 2022-08-19 7:43 UTC (permalink / raw)
To: benh, mpe, npiggin, christophe.leroy, nick.child, zhengzucheng,
linuxppc-dev, linux-kernel, paulus, rppt, akpm, oohall
Cc: chenlifu
1. ppc_override_l2cr and ppc_override_l2cr_value are only used in
l2cr_init() function, so move them inside the function.
2. has_l2cache is not used outside of the file, so mark it static, and
do not initialise statics to 0.
Fixes the following warning:
arch/powerpc/platforms/powermac/setup.c:74:5: warning: symbol 'ppc_override_l2cr' was not declared. Should it be static?
arch/powerpc/platforms/powermac/setup.c:75:5: warning: symbol 'ppc_override_l2cr_value' was not declared. Should it be static?
arch/powerpc/platforms/powermac/setup.c:76:5: warning: symbol 'has_l2cache' was not declared. Should it be static?
Signed-off-by: Chen Lifu <chenlifu@huawei.com>
---
arch/powerpc/platforms/powermac/setup.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 04daa7f0a03c..f8b847a2f5b5 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -68,13 +68,11 @@
#include "pmac.h"
#undef SHOW_GATWICK_IRQS
-int ppc_override_l2cr = 0;
-int ppc_override_l2cr_value;
-int has_l2cache = 0;
+static int has_l2cache;
int pmac_newworld;
static int current_root_goodness = -1;
@@ -226,10 +224,13 @@ static void __init ohare_init(void)
}
}
static void __init l2cr_init(void)
{
+ int ppc_override_l2cr = 0;
+ int ppc_override_l2cr_value;
+
/* Checks "l2cr-value" property in the registry */
if (cpu_has_feature(CPU_FTR_L2CR)) {
struct device_node *np;
for_each_of_cpu_node(np) {
--
2.37.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] powerpc/powermac: Fix symbol not declared warnings
2022-08-19 7:43 [PATCH -next] powerpc/powermac: Fix symbol not declared warnings Chen Lifu
@ 2022-08-19 8:12 ` Christophe Leroy
0 siblings, 0 replies; 2+ messages in thread
From: Christophe Leroy @ 2022-08-19 8:12 UTC (permalink / raw)
To: Chen Lifu, benh@kernel.crashing.org, mpe@ellerman.id.au,
npiggin@gmail.com, nick.child@ibm.com, zhengzucheng@huawei.com,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
paulus@samba.org, rppt@kernel.org, akpm@linux-foundation.org,
oohall@gmail.com
Le 19/08/2022 à 09:43, Chen Lifu a écrit :
> 1. ppc_override_l2cr and ppc_override_l2cr_value are only used in
> l2cr_init() function, so move them inside the function.
> 2. has_l2cache is not used outside of the file, so mark it static, and
> do not initialise statics to 0.
You can do much more simple. Use *l2cr directly and remove
ppc_override_l2cr and ppc_override_l2cr_value completely. And move the
printk inside the 'if (l2cr)'.
>
> Fixes the following warning:
>
> arch/powerpc/platforms/powermac/setup.c:74:5: warning: symbol 'ppc_override_l2cr' was not declared. Should it be static?
> arch/powerpc/platforms/powermac/setup.c:75:5: warning: symbol 'ppc_override_l2cr_value' was not declared. Should it be static?
> arch/powerpc/platforms/powermac/setup.c:76:5: warning: symbol 'has_l2cache' was not declared. Should it be static?
>
> Signed-off-by: Chen Lifu <chenlifu@huawei.com>
> ---
> arch/powerpc/platforms/powermac/setup.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
> index 04daa7f0a03c..f8b847a2f5b5 100644
> --- a/arch/powerpc/platforms/powermac/setup.c
> +++ b/arch/powerpc/platforms/powermac/setup.c
> @@ -68,13 +68,11 @@
>
> #include "pmac.h"
>
> #undef SHOW_GATWICK_IRQS
>
> -int ppc_override_l2cr = 0;
> -int ppc_override_l2cr_value;
> -int has_l2cache = 0;
> +static int has_l2cache;
>
> int pmac_newworld;
>
> static int current_root_goodness = -1;
>
> @@ -226,10 +224,13 @@ static void __init ohare_init(void)
> }
> }
>
> static void __init l2cr_init(void)
> {
> + int ppc_override_l2cr = 0;
> + int ppc_override_l2cr_value;
> +
> /* Checks "l2cr-value" property in the registry */
> if (cpu_has_feature(CPU_FTR_L2CR)) {
> struct device_node *np;
>
> for_each_of_cpu_node(np) {
> --
> 2.37.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-19 8:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-19 7:43 [PATCH -next] powerpc/powermac: Fix symbol not declared warnings Chen Lifu
2022-08-19 8:12 ` Christophe Leroy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).