devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Stephen Boyd
	<stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/2] of/resolver: Simplify to be32_add_cpu()
Date: Fri, 13 Oct 2017 15:52:59 -0700	[thread overview]
Message-ID: <59E143CB.1010802@gmail.com> (raw)
In-Reply-To: <20171013073558.11518-2-stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

On 10/13/17 00:35, Stephen Boyd wrote:
> This is the same as be32_add_cpu(), so simplify the code and
> remove the now unused local variable.
> 
> Signed-off-by: Stephen Boyd <stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
>  drivers/of/resolver.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c
> index 99309cb7d372..2d58253bf2f7 100644
> --- a/drivers/of/resolver.c
> +++ b/drivers/of/resolver.c
> @@ -165,7 +165,6 @@ static int adjust_local_phandle_references(struct device_node *local_fixups,
>  	struct property *prop_fix, *prop;
>  	int err, i, count;
>  	unsigned int off;
> -	phandle phandle;
>  
>  	if (!local_fixups)
>  		return 0;
> @@ -195,9 +194,7 @@ static int adjust_local_phandle_references(struct device_node *local_fixups,
>  			if ((off + 4) > prop->length)
>  				return -EINVAL;
>  
> -			phandle = be32_to_cpu(*(__be32 *)(prop->value + off));
> -			phandle += phandle_delta;
> -			*(__be32 *)(prop->value + off) = cpu_to_be32(phandle);
> +			be32_add_cpu(prop->value + off, phandle_delta);
>  		}
>  	}
>  
> 

Reviewed-by: Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-10-13 22:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13  7:35 [PATCH 0/2] Trivial code cleanup for DT resolver Stephen Boyd
2017-10-13  7:35 ` [PATCH 1/2] of/resolver: Simplify to be32_add_cpu() Stephen Boyd
     [not found]   ` <20171013073558.11518-2-stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-10-13 22:52     ` Frank Rowand [this message]
2017-10-13  7:35 ` [PATCH 2/2] of/resolver: Replace kmalloc + memcpy with kmemdup() Stephen Boyd
     [not found]   ` <20171013073558.11518-3-stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-10-13 22:33     ` Frank Rowand
2017-10-16 21:48     ` Rob Herring

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=59E143CB.1010802@gmail.com \
    --to=frowand.list-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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).