linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NTB: fix 32-bit compiler warning
@ 2015-10-07  7:59 Arnd Bergmann
  2015-11-08 21:24 ` Jon Mason
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2015-10-07  7:59 UTC (permalink / raw)
  To: linux-arm-kernel

resource_size_t may be 32-bit wide on some architectures, which causes
this warning when building the NTB code:

drivers/ntb/ntb_transport.c: In function 'ntb_transport_link_work':
drivers/ntb/ntb_transport.c:828:46: warning: right shift count >= width of type [-Wshift-count-overflow]

The warning is harmless but can be avoided by using the upper_32_bits()
macro.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: e26a5843f7f5 ("NTB: Split ntb_hw_intel and ntb_transport drivers")
---
Found while building ARM allmodconfig

diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index 6e3ee907d186..700f3ae833c2 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -825,10 +825,10 @@ static void ntb_transport_link_work(struct work_struct *work)
 			size = max_mw_size;
 
 		spad = MW0_SZ_HIGH + (i * 2);
-		ntb_peer_spad_write(ndev, spad, (u32)(size >> 32));
+		ntb_peer_spad_write(ndev, spad, upper_32_bits(size));
 
 		spad = MW0_SZ_LOW + (i * 2);
-		ntb_peer_spad_write(ndev, spad, (u32)size);
+		ntb_peer_spad_write(ndev, spad, lower_32_bits(size));
 	}
 
 	ntb_peer_spad_write(ndev, NUM_MWS, nt->mw_count);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] NTB: fix 32-bit compiler warning
  2015-10-07  7:59 [PATCH] NTB: fix 32-bit compiler warning Arnd Bergmann
@ 2015-11-08 21:24 ` Jon Mason
  0 siblings, 0 replies; 2+ messages in thread
From: Jon Mason @ 2015-11-08 21:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 07, 2015 at 09:59:34AM +0200, Arnd Bergmann wrote:
> resource_size_t may be 32-bit wide on some architectures, which causes
> this warning when building the NTB code:
> 
> drivers/ntb/ntb_transport.c: In function 'ntb_transport_link_work':
> drivers/ntb/ntb_transport.c:828:46: warning: right shift count >= width of type [-Wshift-count-overflow]
> 
> The warning is harmless but can be avoided by using the upper_32_bits()
> macro.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: e26a5843f7f5 ("NTB: Split ntb_hw_intel and ntb_transport drivers")

Pulled in to the next release (coming out shortly).

Thanks,
Jon

> ---
> Found while building ARM allmodconfig
> 
> diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
> index 6e3ee907d186..700f3ae833c2 100644
> --- a/drivers/ntb/ntb_transport.c
> +++ b/drivers/ntb/ntb_transport.c
> @@ -825,10 +825,10 @@ static void ntb_transport_link_work(struct work_struct *work)
>  			size = max_mw_size;
>  
>  		spad = MW0_SZ_HIGH + (i * 2);
> -		ntb_peer_spad_write(ndev, spad, (u32)(size >> 32));
> +		ntb_peer_spad_write(ndev, spad, upper_32_bits(size));
>  
>  		spad = MW0_SZ_LOW + (i * 2);
> -		ntb_peer_spad_write(ndev, spad, (u32)size);
> +		ntb_peer_spad_write(ndev, spad, lower_32_bits(size));
>  	}
>  
>  	ntb_peer_spad_write(ndev, NUM_MWS, nt->mw_count);
> 
> -- 
> You received this message because you are subscribed to the Google Groups "linux-ntb" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-ntb+unsubscribe at googlegroups.com.
> To post to this group, send email to linux-ntb at googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/linux-ntb/10263287.Brd9HPYQJD%40wuerfel.
> For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-08 21:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-07  7:59 [PATCH] NTB: fix 32-bit compiler warning Arnd Bergmann
2015-11-08 21:24 ` Jon Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).