Skip to content

Commit

Permalink
NTB: fix 32-bit compiler warning
Browse files Browse the repository at this point in the history
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: e26a584 ("NTB: Split ntb_hw_intel and ntb_transport drivers")
Signed-off-by: Jon Mason <jdmason@kudzu.us>
  • Loading branch information
Arnd Bergmann authored and Jon Mason committed Nov 8, 2015
1 parent 8b782fa commit fdcb4b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/ntb/ntb_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fdcb4b2

Please sign in to comment.