diff mbox series

[4/5] x86/atomic: address violations of MISRA C:2012 Rule 11.8

Message ID 0224699e85baac395e47a1d5d89972d9d0284e85.1700842832.git.maria.celeste.cesario@bugseng.com (mailing list archive)
State Superseded
Headers show
Series xen: address violations of MISRA C:2012 Rule 11.8 | expand

Commit Message

Simone Ballarin Nov. 24, 2023, 4:29 p.m. UTC
From: Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>

Edit casts that unnecessarily remove const qualifiers
to comply with Rule 11.8.
The type of the provided pointer may be const qualified.
No functional change.

Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
Signed-off-by: Simone Ballarin  <simone.ballarin@bugseng.com>
---
 xen/arch/x86/include/asm/atomic.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/xen/arch/x86/include/asm/atomic.h b/xen/arch/x86/include/asm/atomic.h
index 27aad43aaa..16bd0ebfd7 100644
--- a/xen/arch/x86/include/asm/atomic.h
+++ b/xen/arch/x86/include/asm/atomic.h
@@ -51,10 +51,10 @@  void __bad_atomic_size(void);
     unsigned long x_;                                     \
     CLANG_DISABLE_WARN_GCC_COMPAT_START                   \
     switch ( sizeof(*(p)) ) {                             \
-    case 1: x_ = read_u8_atomic((uint8_t *)(p)); break;   \
-    case 2: x_ = read_u16_atomic((uint16_t *)(p)); break; \
-    case 4: x_ = read_u32_atomic((uint32_t *)(p)); break; \
-    case 8: x_ = read_u64_atomic((uint64_t *)(p)); break; \
+    case 1: x_ = read_u8_atomic((const uint8_t *)(p)); break;   \
+    case 2: x_ = read_u16_atomic((const uint16_t *)(p)); break; \
+    case 4: x_ = read_u32_atomic((const uint32_t *)(p)); break; \
+    case 8: x_ = read_u64_atomic((const uint64_t *)(p)); break; \
     default: x_ = 0; __bad_atomic_size(); break;          \
     }                                                     \
     CLANG_DISABLE_WARN_GCC_COMPAT_END                     \