linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] powerpc/pmac/smp: Fix old-style declaration
@ 2019-12-25 11:49 YueHaibing
  2019-12-26 21:22 ` Christophe Leroy
  2020-03-03  8:56 ` [PATCH v2 -next] powerpc/pmac/smp: drop unnecessary volatile qualifier YueHaibing
  0 siblings, 2 replies; 6+ messages in thread
From: YueHaibing @ 2019-12-25 11:49 UTC (permalink / raw)
  To: benh, paulus, mpe; +Cc: YueHaibing, linuxppc-dev, linux-kernel

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;
 
 static void core99_init_caches(int cpu)
 {
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] powerpc/pmac/smp: Fix old-style declaration
  2019-12-25 11:49 [PATCH -next] powerpc/pmac/smp: Fix old-style declaration YueHaibing
@ 2019-12-26 21:22 ` Christophe Leroy
  2020-01-14  6:38   ` Michael Ellerman
  2020-03-03  8:56 ` [PATCH v2 -next] powerpc/pmac/smp: drop unnecessary volatile qualifier YueHaibing
  1 sibling, 1 reply; 6+ messages in thread
From: Christophe Leroy @ 2019-12-26 21:22 UTC (permalink / raw)
  To: YueHaibing; +Cc: linuxppc-dev, linux-kernel, paulus

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] powerpc/pmac/smp: Fix old-style declaration
  2019-12-26 21:22 ` Christophe Leroy
@ 2020-01-14  6:38   ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2020-01-14  6:38 UTC (permalink / raw)
  To: Christophe Leroy, YueHaibing; +Cc: paulus, linuxppc-dev, linux-kernel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 -next] powerpc/pmac/smp: drop unnecessary volatile qualifier
  2019-12-25 11:49 [PATCH -next] powerpc/pmac/smp: Fix old-style declaration YueHaibing
  2019-12-26 21:22 ` Christophe Leroy
@ 2020-03-03  8:56 ` YueHaibing
  2020-03-03  8:59   ` Christophe Leroy
  2020-03-17 13:14   ` Michael Ellerman
  1 sibling, 2 replies; 6+ messages in thread
From: YueHaibing @ 2020-03-03  8:56 UTC (permalink / raw)
  To: benh, paulus, mpe, christophe.leroy
  Cc: YueHaibing, linuxppc-dev, linux-kernel

core99_l2_cache/core99_l3_cache no need to mark as volatile,
just remove it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
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)
 {
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 -next] powerpc/pmac/smp: drop unnecessary volatile qualifier
  2020-03-03  8:56 ` [PATCH v2 -next] powerpc/pmac/smp: drop unnecessary volatile qualifier YueHaibing
@ 2020-03-03  8:59   ` Christophe Leroy
  2020-03-17 13:14   ` Michael Ellerman
  1 sibling, 0 replies; 6+ messages in thread
From: Christophe Leroy @ 2020-03-03  8:59 UTC (permalink / raw)
  To: YueHaibing, benh, paulus, mpe; +Cc: linuxppc-dev, linux-kernel



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)
>   {
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 -next] powerpc/pmac/smp: drop unnecessary volatile qualifier
  2020-03-03  8:56 ` [PATCH v2 -next] powerpc/pmac/smp: drop unnecessary volatile qualifier YueHaibing
  2020-03-03  8:59   ` Christophe Leroy
@ 2020-03-17 13:14   ` Michael Ellerman
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2020-03-17 13:14 UTC (permalink / raw)
  To: YueHaibing, benh, paulus, christophe.leroy
  Cc: linuxppc-dev, YueHaibing, linux-kernel

On Tue, 2020-03-03 at 08:56:04 UTC, YueHaibing wrote:
> core99_l2_cache/core99_l3_cache no need to mark as volatile,
> just remove it.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/a4037d1f1fc4e92b69d7196d4568c33078d465ea

cheers

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-17 13:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-25 11:49 [PATCH -next] powerpc/pmac/smp: Fix old-style declaration YueHaibing
2019-12-26 21:22 ` Christophe Leroy
2020-01-14  6:38   ` Michael Ellerman
2020-03-03  8:56 ` [PATCH v2 -next] powerpc/pmac/smp: drop unnecessary volatile qualifier YueHaibing
2020-03-03  8:59   ` Christophe Leroy
2020-03-17 13:14   ` Michael Ellerman

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).