* [PATCH v2 -next] powerpc/powermac: Fix symbol not declared warnings
@ 2022-08-19 13:06 Chen Lifu
2022-10-31 0:45 ` chenlifu
0 siblings, 1 reply; 4+ messages in thread
From: Chen Lifu @ 2022-08-19 13:06 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, remove them and used *l2cr directly.
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 | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 04daa7f0a03c..49faa066b372 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;
@@ -234,26 +232,21 @@ static void __init l2cr_init(void)
for_each_of_cpu_node(np) {
const unsigned int *l2cr =
of_get_property(np, "l2cr-value", NULL);
if (l2cr) {
- ppc_override_l2cr = 1;
- ppc_override_l2cr_value = *l2cr;
_set_L2CR(0);
- _set_L2CR(ppc_override_l2cr_value);
+ _set_L2CR(*l2cr);
+ printk(KERN_INFO "L2CR overridden (0x%x), "
+ "backside cache is %s\n",
+ *l2cr, ((*l2cr) & 0x80000000) ?
+ "enabled" : "disabled");
}
of_node_put(np);
break;
}
}
-
- if (ppc_override_l2cr)
- printk(KERN_INFO "L2CR overridden (0x%x), "
- "backside cache is %s\n",
- ppc_override_l2cr_value,
- (ppc_override_l2cr_value & 0x80000000)
- ? "enabled" : "disabled");
}
#endif
static void __init pmac_setup_arch(void)
{
--
2.37.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 -next] powerpc/powermac: Fix symbol not declared warnings
2022-08-19 13:06 [PATCH v2 -next] powerpc/powermac: Fix symbol not declared warnings Chen Lifu
@ 2022-10-31 0:45 ` chenlifu
2022-11-02 13:53 ` Christophe Leroy
0 siblings, 1 reply; 4+ messages in thread
From: chenlifu @ 2022-10-31 0:45 UTC (permalink / raw)
To: benh, mpe, npiggin, christophe.leroy, nick.child, zhengzucheng,
linuxppc-dev, linux-kernel, paulus, rppt, akpm, oohall
在 2022/8/19 21:06, Chen Lifu 写道:
> 1. ppc_override_l2cr and ppc_override_l2cr_value are only used in
> l2cr_init() function, remove them and used *l2cr directly.
> 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 | 19 ++++++-------------
> 1 file changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
> index 04daa7f0a03c..49faa066b372 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;
>
> @@ -234,26 +232,21 @@ static void __init l2cr_init(void)
>
> for_each_of_cpu_node(np) {
> const unsigned int *l2cr =
> of_get_property(np, "l2cr-value", NULL);
> if (l2cr) {
> - ppc_override_l2cr = 1;
> - ppc_override_l2cr_value = *l2cr;
> _set_L2CR(0);
> - _set_L2CR(ppc_override_l2cr_value);
> + _set_L2CR(*l2cr);
> + printk(KERN_INFO "L2CR overridden (0x%x), "
> + "backside cache is %s\n",
> + *l2cr, ((*l2cr) & 0x80000000) ?
> + "enabled" : "disabled");
> }
> of_node_put(np);
> break;
> }
> }
> -
> - if (ppc_override_l2cr)
> - printk(KERN_INFO "L2CR overridden (0x%x), "
> - "backside cache is %s\n",
> - ppc_override_l2cr_value,
> - (ppc_override_l2cr_value & 0x80000000)
> - ? "enabled" : "disabled");
> }
> #endif
>
> static void __init pmac_setup_arch(void)
> {
Friendly ping ...
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 -next] powerpc/powermac: Fix symbol not declared warnings
2022-10-31 0:45 ` chenlifu
@ 2022-11-02 13:53 ` Christophe Leroy
2022-11-03 7:08 ` chenlifu
0 siblings, 1 reply; 4+ messages in thread
From: Christophe Leroy @ 2022-11-02 13:53 UTC (permalink / raw)
To: chenlifu, benh, mpe, npiggin, nick.child, zhengzucheng,
linuxppc-dev, linux-kernel, paulus, rppt, akpm, oohall
Le 31/10/2022 à 01:45, chenlifu a écrit :
> [Vous ne recevez pas souvent de courriers de chenlifu@huawei.com.
> Découvrez pourquoi ceci est important à
> https://aka.ms/LearnAboutSenderIdentification ]
>
> 在 2022/8/19 21:06, Chen Lifu 写道:
>> 1. ppc_override_l2cr and ppc_override_l2cr_value are only used in
>> l2cr_init() function, remove them and used *l2cr directly.
>> 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>
You could have replaced printk(KERN_INFO by pr_info(
Otherwise
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> ---
>> arch/powerpc/platforms/powermac/setup.c | 19 ++++++-------------
>> 1 file changed, 6 insertions(+), 13 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/powermac/setup.c
>> b/arch/powerpc/platforms/powermac/setup.c
>> index 04daa7f0a03c..49faa066b372 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;
>>
>> @@ -234,26 +232,21 @@ static void __init l2cr_init(void)
>>
>> for_each_of_cpu_node(np) {
>> const unsigned int *l2cr =
>> of_get_property(np, "l2cr-value", NULL);
>> if (l2cr) {
>> - ppc_override_l2cr = 1;
>> - ppc_override_l2cr_value = *l2cr;
>> _set_L2CR(0);
>> - _set_L2CR(ppc_override_l2cr_value);
>> + _set_L2CR(*l2cr);
>> + printk(KERN_INFO "L2CR overridden (0x%x), "
>> + "backside cache is %s\n",
>> + *l2cr, ((*l2cr) & 0x80000000) ?
>> + "enabled" : "disabled");
>> }
>> of_node_put(np);
>> break;
>> }
>> }
>> -
>> - if (ppc_override_l2cr)
>> - printk(KERN_INFO "L2CR overridden (0x%x), "
>> - "backside cache is %s\n",
>> - ppc_override_l2cr_value,
>> - (ppc_override_l2cr_value & 0x80000000)
>> - ? "enabled" : "disabled");
>> }
>> #endif
>>
>> static void __init pmac_setup_arch(void)
>> {
>
> Friendly ping ...
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 -next] powerpc/powermac: Fix symbol not declared warnings
2022-11-02 13:53 ` Christophe Leroy
@ 2022-11-03 7:08 ` chenlifu
0 siblings, 0 replies; 4+ messages in thread
From: chenlifu @ 2022-11-03 7:08 UTC (permalink / raw)
To: Christophe Leroy, benh, mpe, npiggin, nick.child, zhengzucheng,
linuxppc-dev, linux-kernel, paulus, rppt, akpm, oohall
在 2022/11/2 21:53, Christophe Leroy 写道:
>
>
> Le 31/10/2022 à 01:45, chenlifu a écrit :
>> [Vous ne recevez pas souvent de courriers de chenlifu@huawei.com.
>> Découvrez pourquoi ceci est important à
>> https://aka.ms/LearnAboutSenderIdentification ]
>>
>> 在 2022/8/19 21:06, Chen Lifu 写道:
>>> 1. ppc_override_l2cr and ppc_override_l2cr_value are only used in
>>> l2cr_init() function, remove them and used *l2cr directly.
>>> 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>
>
> You could have replaced printk(KERN_INFO by pr_info(
Thanks, I have replaced printk(KERN_INFO by pr_info( in PATCH v3.
>
> Otherwise
>
> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>
>>> ---
>>> arch/powerpc/platforms/powermac/setup.c | 19 ++++++-------------
>>> 1 file changed, 6 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/arch/powerpc/platforms/powermac/setup.c
>>> b/arch/powerpc/platforms/powermac/setup.c
>>> index 04daa7f0a03c..49faa066b372 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;
>>>
>>> @@ -234,26 +232,21 @@ static void __init l2cr_init(void)
>>>
>>> for_each_of_cpu_node(np) {
>>> const unsigned int *l2cr =
>>> of_get_property(np, "l2cr-value", NULL);
>>> if (l2cr) {
>>> - ppc_override_l2cr = 1;
>>> - ppc_override_l2cr_value = *l2cr;
>>> _set_L2CR(0);
>>> - _set_L2CR(ppc_override_l2cr_value);
>>> + _set_L2CR(*l2cr);
>>> + printk(KERN_INFO "L2CR overridden (0x%x), "
>>> + "backside cache is %s\n",
>>> + *l2cr, ((*l2cr) & 0x80000000) ?
>>> + "enabled" : "disabled");
>>> }
>>> of_node_put(np);
>>> break;
>>> }
>>> }
>>> -
>>> - if (ppc_override_l2cr)
>>> - printk(KERN_INFO "L2CR overridden (0x%x), "
>>> - "backside cache is %s\n",
>>> - ppc_override_l2cr_value,
>>> - (ppc_override_l2cr_value & 0x80000000)
>>> - ? "enabled" : "disabled");
>>> }
>>> #endif
>>>
>>> static void __init pmac_setup_arch(void)
>>> {
>>
>> Friendly ping ...
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-03 7:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-19 13:06 [PATCH v2 -next] powerpc/powermac: Fix symbol not declared warnings Chen Lifu
2022-10-31 0:45 ` chenlifu
2022-11-02 13:53 ` Christophe Leroy
2022-11-03 7:08 ` chenlifu
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).