From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Chen Lifu <chenlifu@huawei.com>,
"benh@kernel.crashing.org" <benh@kernel.crashing.org>,
"mpe@ellerman.id.au" <mpe@ellerman.id.au>,
"npiggin@gmail.com" <npiggin@gmail.com>,
"nick.child@ibm.com" <nick.child@ibm.com>,
"zhengzucheng@huawei.com" <zhengzucheng@huawei.com>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"paulus@samba.org" <paulus@samba.org>,
"rppt@kernel.org" <rppt@kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"oohall@gmail.com" <oohall@gmail.com>
Subject: Re: [PATCH -next] powerpc/powermac: Fix symbol not declared warnings
Date: Fri, 19 Aug 2022 08:12:14 +0000 [thread overview]
Message-ID: <5ab1673c-8ade-545c-fcc1-af7104853b04@csgroup.eu> (raw)
In-Reply-To: <20220819074311.862263-1-chenlifu@huawei.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
>
prev parent reply other threads:[~2022-08-19 8:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 7:43 [PATCH -next] powerpc/powermac: Fix symbol not declared warnings Chen Lifu
2022-08-19 8:12 ` Christophe Leroy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5ab1673c-8ade-545c-fcc1-af7104853b04@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=chenlifu@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=nick.child@ibm.com \
--cc=npiggin@gmail.com \
--cc=oohall@gmail.com \
--cc=paulus@samba.org \
--cc=rppt@kernel.org \
--cc=zhengzucheng@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).