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

Addresses various MISRA R11.8 violations.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Andrew Cooper committed 2024-05-11 00:13:43 +01:00
1 parent 2d8d7481ca
commit 9110072b76
1 file changed
+4 -4
+4 -4
View File
@@ -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))
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.