ar71xx/ath79: ag71xx: dont fetch the same var again
authorKoen Vandeputte <koen.vandeputte@ncentric.com>
Mon, 12 Aug 2019 10:18:15 +0000 (12:18 +0200)
committerKoen Vandeputte <koen.vandeputte@ncentric.com>
Tue, 27 Aug 2019 08:32:44 +0000 (10:32 +0200)
tx_size was just declared above and set to BIT(tx->order)
Use the declaration instead, which could avoid a pointer deref

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c

index ee703a48bfa1b50d046fac2f6db4c72b4a50cc3b..ebbe8a7472252e979facb971be4198b1e15c4779 100644 (file)
@@ -298,7 +298,7 @@ static int ag71xx_rings_init(struct ag71xx *ag)
                return -ENOMEM;
        }
 
-       rx->buf = &tx->buf[BIT(tx->order)];
+       rx->buf = &tx->buf[tx_size];
        rx->descs_cpu = ((void *)tx->descs_cpu) + tx_size * AG71XX_DESC_SIZE;
        rx->descs_dma = tx->descs_dma + tx_size * AG71XX_DESC_SIZE;
 
index f8f19c6e41dc14b978e2e2eea935098d6b282312..0924b81b9238fd4b8922423f145bff7cc8513823 100644 (file)
@@ -284,7 +284,7 @@ static int ag71xx_rings_init(struct ag71xx *ag)
                return -ENOMEM;
        }
 
-       rx->buf = &tx->buf[BIT(tx->order)];
+       rx->buf = &tx->buf[tx_size];
        rx->descs_cpu = ((void *)tx->descs_cpu) + tx_size * AG71XX_DESC_SIZE;
        rx->descs_dma = tx->descs_dma + tx_size * AG71XX_DESC_SIZE;