From 9110072b764b5abdddb574ece1da4ffd1b34caf2 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Fri, 10 May 2024 20:23:40 +0100 Subject: [PATCH] x86/io: Don't cast away constness in read{b..q}() Addresses various MISRA R11.8 violations. Signed-off-by: Andrew Cooper Reviewed-by: Stefano Stabellini --- 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 9b19d2d389..1cb4217cff 100644 --- a/xen/arch/x86/include/asm/io.h +++ b/xen/arch/x86/include/asm/io.h @@ -4,10 +4,10 @@ #include #include -#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))