lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ed50317-2334-0bea-33ce-836d61d14715@infradead.org>
Date:   Thu, 20 Aug 2020 07:14:41 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Edward Cree <ecree@...arflare.com>,
        linux-net-drivers@...arflare.com, davem@...emloft.net
Cc:     netdev@...r.kernel.org
Subject: Re: [PATCH net] sfc: fix build warnings on 32-bit

On 8/20/20 3:47 AM, Edward Cree wrote:
> 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@...radead.org>
> Signed-off-by: Edward Cree <ecree@...arflare.com>

Acked-by: Randy Dunlap <rdunlap@...radead.org> # build-tested

Thanks.

> ---
>  drivers/net/ethernet/sfc/ef100.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/ef100.c b/drivers/net/ethernet/sfc/ef100.c
> index 9729983f4840..c54b7f8243f3 100644
> --- a/drivers/net/ethernet/sfc/ef100.c
> +++ b/drivers/net/ethernet/sfc/ef100.c
> @@ -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,
> @@ -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,
> @@ -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,
> @@ -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;
> 


-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ