fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE
PATCH 1/1 fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE
Currently OF_BAD_ADDR is always -1ULL. When using OF_BAD_ADDR as the return value of dev_get_addr(), it creates potential size mismatch as dev_get_addr() uses FDT_ADDR_T_NONE as the return value which can be either -1U or -1ULL depending on CONFIG_PHYS_64BIT. Now we change OF_BAD_ADDR to FDT_ADDR_T_NONE to avoid such case.
---
common/fdt_support.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
common/fdt_support.c +2 -1
@@ -16,6 +16,7 @@#include <libfdt.h> #include <fdt_support.h> #include <exports.h> +#include <fdtdec.h> /** * fdt_getprop_u32_default_node - Return a node's property or a default
@@ -950,7 +951,7 @@ void fdt_del_node_and_alias(void *blob, const char *alias)/* Max address size we deal with */ #define OF_MAX_ADDR_CELLS 4 -#define OF_BAD_ADDR ((u64)-1) +#define OF_BAD_ADDR FDT_ADDR_T_NONE#define OF_CHECK_COUNTS (na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \ (ns) > 0)
Signature · 1 line
1.8.2.1
PATCH 1/1 fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE
Quoted 11 lines · Bin Meng
Currently
OF_BAD_ADDRis always -1ULL. When usingOF_BAD_ADDRas the return value ofdev_get_addr(), it creates potential size mismatch asdev_get_addr()usesFDT_ADDR_T_NONEas the return value which can be either -1U or -1ULL depending onCONFIG_PHYS_64BIT. Now we changeOF_BAD_ADDRtoFDT_ADDR_T_NONEto avoid such case.Signed-off-by Bin Meng <[email protected]>---
common/fdt_support.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
PATCH 1/1 fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE
Quoted 7 lines · Simon Glass
Quoted 6 lines · Bin Meng
Currently
OF_BAD_ADDRis always -1ULL. When usingOF_BAD_ADDRas the return value ofdev_get_addr(), it creates potential size mismatch asdev_get_addr()usesFDT_ADDR_T_NONEas the return value which can be either -1U or -1ULL depending onCONFIG_PHYS_64BIT. Now we changeOF_BAD_ADDRtoFDT_ADDR_T_NONEto avoid such case.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
common/fdt_support.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)Acked-by Simon Glass <[email protected]>
applied to u-boot-x86/master, thanks!
PATCH 1/1 fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE
In reply to Bin MengHi Bin,
Quoted 7 lines · Bin Meng
Currently
OF_BAD_ADDRis always -1ULL. When usingOF_BAD_ADDRas the return value ofdev_get_addr(), it creates potential size mismatch asdev_get_addr()usesFDT_ADDR_T_NONEas the return value which can be either -1U or -1ULL depending onCONFIG_PHYS_64BIT. Now we changeOF_BAD_ADDRtoFDT_ADDR_T_NONEto avoid such case.Signed-off-by Bin Meng <[email protected]>
A little late, sorry - but:
Thanks,
Stefan
PATCH 1/1 fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE
Quoted 10 lines · Stefan Roese
Hi Bin,
Quoted 7 lines · Bin Meng
Currently
OF_BAD_ADDRis always -1ULL. When usingOF_BAD_ADDRas the return value ofdev_get_addr(), it creates potential size mismatch asdev_get_addr()usesFDT_ADDR_T_NONEas the return value which can be either -1U or -1ULL depending onCONFIG_PHYS_64BIT. Now we changeOF_BAD_ADDRtoFDT_ADDR_T_NONEto avoid such case.
Quoted 7 lines
Quoted 1 line
Signed-off-by Bin Meng <[email protected]>A little late, sorry - but:
Reviewed-by Stefan Roese <[email protected]>
Thanks Stefan.
Added Stefan's review tag, and re-applied to u-boot-x86/master!