diff mbox series

[1/9] cache: sifive: Fix -Wint-to-pointer-cast warning

Message ID 20210912031516.24885-1-bmeng.cn@gmail.com
State Accepted
Commit 2fb91a2ea74e87d5e26e95f602c9f8e3951a35cf
Delegated to: Andes
Headers show
Series [1/9] cache: sifive: Fix -Wint-to-pointer-cast warning | expand

Commit Message

Bin Meng Sept. 12, 2021, 3:15 a.m. UTC
The following warning is seen in cache-sifive-ccache.c in a 32-bit build:

  warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Fix by casting it with uintptr_t.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 drivers/cache/cache-sifive-ccache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Leo Liang Sept. 15, 2021, 3:40 a.m. UTC | #1
On Sun, Sep 12, 2021 at 11:15:08AM +0800, Bin Meng wrote:
> The following warning is seen in cache-sifive-ccache.c in a 32-bit build:
>
>   warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>
> Fix by casting it with uintptr_t.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  drivers/cache/cache-sifive-ccache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
CONFIDENTIALITY NOTICE:

This e-mail (and its attachments) may contain confidential and legally privileged information or information protected from disclosure. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein is strictly prohibited. In this case, please immediately notify the sender by return e-mail, delete the message (and any accompanying documents) and destroy all printed hard copies. Thank you for your cooperation.

Copyright ANDES TECHNOLOGY CORPORATION - All Rights Reserved.
Bin Meng Oct. 11, 2021, 3:14 a.m. UTC | #2
On Wed, Sep 15, 2021 at 11:40 AM Leo Liang <ycliang@andestech.com> wrote:
>
> On Sun, Sep 12, 2021 at 11:15:08AM +0800, Bin Meng wrote:
> > The following warning is seen in cache-sifive-ccache.c in a 32-bit build:
> >
> >   warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> >
> > Fix by casting it with uintptr_t.
> >
> > Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> > ---
> >
> >  drivers/cache/cache-sifive-ccache.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

Ping for apply?
Leo Liang Oct. 12, 2021, 7:43 a.m. UTC | #3
On Mon, Oct 11, 2021 at 11:14:21AM +0800, Bin Meng wrote:
> On Wed, Sep 15, 2021 at 11:40 AM Leo Liang <ycliang@andestech.com> wrote:
> >
> > On Sun, Sep 12, 2021 at 11:15:08AM +0800, Bin Meng wrote:
> > > The following warning is seen in cache-sifive-ccache.c in a 32-bit build:
> > >
> > >   warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> > >
> > > Fix by casting it with uintptr_t.
> > >
> > > Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> > > ---
> > >
> > >  drivers/cache/cache-sifive-ccache.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
> 
> Ping for apply?

Hi Bin,

Sorry for the late reply.

For this patch set, I thought you were going to update the tests for the
new API `devfdt_get_addr_index_ptr()` as Simon suggested.

Just wanted to make sure that you don't have any updates for this
patchset, then I will apply this patch right away.

Hi Simon,

After checking the test/dm/test-fdt.c,
there seems to be no need for any updates, right? 
Or is there anything I miss?

Best regards,
Leo
diff mbox series

Patch

diff --git a/drivers/cache/cache-sifive-ccache.c b/drivers/cache/cache-sifive-ccache.c
index 76c0ab26ae..c8766f6242 100644
--- a/drivers/cache/cache-sifive-ccache.c
+++ b/drivers/cache/cache-sifive-ccache.c
@@ -38,7 +38,7 @@  static int sifive_ccache_get_info(struct udevice *dev, struct cache_info *info)
 {
 	struct sifive_ccache *priv = dev_get_priv(dev);
 
-	info->base = (phys_addr_t)priv->base;
+	info->base = (uintptr_t)priv->base;
 
 	return 0;
 }