diff mbox series

[-next] powerpc/pmac/smp: Fix old-style declaration

Message ID 20191225114943.17216-1-yuehaibing@huawei.com (mailing list archive)
State Changes Requested
Headers show
Series [-next] powerpc/pmac/smp: Fix old-style declaration | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch powerpc/merge (2a6c9161d9de88960a122cf33295228ebbcf852f)
snowpatch_ozlabs/build-ppc64le success Build succeeded
snowpatch_ozlabs/build-ppc64be success Build succeeded
snowpatch_ozlabs/build-ppc64e success Build succeeded
snowpatch_ozlabs/build-pmac32 success Build succeeded
snowpatch_ozlabs/checkpatch warning total: 0 errors, 4 warnings, 0 checks, 10 lines checked

Commit Message

Yue Haibing Dec. 25, 2019, 11:49 a.m. UTC
There expect the 'static' keyword to come first in a declaration

arch/powerpc/platforms/powermac/smp.c:664:1: warning: static is not at beginning of declaration [-Wold-style-declaration]
arch/powerpc/platforms/powermac/smp.c:665:1: warning: static is not at beginning of declaration [-Wold-style-declaration]

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 arch/powerpc/platforms/powermac/smp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Christophe Leroy Dec. 26, 2019, 9:22 p.m. UTC | #1
YueHaibing <yuehaibing@huawei.com> a écrit :

> There expect the 'static' keyword to come first in a declaration
>
> arch/powerpc/platforms/powermac/smp.c:664:1: warning: static is not  
> at beginning of declaration [-Wold-style-declaration]
> arch/powerpc/platforms/powermac/smp.c:665:1: warning: static is not  
> at beginning of declaration [-Wold-style-declaration]
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  arch/powerpc/platforms/powermac/smp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powermac/smp.c  
> b/arch/powerpc/platforms/powermac/smp.c
> index f95fbde..7233b85 100644
> --- a/arch/powerpc/platforms/powermac/smp.c
> +++ b/arch/powerpc/platforms/powermac/smp.c
> @@ -661,8 +661,8 @@ static void smp_core99_gpio_tb_freeze(int freeze)
>  #endif /* !CONFIG_PPC64 */
>
>  /* L2 and L3 cache settings to pass from CPU0 to CPU1 on G4 cpus */
> -volatile static long int core99_l2_cache;
> -volatile static long int core99_l3_cache;
> +static volatile long int core99_l2_cache;
> +static volatile long int core99_l3_cache;

Is it correct to declare it as volatile ?

See  
https://www.kernel.org/doc/html/latest/process/volatile-considered-harmful.html

Christophe
Michael Ellerman Jan. 14, 2020, 6:38 a.m. UTC | #2
Christophe Leroy <christophe.leroy@c-s.fr> writes:
> YueHaibing <yuehaibing@huawei.com> a écrit :
>
>> There expect the 'static' keyword to come first in a declaration
>>
>> arch/powerpc/platforms/powermac/smp.c:664:1: warning: static is not  
>> at beginning of declaration [-Wold-style-declaration]
>> arch/powerpc/platforms/powermac/smp.c:665:1: warning: static is not  
>> at beginning of declaration [-Wold-style-declaration]
>>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>>  arch/powerpc/platforms/powermac/smp.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/powermac/smp.c  
>> b/arch/powerpc/platforms/powermac/smp.c
>> index f95fbde..7233b85 100644
>> --- a/arch/powerpc/platforms/powermac/smp.c
>> +++ b/arch/powerpc/platforms/powermac/smp.c
>> @@ -661,8 +661,8 @@ static void smp_core99_gpio_tb_freeze(int freeze)
>>  #endif /* !CONFIG_PPC64 */
>>
>>  /* L2 and L3 cache settings to pass from CPU0 to CPU1 on G4 cpus */
>> -volatile static long int core99_l2_cache;
>> -volatile static long int core99_l3_cache;
>> +static volatile long int core99_l2_cache;
>> +static volatile long int core99_l3_cache;
>
> Is it correct to declare it as volatile ?

I don't see any reason why it needs to be volatile, so I think we can
just remove that?

cheers
Christophe Leroy March 3, 2020, 8:59 a.m. UTC | #3
Le 03/03/2020 à 09:56, YueHaibing a écrit :
> core99_l2_cache/core99_l3_cache no need to mark as volatile,
> just remove it.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr>

> ---
> v2: remove 'volatile' qualifier
> ---
>   arch/powerpc/platforms/powermac/smp.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
> index f95fbde..69ad567 100644
> --- a/arch/powerpc/platforms/powermac/smp.c
> +++ b/arch/powerpc/platforms/powermac/smp.c
> @@ -661,8 +661,8 @@ static void smp_core99_gpio_tb_freeze(int freeze)
>   #endif /* !CONFIG_PPC64 */
>   
>   /* L2 and L3 cache settings to pass from CPU0 to CPU1 on G4 cpus */
> -volatile static long int core99_l2_cache;
> -volatile static long int core99_l3_cache;
> +static long core99_l2_cache;
> +static long core99_l3_cache;
>   
>   static void core99_init_caches(int cpu)
>   {
>
diff mbox series

Patch

diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index f95fbde..7233b85 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -661,8 +661,8 @@  static void smp_core99_gpio_tb_freeze(int freeze)
 #endif /* !CONFIG_PPC64 */
 
 /* L2 and L3 cache settings to pass from CPU0 to CPU1 on G4 cpus */
-volatile static long int core99_l2_cache;
-volatile static long int core99_l3_cache;
+static volatile long int core99_l2_cache;
+static volatile long int core99_l3_cache;
 
 static void core99_init_caches(int cpu)
 {