devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <stephen.boyd@linaro.org>
To: Rob Herring <robh+dt@kernel.org>, Frank Rowand <frowand.list@gmail.com>
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: [PATCH 1/2] of/resolver: Simplify to be32_add_cpu()
Date: Fri, 13 Oct 2017 00:35:57 -0700	[thread overview]
Message-ID: <20171013073558.11518-2-stephen.boyd@linaro.org> (raw)
In-Reply-To: <20171013073558.11518-1-stephen.boyd@linaro.org>

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@linaro.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);
 		}
 	}
 
-- 
2.14.GIT

  reply	other threads:[~2017-10-13  7:35 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 ` Stephen Boyd [this message]
     [not found]   ` <20171013073558.11518-2-stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-10-13 22:52     ` [PATCH 1/2] of/resolver: Simplify to be32_add_cpu() Frank Rowand
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=20171013073558.11518-2-stephen.boyd@linaro.org \
    --to=stephen.boyd@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.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).