Re: [PATCH 7/7] xen/device_tree: Fix MISRA C 2012 Rule 20.7 violations

2022-08-26 Thread Stefano Stabellini
On Fri, 26 Aug 2022, Jan Beulich wrote: > On 26.08.2022 09:58, Xenia Ragiadakou wrote: > > On 8/26/22 09:21, Jan Beulich wrote: > >> On 25.08.2022 20:09, Stefano Stabellini wrote: > >>> But first, let's confirm whether this change: > >>> > >>> > >>> #define dt_for_each_property_node(dn, pp)

Re: [PATCH 7/7] xen/device_tree: Fix MISRA C 2012 Rule 20.7 violations

2022-08-26 Thread Jan Beulich
On 26.08.2022 09:58, Xenia Ragiadakou wrote: > On 8/26/22 09:21, Jan Beulich wrote: >> On 25.08.2022 20:09, Stefano Stabellini wrote: >>> But first, let's confirm whether this change: >>> >>> >>> #define dt_for_each_property_node(dn, pp) \ >>> -for ( pp = dn->properties; pp

Re: [PATCH 7/7] xen/device_tree: Fix MISRA C 2012 Rule 20.7 violations

2022-08-26 Thread Xenia Ragiadakou
On 8/26/22 09:21, Jan Beulich wrote: On 25.08.2022 20:09, Stefano Stabellini wrote: But first, let's confirm whether this change: #define dt_for_each_property_node(dn, pp) \ -for ( pp = dn->properties; pp != NULL; pp = pp->next ) +for ( pp = (dn)->properties; pp !

Re: [PATCH 7/7] xen/device_tree: Fix MISRA C 2012 Rule 20.7 violations

2022-08-25 Thread Jan Beulich
On 25.08.2022 20:09, Stefano Stabellini wrote: > But first, let's confirm whether this change: > > > #define dt_for_each_property_node(dn, pp) \ > -for ( pp = dn->properties; pp != NULL; pp = pp->next ) > +for ( pp = (dn)->properties; pp != NULL; pp = (pp)->next ) > >

Re: [PATCH 7/7] xen/device_tree: Fix MISRA C 2012 Rule 20.7 violations

2022-08-25 Thread Stefano Stabellini
CC MISRA C working group Short summary: we are discussing whether the following is sufficient to address MISRA C Rule 20.7, and also in general for safety: #define dt_for_each_property_node(dn, pp) \ -for ( pp = dn->properties; pp != NULL; pp = pp->next ) +for ( pp = (

Re: [PATCH 7/7] xen/device_tree: Fix MISRA C 2012 Rule 20.7 violations

2022-08-25 Thread Jan Beulich
On 25.08.2022 10:02, Xenia Ragiadakou wrote: > On 8/22/22 14:48, Jan Beulich wrote: >> On 22.08.2022 12:43, Xenia Ragiadakou wrote: >>> On 8/22/22 12:59, Jan Beulich wrote: On 19.08.2022 21:43, Xenia Ragiadakou wrote: > In macros dt_for_each_property_node(), dt_for_each_device_node() and >

Re: [PATCH 7/7] xen/device_tree: Fix MISRA C 2012 Rule 20.7 violations

2022-08-25 Thread Xenia Ragiadakou
On 8/22/22 14:48, Jan Beulich wrote: On 22.08.2022 12:43, Xenia Ragiadakou wrote: On 8/22/22 12:59, Jan Beulich wrote: On 19.08.2022 21:43, Xenia Ragiadakou wrote: In macros dt_for_each_property_node(), dt_for_each_device_node() and dt_for_each_child_node(), add parentheses around the macro

Re: [PATCH 7/7] xen/device_tree: Fix MISRA C 2012 Rule 20.7 violations

2022-08-22 Thread Jan Beulich
On 22.08.2022 12:43, Xenia Ragiadakou wrote: > On 8/22/22 12:59, Jan Beulich wrote: >> On 19.08.2022 21:43, Xenia Ragiadakou wrote: >>> In macros dt_for_each_property_node(), dt_for_each_device_node() and >>> dt_for_each_child_node(), add parentheses around the macro parameters that >>> have the ar

Re: [PATCH 7/7] xen/device_tree: Fix MISRA C 2012 Rule 20.7 violations

2022-08-22 Thread Xenia Ragiadakou
Hi Jan, On 8/22/22 12:59, Jan Beulich wrote: On 19.08.2022 21:43, Xenia Ragiadakou wrote: In macros dt_for_each_property_node(), dt_for_each_device_node() and dt_for_each_child_node(), add parentheses around the macro parameters that have the arrow operator applied, to prevent against unintende

Re: [PATCH 7/7] xen/device_tree: Fix MISRA C 2012 Rule 20.7 violations

2022-08-22 Thread Jan Beulich
On 19.08.2022 21:43, Xenia Ragiadakou wrote: > In macros dt_for_each_property_node(), dt_for_each_device_node() and > dt_for_each_child_node(), add parentheses around the macro parameters that > have the arrow operator applied, to prevent against unintended expansions. Why is this relevant only wh

Re: [PATCH 7/7] xen/device_tree: Fix MISRA C 2012 Rule 20.7 violations

2022-08-19 Thread Stefano Stabellini
On Fri, 19 Aug 2022, Xenia Ragiadakou wrote: > In macros dt_for_each_property_node(), dt_for_each_device_node() and > dt_for_each_child_node(), add parentheses around the macro parameters that > have the arrow operator applied, to prevent against unintended expansions. > > Signed-off-by: Xenia Rag