[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqKg8oAd+JmmhERa3Xb1dD9CPz1_cVM3mb=ypWhxkZJHtQ@mail.gmail.com>
Date: Wed, 23 Apr 2014 09:05:07 -0500
From: Rob Herring <robherring2@...il.com>
To: Michal Simek <monstr@...str.eu>
Cc: Grant Likely <grant.likely@...aro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>
Subject: Re: [PATCH v2 18/21] powerpc: use libfdt accessors for header data
On Wed, Apr 23, 2014 at 8:48 AM, Michal Simek <monstr@...str.eu> wrote:
> On 04/23/2014 03:18 AM, Rob Herring wrote:
>> From: Rob Herring <robh@...nel.org>
>>
>> With libfdt support, we can take advantage of helper accessors in libfdt
>> for accessing the FDT header data. This makes the code more readable and
>> makes the FDT blob structure more opaque to the kernel. This also
>> prepares for removing struct boot_param_header completely.
[...]
>> @@ -117,14 +118,14 @@ static void __init move_device_tree(void)
>> DBG("-> move_device_tree\n");
>>
>> start = __pa(initial_boot_params);
>> - size = be32_to_cpu(initial_boot_params->totalsize);
>> + size = fdt_totalsize(initial_boot_params);
>
> In 19/21 you use your newly introduced of_get_flat_dt_size()
> that's why I expect you will use it here too.
> size = of_get_flat_dt_size();
>
> The same is for 14/21 where you can use this new function too.
> It means moving 14/21 to the end and using this new function
> makes more sense.
Really, I would prefer to just use libfdt accessors directly rather
than have wrappers, but including libfdt.h is not the cleanest
solution. Since x86 just needed this one function, I added a wrapper.
Since PPC needs other header fields I prefer to use the libfdt
accessors directly for all fields. The same goes for drivers/of/fdt.c.
Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists