]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
NTB: fix 32-bit compiler warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 7 Oct 2015 07:59:34 +0000 (09:59 +0200)
committerJon Mason <jdmason@kudzu.us>
Sun, 8 Nov 2015 21:24:43 +0000 (16:24 -0500)
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")
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/ntb_transport.c

index be9389599e75040787e6aae686875d086340ee1f..60654d524858c4bf52f6c5b5668c90719f523eda 100644 (file)
@@ -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);