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

[xen staging] xen/rbtree: fix MISRA C 2012 Rule 20.7 violation



commit 696ee5ca9f4e2256e76056cf72a72001a9748f4c
Author:     Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
AuthorDate: Mon Aug 22 12:11:45 2022 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Aug 22 12:11:45 2022 +0200

    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@xxxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/lib/rbtree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/lib/rbtree.c b/xen/lib/rbtree.c
index 85a4f20313..eb418baabb 100644
--- a/xen/lib/rbtree.c
+++ b/xen/lib/rbtree.c
@@ -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)
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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