Skip to content

Commit

Permalink
sfc: fix build warnings on 32-bit
Browse files Browse the repository at this point in the history
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 <rdunlap@infradead.org>
Signed-off-by: Edward Cree <ecree@solarflare.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Edward Cree authored and David S. Miller committed Aug 20, 2020
1 parent fb73ed5 commit 3e659a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ethernet/sfc/ef100.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static int ef100_pci_parse_continue_entry(struct efx_nic *efx, int entry_locatio

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

/* Put old BAR back. */
rc = efx_init_io(efx, previous_bar,
DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
(dma_addr_t)DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
pci_resource_len(efx->pci_dev, previous_bar));
if (rc) {
netif_err(efx, probe, efx->net_dev,
Expand Down Expand Up @@ -334,7 +334,7 @@ static int ef100_pci_parse_xilinx_cap(struct efx_nic *efx, int vndr_cap,

/* Temporarily map BAR. */
rc = efx_init_io(efx, bar,
DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
(dma_addr_t)DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
pci_resource_len(efx->pci_dev, bar));
if (rc) {
netif_err(efx, probe, efx->net_dev,
Expand Down Expand Up @@ -495,7 +495,7 @@ static int ef100_pci_probe(struct pci_dev *pci_dev,

/* Set up basic I/O (BAR mappings etc) */
rc = efx_init_io(efx, fcw.bar,
DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
(dma_addr_t)DMA_BIT_MASK(ESF_GZ_TX_SEND_ADDR_WIDTH),
pci_resource_len(efx->pci_dev, fcw.bar));
if (rc)
goto fail;
Expand Down

0 comments on commit 3e659a8

Please sign in to comment.