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

Re: [PATCH v3 1/2] xen/device_tree: fix Eclair findings for MISRA C 2012 Rule 20.7


  • To: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Tue, 7 Feb 2023 10:23:54 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FqnGrUXDpS3abghYSnDeat7XyrNKciq/92CcdHcngTU=; b=EyCR/v9H6Xm2q2LM21n60XdSIBu2KH710rn/PhzL1HJ+nla8bfh47dFRPugyp+OTdFOAQdO3B8gqUD4irjfi3yANc0vt5gOjbEKkpdAK+pbMmExq4BwptfqdCv9kg8e1/ivLM7XUN8KvwdXL0GilD72W1lRI1z7+ab/oxcCXV/zEtdW0Ex9rP04Z6B4JL1sPU6vcdVZGG21cAl3tQAv/Z7dxpFQxBvl9c7Sak0Zjtpg+2dpt01BTwzaeM3eeulBiongdJnFserFO2McLyN8JVvMBda/hJwU5BbTb0XlZD5bF5Wgz0X2zwYwllalv6GatM0sA+XR6fo0mWd43UUSrcg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f+9KV4UTRMg4tVcSz8O3WUAHUKiYVkbg9C5HrIt2kD4j2BLM5eRoBJLf8lp2EC4V1nWFIBQxXo1fuy83ePBxUDZzmWp7TMo7SptVo2dzdRTFQAxpPYZNYG/zG43gzJ3ul8JCtggMWpc2n2aaH+VxUHDTMy1fHvHXeC6kd5Y4ODREq2HmEOraP9Er+I4/Xs/XdDeei95rr6Pd5b4d55/Ev/TsIwKm0x/dOKZrM+G+84Ird60b4CLv3RCbz+ohmOhJ6ipH2QT521dln70tnRihcDMANr/yjc0uySZnx4UWO2rDGcEGreOstolFi1je5rhLrC8mzLeqflpUsKs8t8+zpg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Tue, 07 Feb 2023 10:24:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZOAMhFrHFBGWgpEqoPT1xaNlgs67DTHuA
  • Thread-topic: [PATCH v3 1/2] xen/device_tree: fix Eclair findings for MISRA C 2012 Rule 20.7


> On 3 Feb 2023, at 19:09, Xenia Ragiadakou <burzalodowa@xxxxxxxxx> wrote:
> 

I’m not really a supporter of empty commit message, but it’s up to the 
maintainer :)

For me the changes looks good

Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>


> Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
> ---
> 
> Changes in v3:
>  - the fixes are based solely to Eclair findings (the tool has been
>    adjusted to report only those violations that can result to a bug)
>  - reflect this in the commit title
> 
> xen/include/xen/device_tree.h | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index a28937d12ae8..7839a199e311 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -37,11 +37,11 @@ struct dt_device_match {
>     const void *data;
> };
> 
> -#define __DT_MATCH_PATH(p)              .path = p
> -#define __DT_MATCH_TYPE(typ)            .type = typ
> -#define __DT_MATCH_COMPATIBLE(compat)   .compatible = compat
> +#define __DT_MATCH_PATH(p)              .path = (p)
> +#define __DT_MATCH_TYPE(typ)            .type = (typ)
> +#define __DT_MATCH_COMPATIBLE(compat)   .compatible = (compat)
> #define __DT_MATCH_NOT_AVAILABLE()      .not_available = 1
> -#define __DT_MATCH_PROP(p)              .prop = p
> +#define __DT_MATCH_PROP(p)              .prop = (p)
> 
> #define DT_MATCH_PATH(p)                { __DT_MATCH_PATH(p) }
> #define DT_MATCH_TYPE(typ)              { __DT_MATCH_TYPE(typ) }
> @@ -226,13 +226,13 @@ dt_find_interrupt_controller(const struct 
> dt_device_match *matches);
> #define DT_ROOT_NODE_SIZE_CELLS_DEFAULT 1
> 
> #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 )
> 
> #define dt_for_each_device_node(dt, dn)                     \
> -    for ( dn = dt; dn != NULL; dn = dn->allnext )
> +    for ( dn = dt; (dn) != NULL; dn = (dn)->allnext )
> 
> #define dt_for_each_child_node(dt, dn)                      \
> -    for ( dn = dt->child; dn != NULL; dn = dn->sibling )
> +    for ( dn = (dt)->child; (dn) != NULL; dn = (dn)->sibling )
> 
> /* Helper to read a big number; size is in cells (not bytes) */
> static inline u64 dt_read_number(const __be32 *cell, int size)
> -- 
> 2.37.2
> 
> 


 


Rackspace

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