From: Qi Zheng <arch0.zheng@gmail.com>
To: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>,
devicetree@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] of/fdt: Remove duplicate check in early_init_dt_scan_memory()
Date: Tue, 18 Aug 2020 06:18:51 +0800 [thread overview]
Message-ID: <f2d32b47-cf84-4e09-a8a1-08a323ddd134@gmail.com> (raw)
In-Reply-To: <CAL_JsqJ7eK3HB_E8OeSbs=xVLYrvOcXD9GxpKr2N4dXZWnBP+g@mail.gmail.com>
On 2020/8/18 上午2:21, Rob Herring wrote:
> On Fri, Aug 14, 2020 at 4:57 PM Qi Zheng <arch0.zheng@gmail.com> wrote:
>>
>> When the value of the first reg is not NULL, there will be
>> two repeated checks. So modify it.
>
> I prefer the way it was. I'm sure the compiler is smart enough to
> throw out the 2nd check. Plus, 'linux,usable-memory' being present is
> the exception, so usually 'reg' will be NULL.
I got it, and thanks for your review.
Please ignore this patch.
>
>> Signed-off-by: Qi Zheng <arch0.zheng@gmail.com>
>> ---
>> drivers/of/fdt.c | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
>> index 4602e467ca8b..f54412c00642 100644
>> --- a/drivers/of/fdt.c
>> +++ b/drivers/of/fdt.c
>> @@ -1002,10 +1002,11 @@ int __init early_init_dt_scan_memory(unsigned long node, const char *uname,
>> return 0;
>>
>> reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);
>> - if (reg == NULL)
>> + if (reg == NULL) {
>> reg = of_get_flat_dt_prop(node, "reg", &l);
>> - if (reg == NULL)
>> - return 0;
>> + if (reg == NULL)
>> + return 0;
>> + }
>>
>> endp = reg + (l / sizeof(__be32));
>> hotpluggable = of_get_flat_dt_prop(node, "hotpluggable", NULL);
>> --
>> 2.25.1
>>
prev parent reply other threads:[~2020-08-17 22:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-14 22:56 [PATCH] of/fdt: Remove duplicate check in early_init_dt_scan_memory() Qi Zheng
2020-08-17 18:21 ` Rob Herring
2020-08-17 22:18 ` Qi Zheng [this message]
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=f2d32b47-cf84-4e09-a8a1-08a323ddd134@gmail.com \
--to=arch0.zheng@gmail.com \
--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).