xen/rbtree: fix MISRA C 2012 Rule 20.7 violation

In macro __rb_parent(), add parentheses around the macro parameter to prevent
against unintended expansions.

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-08-22 12:11:45 +02:00
1 parent c5659ef2da
commit 696ee5ca9f
1 file changed
+1 -1
+1 -1
View File
@@ -46,7 +46,7 @@
#define RB_RED 0
#define RB_BLACK 1
#define __rb_parent(pc) ((struct rb_node *)(pc & ~3))
#define __rb_parent(pc) ((struct rb_node *)((pc) & ~3))
#define __rb_color(pc) ((pc) & 1)
#define __rb_is_black(pc) __rb_color(pc)
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.