arm/atomic: fix MISRA C 2012 Rule 20.7 violation

The macro parameter 'p' is used as an expression and needs to be enclosed in
parentheses.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Xenia Ragiadakou authored and Jan Beulich committed 2022-07-29 08:51:31 +02:00
1 parent 124f138b37
commit 062790aca6
1 file changed
+4 -4
+4 -4
View File
@@ -123,15 +123,15 @@ static always_inline void write_atomic_size(volatile void *p,
}
#define read_atomic(p) ({ \
union { typeof(*p) val; char c[0]; } x_; \
read_atomic_size(p, x_.c, sizeof(*p)); \
union { typeof(*(p)) val; char c[0]; } x_; \
read_atomic_size(p, x_.c, sizeof(*(p))); \
x_.val; \
})
#define write_atomic(p, x) \
do { \
typeof(*p) x_ = (x); \
write_atomic_size(p, &x_, sizeof(*p)); \
typeof(*(p)) x_ = (x); \
write_atomic_size(p, &x_, sizeof(*(p))); \
} while ( false )
#define add_sized(p, x) ({ \
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.