[U-Boot] [PATCH v2 3/4] libfdt: Allow #size-cells of 0
Simon Glass
sjg at chromium.org
Tue Sep 17 05:48:01 UTC 2019
On Thu, 5 Sep 2019 at 02:49, <matthias.bgg at kernel.org> wrote:
>
> From: Matthias Brugger <mbrugger at suse.com>
>
> The commit "libfdt: fdt_address_cells() and fdt_size_cells()" introduced
> a bug as it consolidated code between the helpers for getting
> be 0, and is frequently found so in practice for /cpus. IEEE1275 only
> requires implementations to handle 1..4 for #address-cells, although one
> could make a case for #address-cells == #size-cells == 0 being used to
> represent a bridge with a single port.
>
> While we're there, it's not totally obvious that the existing implicit
> cast of a u32 to int will give the correct results according to strict C,
> although it does work in practice. Straighten that up to cast only after
> we've made our range checks.
>
> This is based on upstream commit:
> b8d6eca ("libfdt: Allow #size-cells of 0")
> but misses the test cases,as we don't implement them in U-Boot.
>
> Signed-off-by: Matthias Brugger <mbrugger at suse.com>
> ---
>
> scripts/dtc/libfdt/fdt_addresses.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
This is v2 but I don't see a change log?
- Simon
More information about the U-Boot
mailing list