[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/io: Don't cast away constness in read{b..q}()



On Fri, 10 May 2024, Andrew Cooper wrote:
> Addresses various MISRA R11.8 violations.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>


> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> CC: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
> CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> CC: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
> CC: consulting@xxxxxxxxxxx <consulting@xxxxxxxxxxx>
> ---
>  xen/arch/x86/include/asm/io.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/arch/x86/include/asm/io.h b/xen/arch/x86/include/asm/io.h
> index 9b19d2d389ee..1cb4217cff39 100644
> --- a/xen/arch/x86/include/asm/io.h
> +++ b/xen/arch/x86/include/asm/io.h
> @@ -4,10 +4,10 @@
>  #include <xen/vmap.h>
>  #include <xen/types.h>
>  
> -#define readb(x) (*(volatile uint8_t  *)(x))
> -#define readw(x) (*(volatile uint16_t *)(x))
> -#define readl(x) (*(volatile uint32_t *)(x))
> -#define readq(x) (*(volatile uint64_t *)(x))
> +#define readb(x) (*(const volatile uint8_t  *)(x))
> +#define readw(x) (*(const volatile uint16_t *)(x))
> +#define readl(x) (*(const volatile uint32_t *)(x))
> +#define readq(x) (*(const volatile uint64_t *)(x))
>  #define writeb(d,x) (*(volatile uint8_t  *)(x) = (d))
>  #define writew(d,x) (*(volatile uint16_t *)(x) = (d))
>  #define writel(d,x) (*(volatile uint32_t *)(x) = (d))
> 
> base-commit: b0082b908391b29b7c4dd5e6c389ebd6481926f8
> -- 
> 2.30.2
> 

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.