On 3/17/24 10:16 AM, Heinrich Schuchardt wrote:
On 3/17/24 07:16, Marek Vasut wrote:
The lmb_alloc_base() returns phys_addr_t , map_sysmem() accepts
phys_addr_t as first parameter. Declare $addr as phys_addr_t and

%s/$addr/addr/

I'm not sure this helps readability, I want to delimit the variable name somehow, so I switched this to 'addr' here and for 'usable' in 3/3.

get rid of the casts.

Reported-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
Signed-off-by: Marek Vasut <marek.vasut+rene...@mailbox.org>
---
Cc: Heinrich Schuchardt <xypron.g...@gmx.de>
Cc: Kuninori Morimoto <kuninori.morimoto...@renesas.com>
Cc: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
Cc: Simon Glass <s...@chromium.org>
Cc: Tom Rini <tr...@konsulko.com>
---
  boot/image-fdt.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/boot/image-fdt.c b/boot/image-fdt.c
index c2571b22244..c37442c9130 100644
--- a/boot/image-fdt.c
+++ b/boot/image-fdt.c
@@ -162,6 +162,7 @@ int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size)
      void    *of_start = NULL;
      phys_addr_t start, size, usable;
      char    *fdt_high;
+    phys_addr_t addr;

Please, keep variables in the narrowest scope where they are used.

Have a look at the entire function, this is the narrowest scope, $addr is used in both branches of the conditional now, in the same way too.

Reply via email to