* [U-Boot] [PATCH] dm: core: Correct address cast in dev_read_addr_ptr()
@ 2017-09-28 12:35 Simon Glass
2017-09-28 16:14 ` Dr. Philipp Tomsich
2017-09-29 9:40 ` Bin Meng
0 siblings, 2 replies; 8+ messages in thread
From: Simon Glass @ 2017-09-28 12:35 UTC (permalink / raw)
To: u-boot
This currently causes a warning in sandbox and will not do the right
thing:
drivers/core/read.c: In function ‘dev_read_addr_ptr’:
drivers/core/read.c:64:44: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
Use map_sysmem() which is the correct way to convert an address to a
pointer.
Fixes: c131c8bca8 (dm: core: add dev_read_addr_ptr())
Signed-off-by: Simon Glass <sjg@chromium.org>
---
drivers/core/read.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/core/read.c b/drivers/core/read.c
index eacf1716fd..5d440cee72 100644
--- a/drivers/core/read.c
+++ b/drivers/core/read.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <dm.h>
+#include <mapmem.h>
#include <dm/of_access.h>
int dev_read_u32_default(struct udevice *dev, const char *propname, int def)
@@ -61,7 +62,7 @@ void *dev_read_addr_ptr(struct udevice *dev)
{
fdt_addr_t addr = dev_read_addr(dev);
- return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
+ return (addr == FDT_ADDR_T_NONE) ? NULL : map_sysmem(addr, 0);
}
fdt_addr_t dev_read_addr_size(struct udevice *dev, const char *property,
--
2.14.2.822.g60be5d43e6-goog
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] dm: core: Correct address cast in dev_read_addr_ptr()
2017-09-28 12:35 [U-Boot] [PATCH] dm: core: Correct address cast in dev_read_addr_ptr() Simon Glass
@ 2017-09-28 16:14 ` Dr. Philipp Tomsich
2017-09-30 16:08 ` Dr. Philipp Tomsich
2017-09-29 9:40 ` Bin Meng
1 sibling, 1 reply; 8+ messages in thread
From: Dr. Philipp Tomsich @ 2017-09-28 16:14 UTC (permalink / raw)
To: u-boot
> On 28 Sep 2017, at 14:35, Simon Glass <sjg@chromium.org> wrote:
>
> This currently causes a warning in sandbox and will not do the right
> thing:
>
> drivers/core/read.c: In function ‘dev_read_addr_ptr’:
> drivers/core/read.c:64:44: warning: cast to pointer from integer of
> different size [-Wint-to-pointer-cast]
> return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
>
> Use map_sysmem() which is the correct way to convert an address to a
> pointer.
>
> Fixes: c131c8bca8 (dm: core: add dev_read_addr_ptr())
> Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] dm: core: Correct address cast in dev_read_addr_ptr()
2017-09-28 12:35 [U-Boot] [PATCH] dm: core: Correct address cast in dev_read_addr_ptr() Simon Glass
2017-09-28 16:14 ` Dr. Philipp Tomsich
@ 2017-09-29 9:40 ` Bin Meng
1 sibling, 0 replies; 8+ messages in thread
From: Bin Meng @ 2017-09-29 9:40 UTC (permalink / raw)
To: u-boot
On Thu, Sep 28, 2017 at 8:35 PM, Simon Glass <sjg@chromium.org> wrote:
> This currently causes a warning in sandbox and will not do the right
> thing:
>
> drivers/core/read.c: In function ‘dev_read_addr_ptr’:
> drivers/core/read.c:64:44: warning: cast to pointer from integer of
> different size [-Wint-to-pointer-cast]
> return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
>
> Use map_sysmem() which is the correct way to convert an address to a
> pointer.
>
> Fixes: c131c8bca8 (dm: core: add dev_read_addr_ptr())
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> drivers/core/read.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] dm: core: Correct address cast in dev_read_addr_ptr()
2017-09-28 16:14 ` Dr. Philipp Tomsich
@ 2017-09-30 16:08 ` Dr. Philipp Tomsich
2017-09-30 20:32 ` Tom Rini
0 siblings, 1 reply; 8+ messages in thread
From: Dr. Philipp Tomsich @ 2017-09-30 16:08 UTC (permalink / raw)
To: u-boot
Simon,
> On 28 Sep 2017, at 18:14, Dr. Philipp Tomsich <philipp.tomsich@theobroma-systems.com> wrote:
>
>
>> On 28 Sep 2017, at 14:35, Simon Glass <sjg@chromium.org> wrote:
>>
>> This currently causes a warning in sandbox and will not do the right
>> thing:
>>
>> drivers/core/read.c: In function ‘dev_read_addr_ptr’:
>> drivers/core/read.c:64:44: warning: cast to pointer from integer of
>> different size [-Wint-to-pointer-cast]
>> return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
>>
>> Use map_sysmem() which is the correct way to convert an address to a
>> pointer.
>>
>> Fixes: c131c8bca8 (dm: core: add dev_read_addr_ptr())
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
I’ll pull this one in through u-boot-rockchip now, as Tom raised it as a build
issue against my last pull-request.
Philipp.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] dm: core: Correct address cast in dev_read_addr_ptr()
2017-09-30 16:08 ` Dr. Philipp Tomsich
@ 2017-09-30 20:32 ` Tom Rini
2017-09-30 22:31 ` Dr. Philipp Tomsich
0 siblings, 1 reply; 8+ messages in thread
From: Tom Rini @ 2017-09-30 20:32 UTC (permalink / raw)
To: u-boot
On Sat, Sep 30, 2017 at 06:08:02PM +0200, Dr. Philipp Tomsich wrote:
> Simon,
>
> > On 28 Sep 2017, at 18:14, Dr. Philipp Tomsich <philipp.tomsich@theobroma-systems.com> wrote:
> >
> >
> >> On 28 Sep 2017, at 14:35, Simon Glass <sjg@chromium.org> wrote:
> >>
> >> This currently causes a warning in sandbox and will not do the right
> >> thing:
> >>
> >> drivers/core/read.c: In function ‘dev_read_addr_ptr’:
> >> drivers/core/read.c:64:44: warning: cast to pointer from integer of
> >> different size [-Wint-to-pointer-cast]
> >> return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
> >>
> >> Use map_sysmem() which is the correct way to convert an address to a
> >> pointer.
> >>
> >> Fixes: c131c8bca8 (dm: core: add dev_read_addr_ptr())
> >> Signed-off-by: Simon Glass <sjg@chromium.org>
> >
> > Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>
>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>
> I’ll pull this one in through u-boot-rockchip now, as Tom raised it as a build
> issue against my last pull-request.
Well, that's for the minor existing warning. The big problem is the
build failures :)
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170930/2763bfb1/attachment.sig>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] dm: core: Correct address cast in dev_read_addr_ptr()
2017-09-30 20:32 ` Tom Rini
@ 2017-09-30 22:31 ` Dr. Philipp Tomsich
2017-09-30 23:25 ` Tom Rini
2017-11-17 15:41 ` sjg at google.com
0 siblings, 2 replies; 8+ messages in thread
From: Dr. Philipp Tomsich @ 2017-09-30 22:31 UTC (permalink / raw)
To: u-boot
> On 30 Sep 2017, at 22:32, Tom Rini <trini@konsulko.com> wrote:
>
> On Sat, Sep 30, 2017 at 06:08:02PM +0200, Dr. Philipp Tomsich wrote:
>> Simon,
>>
>>> On 28 Sep 2017, at 18:14, Dr. Philipp Tomsich <philipp.tomsich@theobroma-systems.com> wrote:
>>>
>>>
>>>> On 28 Sep 2017, at 14:35, Simon Glass <sjg@chromium.org> wrote:
>>>>
>>>> This currently causes a warning in sandbox and will not do the right
>>>> thing:
>>>>
>>>> drivers/core/read.c: In function ‘dev_read_addr_ptr’:
>>>> drivers/core/read.c:64:44: warning: cast to pointer from integer of
>>>> different size [-Wint-to-pointer-cast]
>>>> return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
>>>>
>>>> Use map_sysmem() which is the correct way to convert an address to a
>>>> pointer.
>>>>
>>>> Fixes: c131c8bca8 (dm: core: add dev_read_addr_ptr())
>>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>>
>>> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>>
>>
>> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>>
>> I’ll pull this one in through u-boot-rockchip now, as Tom raised it as a build
>> issue against my last pull-request.
>
> Well, that's for the minor existing warning. The big problem is the
> build failures :)
I already backed Jagan’s change to mach-tegra/cache.c out (missed that
during my review and testing) and this is already running on Travis.
I understood you that I should also address those warnings related to
the Rockchip code? If not, I’d rather have this one go through the -dm
tree…
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] dm: core: Correct address cast in dev_read_addr_ptr()
2017-09-30 22:31 ` Dr. Philipp Tomsich
@ 2017-09-30 23:25 ` Tom Rini
2017-11-17 15:41 ` sjg at google.com
1 sibling, 0 replies; 8+ messages in thread
From: Tom Rini @ 2017-09-30 23:25 UTC (permalink / raw)
To: u-boot
On Sun, Oct 01, 2017 at 12:31:21AM +0200, Dr. Philipp Tomsich wrote:
>
> > On 30 Sep 2017, at 22:32, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sat, Sep 30, 2017 at 06:08:02PM +0200, Dr. Philipp Tomsich wrote:
> >> Simon,
> >>
> >>> On 28 Sep 2017, at 18:14, Dr. Philipp Tomsich <philipp.tomsich@theobroma-systems.com> wrote:
> >>>
> >>>
> >>>> On 28 Sep 2017, at 14:35, Simon Glass <sjg@chromium.org> wrote:
> >>>>
> >>>> This currently causes a warning in sandbox and will not do the right
> >>>> thing:
> >>>>
> >>>> drivers/core/read.c: In function ‘dev_read_addr_ptr’:
> >>>> drivers/core/read.c:64:44: warning: cast to pointer from integer of
> >>>> different size [-Wint-to-pointer-cast]
> >>>> return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
> >>>>
> >>>> Use map_sysmem() which is the correct way to convert an address to a
> >>>> pointer.
> >>>>
> >>>> Fixes: c131c8bca8 (dm: core: add dev_read_addr_ptr())
> >>>> Signed-off-by: Simon Glass <sjg@chromium.org>
> >>>
> >>> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> >>
> >>
> >> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> >>
> >> I’ll pull this one in through u-boot-rockchip now, as Tom raised it as a build
> >> issue against my last pull-request.
> >
> > Well, that's for the minor existing warning. The big problem is the
> > build failures :)
>
> I already backed Jagan’s change to mach-tegra/cache.c out (missed that
> during my review and testing) and this is already running on Travis.
>
> I understood you that I should also address those warnings related to
> the Rockchip code? If not, I’d rather have this one go through the -dm
> tree…
The DM warning fix can come via Simon's tree, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170930/71725dec/attachment.sig>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] dm: core: Correct address cast in dev_read_addr_ptr()
2017-09-30 22:31 ` Dr. Philipp Tomsich
2017-09-30 23:25 ` Tom Rini
@ 2017-11-17 15:41 ` sjg at google.com
1 sibling, 0 replies; 8+ messages in thread
From: sjg at google.com @ 2017-11-17 15:41 UTC (permalink / raw)
To: u-boot
On Sun, Oct 01, 2017 at 12:31:21AM +0200, Dr. Philipp Tomsich wrote:
>
> > On 30 Sep 2017, at 22:32, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sat, Sep 30, 2017 at 06:08:02PM +0200, Dr. Philipp Tomsich wrote:
> >> Simon,
> >>
> >>> On 28 Sep 2017, at 18:14, Dr. Philipp Tomsich <philipp.tomsich@theobroma-systems.com> wrote:
> >>>
> >>>
> >>>> On 28 Sep 2017, at 14:35, Simon Glass <sjg@chromium.org> wrote:
> >>>>
> >>>> This currently causes a warning in sandbox and will not do the right
> >>>> thing:
> >>>>
> >>>> drivers/core/read.c: In function ‘dev_read_addr_ptr’:
> >>>> drivers/core/read.c:64:44: warning: cast to pointer from integer of
> >>>> different size [-Wint-to-pointer-cast]
> >>>> return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
> >>>>
> >>>> Use map_sysmem() which is the correct way to convert an address to a
> >>>> pointer.
> >>>>
> >>>> Fixes: c131c8bca8 (dm: core: add dev_read_addr_ptr())
> >>>> Signed-off-by: Simon Glass <sjg@chromium.org>
> >>>
> >>> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> >>
> >>
> >> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> >>
> >> I’ll pull this one in through u-boot-rockchip now, as Tom raised it as a build
> >> issue against my last pull-request.
> >
> > Well, that's for the minor existing warning. The big problem is the
> > build failures :)
>
> I already backed Jagan’s change to mach-tegra/cache.c out (missed that
> during my review and testing) and this is already running on Travis.
>
> I understood you that I should also address those warnings related to
> the Rockchip code? If not, I’d rather have this one go through the -dm
> tree…
The DM warning fix can come via Simon's tree, thanks!
--
Tom
Applied to u-boot-dm thanks!
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-11-17 15:41 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-28 12:35 [U-Boot] [PATCH] dm: core: Correct address cast in dev_read_addr_ptr() Simon Glass
2017-09-28 16:14 ` Dr. Philipp Tomsich
2017-09-30 16:08 ` Dr. Philipp Tomsich
2017-09-30 20:32 ` Tom Rini
2017-09-30 22:31 ` Dr. Philipp Tomsich
2017-09-30 23:25 ` Tom Rini
2017-11-17 15:41 ` sjg at google.com
2017-09-29 9:40 ` 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.