powerpc/powermac: Fix symbol not declared warnings
Subsystems (2)
PATCH v2 1/1 powerpc/powermac: Fix symbol not declared warnings
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?
--- arch/powerpc/platforms/powermac/setup.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)
arch/powerpc/platforms/powermac/setup.c +6 -13
@@ -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 ) {
Signature · 1 line
2.37.1
Quoted 57 lines · Chen Lifu
1.
ppc_override_l2crandppc_override_l2cr_valueare only used inl2cr_init()function, remove them and used *l2cr directly.
2.has_l2cacheis 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 <[email protected]>--- arch/powerpc/platforms/powermac/setup.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)arch/powerpc/platforms/powermac/setup.c +6
-8@@ -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)
arch/powerpc/platforms/powermac/setup.c static void __init l2cr_init(void) · line 252
Quoted 10 lines
arch/powerpc/platforms/powermac/setup.c +0
-5-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 ...
Christophe Leroy
Reviewed-byLe 31/10/2022 à 01:45, chenlifu a écrit :
Quoted 4 lines
[Vous ne recevez pas souvent de courriers de [email protected]. Découvrez pourquoi ceci est important à
https://aka.ms/LearnAboutSenderIdentification ]
Quoted 16 lines
Quoted 15 lines · Chen Lifu
1.
ppc_override_l2crandppc_override_l2cr_valueare only used inl2cr_init()function, remove them and used *l2cr directly.
2.has_l2cacheis 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 <[email protected]>
You could have replaced printk(KERN_INFO by pr_info(
Otherwise
Quoted 59 lines
Quoted 54 lines
---
arch/powerpc/platforms/powermac/setup.c| 19 ++++++-------------1 file changed, 6 insertions(+), 13 deletions(-)arch/powerpc/platforms/powermac/setup.c +1
-3@@ -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");
}
#endifQuoted 2 lines
static void
__initpmac_setup_arch(void)
{Friendly ping ...
Quoted 22 lines · Christophe Leroy
Le 31/10/2022 à 01:45, chenlifu a écrit :
Quoted 19 lines
[Vous ne recevez pas souvent de courriers de [email protected]. Découvrez pourquoi ceci est important à
https://aka.ms/LearnAboutSenderIdentification ]Quoted 14 lines · Chen Lifu
1.
ppc_override_l2crandppc_override_l2cr_valueare only used inl2cr_init()function, remove them and used *l2cr directly.
2.has_l2cacheis 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?
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Signed-off-by Chen Lifu <[email protected]>You could have replaced printk(KERN_INFO by pr_info(
Thanks, I have replaced printk(KERN_INFO by pr_info( in PATCH v3.
Quoted 63 lines
Otherwise
Reviewed-by Christophe Leroy <[email protected]>Quoted 58 lines
Quoted 46 lines
--- arch/powerpc/platforms/powermac/setup.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)arch/powerpc/platforms/powermac/setup.c +6
-8@@ -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)arch/powerpc/platforms/powermac/setup.c static void __init l2cr_init(void) · line 252
Quoted 10 lines
arch/powerpc/platforms/powermac/setup.c +0
-5- 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 ...