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

[xen master] x86/atomic: address violations of MISRA C:2012 Rule 11.8



commit 17754972fa98bff2dfdec09b8094f54530bafcb8
Author:     Maria Celeste Cesario <maria.celeste.cesario@xxxxxxxxxxx>
AuthorDate: Mon Nov 27 15:17:56 2023 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Nov 27 15:17:56 2023 +0100

    x86/atomic: address violations of MISRA C:2012 Rule 11.8
    
    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>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 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                     \
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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