[PATCH 1/3] dm: core: fdtaddr: Avoid multiple calls to fdt_parent_offset()

Simon Glass sjg at chromium.org
Tue Aug 6 23:50:58 CEST 2024


On Sun, 4 Aug 2024 at 09:06, Jonas Karlman <jonas at kwiboo.se> wrote:
>
> Use of fdt_parent_offset() is very expensive as detailed by the function
> documentation:
>
>   NOTE: This function is expensive, as it must scan the device tree
>   structure from the start to nodeoffset, *twice*.
>
> Re-use the returned value from a single call instead of having to make
> multiple calls for same nodeoffset.
>
> Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
> ---
>  drivers/core/fdtaddr.c | 24 +++++++++++++++++-------
>  1 file changed, 17 insertions(+), 7 deletions(-)
>

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list