Re: [PATCH v2 2/6] xen/ppc: address violations of MISRA C:2012 Rule 11.8.

2024-02-26 Thread Shawn Anastasio
Hi Stefano,

Sorry for the delay on this.

Acked-by: Shawn Anastasio 

Best,
Shawn

On 2/23/24 5:19 PM, Stefano Stabellini wrote:
> Shawn,
> 
> I am thinking of committing this, if you disagree please say something
> in the next couple of days
> 
> 
> On Tue, 19 Dec 2023, Simone Ballarin wrote:
>> From: Maria Celeste Cesario 
>>
>> The xen sources contain violations of MISRA C:2012 Rule 11.8 whose
>> headline states:
>> "A conversion shall not remove any const, volatile or _Atomic qualification
>> from the type pointed to by a pointer".
>>
>> Fix violation by adding missing const qualifier in cast.
>>
>> Signed-off-by: Maria Celeste Cesario  
>> Signed-off-by: Simone Ballarin  
>> Reviewed-by: Stefano Stabellini 
>> ---
>> Adaptation requested by the community to make the code more consistent.
>> ---
>>  xen/arch/ppc/include/asm/atomic.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/ppc/include/asm/atomic.h 
>> b/xen/arch/ppc/include/asm/atomic.h
>> index 64168aa3f1..fe778579fb 100644
>> --- a/xen/arch/ppc/include/asm/atomic.h
>> +++ b/xen/arch/ppc/include/asm/atomic.h
>> @@ -16,7 +16,7 @@
>>  
>>  static inline int atomic_read(const atomic_t *v)
>>  {
>> -return *(volatile int *)>counter;
>> +return *(const volatile int *)>counter;
>>  }
>>  
>>  static inline int _atomic_read(atomic_t v)
>> -- 
>> 2.40.0
>>



Re: [PATCH v2 2/6] xen/ppc: address violations of MISRA C:2012 Rule 11.8.

2024-02-23 Thread Stefano Stabellini
Shawn,

I am thinking of committing this, if you disagree please say something
in the next couple of days


On Tue, 19 Dec 2023, Simone Ballarin wrote:
> From: Maria Celeste Cesario 
> 
> The xen sources contain violations of MISRA C:2012 Rule 11.8 whose
> headline states:
> "A conversion shall not remove any const, volatile or _Atomic qualification
> from the type pointed to by a pointer".
> 
> Fix violation by adding missing const qualifier in cast.
> 
> Signed-off-by: Maria Celeste Cesario  
> Signed-off-by: Simone Ballarin  
> Reviewed-by: Stefano Stabellini 
> ---
> Adaptation requested by the community to make the code more consistent.
> ---
>  xen/arch/ppc/include/asm/atomic.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/ppc/include/asm/atomic.h 
> b/xen/arch/ppc/include/asm/atomic.h
> index 64168aa3f1..fe778579fb 100644
> --- a/xen/arch/ppc/include/asm/atomic.h
> +++ b/xen/arch/ppc/include/asm/atomic.h
> @@ -16,7 +16,7 @@
>  
>  static inline int atomic_read(const atomic_t *v)
>  {
> -return *(volatile int *)>counter;
> +return *(const volatile int *)>counter;
>  }
>  
>  static inline int _atomic_read(atomic_t v)
> -- 
> 2.40.0
> 



[PATCH v2 2/6] xen/ppc: address violations of MISRA C:2012 Rule 11.8.

2023-12-19 Thread Simone Ballarin
From: Maria Celeste Cesario 

The xen sources contain violations of MISRA C:2012 Rule 11.8 whose
headline states:
"A conversion shall not remove any const, volatile or _Atomic qualification
from the type pointed to by a pointer".

Fix violation by adding missing const qualifier in cast.

Signed-off-by: Maria Celeste Cesario  
Signed-off-by: Simone Ballarin  
Reviewed-by: Stefano Stabellini 
---
Adaptation requested by the community to make the code more consistent.
---
 xen/arch/ppc/include/asm/atomic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/ppc/include/asm/atomic.h 
b/xen/arch/ppc/include/asm/atomic.h
index 64168aa3f1..fe778579fb 100644
--- a/xen/arch/ppc/include/asm/atomic.h
+++ b/xen/arch/ppc/include/asm/atomic.h
@@ -16,7 +16,7 @@
 
 static inline int atomic_read(const atomic_t *v)
 {
-return *(volatile int *)>counter;
+return *(const volatile int *)>counter;
 }
 
 static inline int _atomic_read(atomic_t v)
-- 
2.40.0