From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752966AbdJMWxQ (ORCPT ); Fri, 13 Oct 2017 18:53:16 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:51703 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752687AbdJMWxP (ORCPT ); Fri, 13 Oct 2017 18:53:15 -0400 X-Google-Smtp-Source: AOwi7QD5TS4QIrJyMytVMaOudY/9gLOG1qy5eRU0CnueeZGyE/M9bh1lYFShG1oDD7DpiRYff9EqFA== Subject: Re: [PATCH 1/2] of/resolver: Simplify to be32_add_cpu() To: Stephen Boyd , Rob Herring References: <20171013073558.11518-1-stephen.boyd@linaro.org> <20171013073558.11518-2-stephen.boyd@linaro.org> Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org From: Frank Rowand Message-ID: <59E143CB.1010802@gmail.com> Date: Fri, 13 Oct 2017 15:52:59 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20171013073558.11518-2-stephen.boyd@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > --- > 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