[PATCH 0/5] xen: address violations of MISRA C:2012 Rule 11.8

Simone Ballarin posted 5 patches 5 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/cover.1700842832.git.maria.celeste.cesario@bugseng.com
There is a newer version of this series
xen/arch/arm/domain_build.c              | 2 +-
xen/arch/arm/include/asm/atomic.h        | 2 +-
xen/arch/arm/include/asm/regs.h          | 2 +-
xen/arch/x86/boot/reloc.c                | 2 +-
xen/arch/x86/include/asm/atomic.h        | 8 ++++----
xen/arch/x86/platform_hypercall.c        | 2 +-
xen/drivers/passthrough/amd/iommu_acpi.c | 2 +-
7 files changed, 10 insertions(+), 10 deletions(-)
[PATCH 0/5] xen: address violations of MISRA C:2012 Rule 11.8
Posted by Simone Ballarin 5 months, 1 week ago
From: Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>

The xen sources contains 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".

This patch amends or removes casts that unnecessarily drop const qualifiers.
Example:

  static inline int atomic_read(const atomic_t *v)
  {
    return *(volatile int *)&v->counter;    /* Non-compliant */
  }

In this example, the const qualifier is unnnecessarily removed from
the original object, therefore making it non-compliant.

Maria Celeste Cesario (5):
  x86/platform_hypercall: address violations of MISRA C:2012 Rule 11.8
  x86/boot/reloc: address violations of MISRA C:2012 Rule 11.8
  AMD/IOMMU: address violations of MISRA C:2012 Rule 11.8
  x86/atomic: address violations of MISRA C:2012 Rule 11.8
  xen/arm: address violations of MISRA C:2012 Rule 11.8

 xen/arch/arm/domain_build.c              | 2 +-
 xen/arch/arm/include/asm/atomic.h        | 2 +-
 xen/arch/arm/include/asm/regs.h          | 2 +-
 xen/arch/x86/boot/reloc.c                | 2 +-
 xen/arch/x86/include/asm/atomic.h        | 8 ++++----
 xen/arch/x86/platform_hypercall.c        | 2 +-
 xen/drivers/passthrough/amd/iommu_acpi.c | 2 +-
 7 files changed, 10 insertions(+), 10 deletions(-)

-- 
2.40.0
Re: [PATCH 0/5] xen: address violations of MISRA C:2012 Rule 11.8
Posted by Andrew Cooper 5 months, 1 week ago
On 24/11/2023 4:29 pm, Simone Ballarin wrote:
> Maria Celeste Cesario (5):
>   x86/platform_hypercall: address violations of MISRA C:2012 Rule 11.8
>   x86/boot/reloc: address violations of MISRA C:2012 Rule 11.8
>   AMD/IOMMU: address violations of MISRA C:2012 Rule 11.8
>   x86/atomic: address violations of MISRA C:2012 Rule 11.8
>   xen/arm: address violations of MISRA C:2012 Rule 11.8

Patches 1,2,4 Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Patch 3 I'm happy to fix on commit if you're happy with the suggestion.

~Andrew
Re: [PATCH 0/5] xen: address violations of MISRA C:2012 Rule 11.8
Posted by Simone Ballarin 5 months, 1 week ago
On 24/11/23 18:56, Andrew Cooper wrote:
> On 24/11/2023 4:29 pm, Simone Ballarin wrote:
>> Maria Celeste Cesario (5):
>>    x86/platform_hypercall: address violations of MISRA C:2012 Rule 11.8
>>    x86/boot/reloc: address violations of MISRA C:2012 Rule 11.8
>>    AMD/IOMMU: address violations of MISRA C:2012 Rule 11.8
>>    x86/atomic: address violations of MISRA C:2012 Rule 11.8
>>    xen/arm: address violations of MISRA C:2012 Rule 11.8
> 
> Patches 1,2,4 Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Patch 3 I'm happy to fix on commit if you're happy with the suggestion.

Yes, the change is fine. Thanks!

> 
> ~Andrew
> 

-- 
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com)