mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] net: bcmgenet: fix warning when building for 32-bit
Date: Wed, 11 Jan 2023 09:00:48 +0100	[thread overview]
Message-ID: <20230111080048.GF24755@pengutronix.de> (raw)
In-Reply-To: <20230110180126.73739-1-a.fatoum@pengutronix.de>

On Tue, Jan 10, 2023 at 07:01:25PM +0100, Ahmad Fatoum wrote:
> The driver readily works in 32-bit mode as it takes care there
> to write zero to the DMA_DESC_ADDRESS_HI field of descriptors.
> In the receive path, a 32-bit integer is shifted by 32 though
> leading to a (harmless) warning. Adjust the type to silence it.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/net/bcmgenet.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/net/bcmgenet.c b/drivers/net/bcmgenet.c
> index 32ec36eff65a..3ae341a658a0 100644
> --- a/drivers/net/bcmgenet.c
> +++ b/drivers/net/bcmgenet.c
> @@ -314,8 +314,8 @@ static int bcmgenet_gmac_eth_recv(struct eth_device *edev)
>  	struct bcmgenet_eth_priv *priv = edev->priv;
>  	void *desc_base = priv->mac_reg + GENET_RX_OFF + priv->rx_index * DMA_DESC_SIZE;
>  	u32 prod_index = readl(priv->mac_reg + RDMA_PROD_INDEX);
> -	u32 length;
> -	unsigned long addr_lo, addr_hi, addr;
> +	u32 length, addr_lo, addr_hi;
> +	dma_addr_t addr;
>  
>  	if (prod_index == priv->c_index)
>  		return -EAGAIN;
> @@ -324,7 +324,7 @@ static int bcmgenet_gmac_eth_recv(struct eth_device *edev)
>  	length = (length >> DMA_BUFLENGTH_SHIFT) & DMA_BUFLENGTH_MASK;
>  	addr_lo = readl(desc_base + DMA_DESC_ADDRESS_LO);
>  	addr_hi = readl(desc_base + DMA_DESC_ADDRESS_HI);
> -	addr = addr_hi << 32 | addr_lo;
> +	addr = (u64)addr_hi << 32 | addr_lo;
>  
>  	dma_sync_single_for_cpu(addr, length, DMA_FROM_DEVICE);
>  
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      parent reply	other threads:[~2023-01-11  8:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 18:01 Ahmad Fatoum
2023-01-10 18:01 ` [PATCH 2/2] ARM: rpi: defconfig: enable Raspberry Pi 4 drivers in 32-bit config Ahmad Fatoum
2023-01-11  8:00 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230111080048.GF24755@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox