* [U-Boot] [PATCH] fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE
@ 2015-12-07 9:39 Bin Meng
2015-12-08 19:34 ` Simon Glass
2015-12-09 7:58 ` Stefan Roese
0 siblings, 2 replies; 5+ messages in thread
From: Bin Meng @ 2015-12-07 9:39 UTC (permalink / raw)
To: u-boot
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.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---
common/fdt_support.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/common/fdt_support.c b/common/fdt_support.c
index a7ff2df..66464db 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -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)
--
1.8.2.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE
2015-12-07 9:39 [U-Boot] [PATCH] fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE Bin Meng
@ 2015-12-08 19:34 ` Simon Glass
2015-12-09 1:57 ` Bin Meng
2015-12-09 7:58 ` Stefan Roese
1 sibling, 1 reply; 5+ messages in thread
From: Simon Glass @ 2015-12-08 19:34 UTC (permalink / raw)
To: u-boot
On 7 December 2015 at 02:39, Bin Meng <bmeng.cn@gmail.com> wrote:
> 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.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
> common/fdt_support.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Acked-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE
2015-12-08 19:34 ` Simon Glass
@ 2015-12-09 1:57 ` Bin Meng
0 siblings, 0 replies; 5+ messages in thread
From: Bin Meng @ 2015-12-09 1:57 UTC (permalink / raw)
To: u-boot
On Wed, Dec 9, 2015 at 3:34 AM, Simon Glass <sjg@chromium.org> wrote:
> On 7 December 2015 at 02:39, Bin Meng <bmeng.cn@gmail.com> wrote:
>> 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.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> ---
>>
>> common/fdt_support.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Acked-by: Simon Glass <sjg@chromium.org>
applied to u-boot-x86/master, thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE
2015-12-07 9:39 [U-Boot] [PATCH] fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE Bin Meng
2015-12-08 19:34 ` Simon Glass
@ 2015-12-09 7:58 ` Stefan Roese
2015-12-09 9:43 ` Bin Meng
1 sibling, 1 reply; 5+ messages in thread
From: Stefan Roese @ 2015-12-09 7:58 UTC (permalink / raw)
To: u-boot
Hi Bin,
On 07.12.2015 10:39, Bin Meng wrote:
> 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.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
A little late, sorry - but:
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE
2015-12-09 7:58 ` Stefan Roese
@ 2015-12-09 9:43 ` Bin Meng
0 siblings, 0 replies; 5+ messages in thread
From: Bin Meng @ 2015-12-09 9:43 UTC (permalink / raw)
To: u-boot
On Wed, Dec 9, 2015 at 3:58 PM, Stefan Roese <sr@denx.de> wrote:
> Hi Bin,
>
> On 07.12.2015 10:39, Bin Meng wrote:
>>
>> 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.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>
>
> A little late, sorry - but:
>
> Reviewed-by: Stefan Roese <sr@denx.de>
>
Thanks Stefan.
Added Stefan's review tag, and re-applied to u-boot-x86/master!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-12-09 9:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-07 9:39 [U-Boot] [PATCH] fdt: Change OF_BAD_ADDR to FDT_ADDR_T_NONE Bin Meng
2015-12-08 19:34 ` Simon Glass
2015-12-09 1:57 ` Bin Meng
2015-12-09 7:58 ` Stefan Roese
2015-12-09 9:43 ` Bin Meng
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.