]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: broadcom: bcm4908_enet: fix endianness in xmit code
authorRafał Miłecki <rafal@milecki.pl>
Thu, 11 Feb 2021 12:12:39 +0000 (13:12 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Feb 2021 23:04:17 +0000 (15:04 -0800)
Use le32_to_cpu() for reading __le32 struct field filled by hw.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcm4908_enet.c

index 2e825db3b2f14769513409c19d4a62b3ebd6d49e..0da8c8c73ba7d9c25e8d2f055ff368aaae2e05a4 100644 (file)
@@ -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];