diff mbox series

[1/3] bus: ti-sysc: Fix build warning for 64-bit build

Message ID 20230804103859.57458-1-tony@atomide.com (mailing list archive)
State New, archived
Headers show
Series [1/3] bus: ti-sysc: Fix build warning for 64-bit build | expand

Commit Message

Tony Lindgren Aug. 4, 2023, 10:38 a.m. UTC
Fix "warning: cast from pointer to integer of different size" on 64-bit
builds.

Note that this is a cosmetic fix at this point as the driver is not yet
used for 64-bit systems.

Fixes: feaa8baee82a ("bus: ti-sysc: Implement SoC revision handling")
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/bus/ti-sysc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dhruva Gole Aug. 5, 2023, 5:17 a.m. UTC | #1
Hi Tony,

On Aug 04, 2023 at 13:38:57 +0300, Tony Lindgren wrote:
> Fix "warning: cast from pointer to integer of different size" on 64-bit
> builds.

Thanks for enabling this on 64 bit, will help us in K3 SOCs.

> 
> Note that this is a cosmetic fix at this point as the driver is not yet
> used for 64-bit systems.
> 
> Fixes: feaa8baee82a ("bus: ti-sysc: Implement SoC revision handling")
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/bus/ti-sysc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
> --- a/drivers/bus/ti-sysc.c
> +++ b/drivers/bus/ti-sysc.c
> @@ -3104,7 +3104,7 @@ static int sysc_init_static_data(struct sysc *ddata)
>  
>  	match = soc_device_match(sysc_soc_match);
>  	if (match && match->data)
> -		sysc_soc->soc = (int)match->data;
> +		sysc_soc->soc = (unsigned long)match->data;

Reviewed-by: Dhruva Gole <d-gole@ti.com>

>  
>  	/*
>  	 * Check and warn about possible old incomplete dtb. We now want to see
> -- 
> 2.41.0
Nishanth Menon Aug. 5, 2023, 5:23 p.m. UTC | #2
On 10:47-20230805, Dhruva Gole wrote:
> Hi Tony,
> 
> On Aug 04, 2023 at 13:38:57 +0300, Tony Lindgren wrote:
> > Fix "warning: cast from pointer to integer of different size" on 64-bit
> > builds.
> 
> Thanks for enabling this on 64 bit, will help us in K3 SOCs.
> 
> > 
> > Note that this is a cosmetic fix at this point as the driver is not yet
> > used for 64-bit systems.
> > 
> > Fixes: feaa8baee82a ("bus: ti-sysc: Implement SoC revision handling")
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> >  drivers/bus/ti-sysc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
> > --- a/drivers/bus/ti-sysc.c
> > +++ b/drivers/bus/ti-sysc.c
> > @@ -3104,7 +3104,7 @@ static int sysc_init_static_data(struct sysc *ddata)
> >  
> >  	match = soc_device_match(sysc_soc_match);
> >  	if (match && match->data)
> > -		sysc_soc->soc = (int)match->data;
> > +		sysc_soc->soc = (unsigned long)match->data;
> 
> Reviewed-by: Dhruva Gole <d-gole@ti.com>

Dumb q: is'nt this an enum? Is it better to cast it as (enum
sysc_soc)match->data ?

> 
> >  
> >  	/*
> >  	 * Check and warn about possible old incomplete dtb. We now want to see
> > -- 
> > 2.41.0
> 
> -- 
> Best regards,
> Dhruva Gole <d-gole@ti.com>
Tony Lindgren Aug. 9, 2023, 7:27 a.m. UTC | #3
* Nishanth Menon <nm@ti.com> [230805 17:23]:
> On 10:47-20230805, Dhruva Gole wrote:
> > On Aug 04, 2023 at 13:38:57 +0300, Tony Lindgren wrote:
> > >  	match = soc_device_match(sysc_soc_match);
> > >  	if (match && match->data)
> > > -		sysc_soc->soc = (int)match->data;
> > > +		sysc_soc->soc = (unsigned long)match->data;
> > 
> > Reviewed-by: Dhruva Gole <d-gole@ti.com>
> 
> Dumb q: is'nt this an enum? Is it better to cast it as (enum
> sysc_soc)match->data ?

Good idea, will update.

Regards,

Tony
diff mbox series

Patch

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -3104,7 +3104,7 @@  static int sysc_init_static_data(struct sysc *ddata)
 
 	match = soc_device_match(sysc_soc_match);
 	if (match && match->data)
-		sysc_soc->soc = (int)match->data;
+		sysc_soc->soc = (unsigned long)match->data;
 
 	/*
 	 * Check and warn about possible old incomplete dtb. We now want to see