xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Artem Mygaiev <artem_mygaiev@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH] xen/arm: Remove unused tnode variables in DT IRQ map parsing
Date: Tue, 6 Dec 2016 14:19:30 +0000	[thread overview]
Message-ID: <607f4bf2-57e8-e52f-2bf7-a49f6ebf7900@arm.com> (raw)
In-Reply-To: <10e7f409-b074-71d9-62c8-cfb7c225679e@epam.com>

Hi Artem,

On 06/12/16 13:57, Artem Mygaiev wrote:
> Remove unused tnode variables in device tree IRQ map parsing

This description is slightly wrong, the variable are used but not the value.

> Coverity-ID 1381866, 1381867
>
> Signed-off-by: Artem Mygaiev <artem_mygaiev@epam.com>

This code is from Linux (see drivers/of/irq.c) and I would prefer to 
keep it very similar as long as it does not lead to a bug:

Nacked-by: Julien Grall <julien.grall@arm.com>

> ---
>  xen/common/device_tree.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 1be074b..edc48f6 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -1053,7 +1053,7 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
>                                    void *),
>                          void *data)
>  {
> -    const struct dt_device_node *ipar, *tnode, *old = NULL;
> +    const struct dt_device_node *ipar, *old = NULL;
>      const __be32 *tmp, *imap;
>      u32 intsize = 1, addrsize, pintsize = 0, paddrsize = 0;
>      u32 imaplen;
> @@ -1078,7 +1078,6 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
>              intsize = be32_to_cpu(*tmp);
>              break;
>          }
> -        tnode = ipar;
>          ipar = dt_irq_find_parent(ipar);
>      } while ( ipar );
>      if ( ipar == NULL )
> @@ -1101,8 +1100,7 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
>      old = ipar;
>      do {
>          tmp = dt_get_property(old, "#address-cells", NULL);
> -        tnode = dt_get_parent(old);
> -        old = tnode;
> +        old = dt_get_parent(old);
>      } while ( old && tmp == NULL );
>
>      old = NULL;
> @@ -1238,7 +1236,7 @@ static int dt_irq_map_raw(const struct dt_device_node *parent,
>                            const __be32 *addr,
>                            struct dt_raw_irq *oirq)
>  {
> -    const struct dt_device_node *ipar, *tnode, *old = NULL, *newpar = NULL;
> +    const struct dt_device_node *ipar, *old = NULL, *newpar = NULL;
>      const __be32 *tmp, *imap, *imask;
>      u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0;
>      u32 imaplen;
> @@ -1261,7 +1259,6 @@ static int dt_irq_map_raw(const struct dt_device_node *parent,
>              intsize = be32_to_cpu(*tmp);
>              break;
>          }
> -        tnode = ipar;
>          ipar = dt_irq_find_parent(ipar);
>      } while ( ipar );
>      if ( ipar == NULL )
> @@ -1281,8 +1278,7 @@ static int dt_irq_map_raw(const struct dt_device_node *parent,
>      old = ipar;
>      do {
>          tmp = dt_get_property(old, "#address-cells", NULL);
> -        tnode = dt_get_parent(old);
> -        old = tnode;
> +        old = dt_get_parent(old);
>      } while ( old && tmp == NULL );
>
>      old = NULL;
>

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-12-06 14:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-06 13:57 [PATCH] xen/arm: Remove unused tnode variables in DT IRQ map parsing Artem Mygaiev
2016-12-06 14:19 ` Julien Grall [this message]
2016-12-06 14:33   ` Artem Mygaiev
2016-12-06 14:37     ` Julien Grall
2016-12-06 14:41       ` Artem Mygaiev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=607f4bf2-57e8-e52f-2bf7-a49f6ebf7900@arm.com \
    --to=julien.grall@arm.com \
    --cc=artem_mygaiev@epam.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).