Skip to content

Commit 3e659a8

Browse files
ecree-solarflaredavem330
authored andcommitted
sfc: fix build warnings on 32-bit
Truncation of DMA_BIT_MASK to 32-bit dma_addr_t is semantically safe, but the compiler was warning because it was happening implicitly. Insert explicit casts to suppress the warnings. Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Edward Cree <[email protected]> Acked-by: Randy Dunlap <[email protected]> # build-tested Signed-off-by: David S. Miller <[email protected]>
1 parent fb73ed5 commit 3e659a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/sfc/ef100.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static int ef100_pci_parse_continue_entry(struct efx_nic *efx, int entry_locatio
142142

143143
/* Temporarily map new BAR. */
144144
rc = efx_init_io(efx, bar,
145-
DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
145+
(dma_addr_t)DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
146146
pci_resource_len(efx->pci_dev, bar));
147147
if (rc) {
148148
netif_err(efx, probe, efx->net_dev,
@@ -160,7 +160,7 @@ static int ef100_pci_parse_continue_entry(struct efx_nic *efx, int entry_locatio
160160

161161
/* Put old BAR back. */
162162
rc = efx_init_io(efx, previous_bar,
163-
DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
163+
(dma_addr_t)DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
164164
pci_resource_len(efx->pci_dev, previous_bar));
165165
if (rc) {
166166
netif_err(efx, probe, efx->net_dev,
@@ -334,7 +334,7 @@ static int ef100_pci_parse_xilinx_cap(struct efx_nic *efx, int vndr_cap,
334334

335335
/* Temporarily map BAR. */
336336
rc = efx_init_io(efx, bar,
337-
DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
337+
(dma_addr_t)DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
338338
pci_resource_len(efx->pci_dev, bar));
339339
if (rc) {
340340
netif_err(efx, probe, efx->net_dev,
@@ -495,7 +495,7 @@ static int ef100_pci_probe(struct pci_dev *pci_dev,
495495

496496
/* Set up basic I/O (BAR mappings etc) */
497497
rc = efx_init_io(efx, fcw.bar,
498-
DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
498+
(dma_addr_t)DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
499499
pci_resource_len(efx->pci_dev, fcw.bar));
500500
if (rc)
501501
goto fail;

0 commit comments

Comments
 (0)