On 14.12.2023 13:07, Simone Ballarin wrote:
> From: Maria Celeste Cesario <[email protected]>
> 
> 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".
> 
> This patch amends or removes casts that unnecessarily drop
> const and volatile qualifiers.
> 
> Example:
> 
>  static always_inline bool int_##name(volatile void *p)
>  {
>     volatile uint32_t *ptr = (uint32_t *)p;             /* Non-compliant */
>     volatile uint32_t *ptr = (volatile uint32_t *)p;    /* Compliant, 
> proposed change */
>  }

Why would you further complicate things when here the cast can simply
be dropped?

Jan

Reply via email to