[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



From: Maria Celeste Cesario <maria.celeste.cesario@xxxxxxxxxxx>

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@xxxxxxxxxxx>
Signed-off-by: Simone Ballarin  <simone.ballarin@xxxxxxxxxxx>
---
 xen/arch/x86/include/asm/atomic.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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                     \
-- 
2.40.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.