[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 5/7] xen/rbtree: Fix MISRA C 2012 Rule 20.7 violation
On Fri, 19 Aug 2022, Xenia Ragiadakou wrote: > 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) > -- > 2.34.1 >
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |