Addresses various MISRA R11.8 violations.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
CC: consulting@bugseng.com <consulting@bugseng.com>
---
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
On Fri, 10 May 2024, Andrew Cooper wrote: > Addresses various MISRA R11.8 violations. > > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> > --- > CC: Jan Beulich <JBeulich@suse.com> > CC: Roger Pau Monné <roger.pau@citrix.com> > CC: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> > CC: Stefano Stabellini <sstabellini@kernel.org> > CC: Nicola Vetrini <nicola.vetrini@bugseng.com> > CC: consulting@bugseng.com <consulting@bugseng.com> > --- > 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 >
© 2016 - 2024 Red Hat, Inc.