diff mbox series

[net-next,5.12,8/8] net: broadcom: bcm4908_enet: fix endianness in xmit code

Message ID 20210211121239.728-9-zajec5@gmail.com
State New
Headers show
Series bcm4908_enet: post-review fixes | expand

Commit Message

Rafał Miłecki Feb. 11, 2021, 12:12 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

Use le32_to_cpu() for reading __le32 struct field filled by hw.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/net/ethernet/broadcom/bcm4908_enet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bcm4908_enet.c b/drivers/net/ethernet/broadcom/bcm4908_enet.c
index 2e825db3b2f1..0da8c8c73ba7 100644
--- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
@@ -476,7 +476,7 @@  static int bcm4908_enet_start_xmit(struct sk_buff *skb, struct net_device *netde
 	/* Free transmitted skbs */
 	while (ring->read_idx != ring->write_idx) {
 		buf_desc = &ring->buf_desc[ring->read_idx];
-		if (buf_desc->ctl & DMA_CTL_STATUS_OWN)
+		if (le32_to_cpu(buf_desc->ctl) & DMA_CTL_STATUS_OWN)
 			break;
 		slot = &ring->slots[ring->read_idx];