x86/io: Don't cast away constness in read{b..q}()
PATCH 1/1 x86/io: Don't cast away constness in read{b..q}()
Addresses various MISRA R11.8 violations.
Signed-off-by Andrew Cooper <[email protected]>
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Nicola Vetrini <[email protected]>
CC: [email protected] <[email protected]>
--- xen/arch/x86/include/asm/io.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
xen/arch/x86/include/asm/io.h +4 -4
@@ -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
Signature · 1 line
2.30.2
Quoted 3 lines · Andrew Cooper
Addresses various MISRA R11.8 violations.
Signed-off-by Andrew Cooper <[email protected]>
Reviewed-by Stefano Stabellini <[email protected]>
Quoted 35 lines
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Nicola Vetrini <[email protected]>
CC: [email protected] <[email protected]>--- xen/arch/x86/include/asm/io.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)xen/arch/x86/include/asm/io.h +4
-4@@ -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:
b0082b908391b29b7c4dd5e6c389ebd6481926f8Signature · 1 line
2.30.2