mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] net: bcmgenet: fix warning when building for 32-bit
@ 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 ` [PATCH 1/2] net: bcmgenet: fix warning when building for 32-bit Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-01-10 18:01 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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(-)

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-11  8:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-10 18:01 [PATCH 1/2] net: bcmgenet: fix warning when building for 32-bit 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 ` [PATCH 1/2] net: bcmgenet: fix warning when building for 32-bit Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox