2019-07-31 08:07:32

by Christophe JAILLET

[permalink] [raw]
Subject: [PATCH 1/2] net: ag71xx: Slighly simplify code in 'ag71xx_rings_init()'

A few lines above, we have:
tx_size = BIT(tx->order);

So use 'tx_size' directly to be consistent with the way 'rx->descs_cpu' and
'rx->descs_dma' are computed below.

Signed-off-by: Christophe JAILLET <[email protected]>
---
drivers/net/ethernet/atheros/ag71xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c
index 77542bd1e5bd..40a8717f51b1 100644
--- a/drivers/net/ethernet/atheros/ag71xx.c
+++ b/drivers/net/ethernet/atheros/ag71xx.c
@@ -1148,7 +1148,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;

--
2.20.1


2019-07-31 17:33:57

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 1/2] net: ag71xx: Slighly simplify code in 'ag71xx_rings_init()'

From: Christophe JAILLET <[email protected]>
Date: Wed, 31 Jul 2019 10:06:38 +0200

> A few lines above, we have:
> tx_size = BIT(tx->order);
>
> So use 'tx_size' directly to be consistent with the way 'rx->descs_cpu' and
> 'rx->descs_dma' are computed below.
>
> Signed-off-by: Christophe JAILLET <[email protected]>

Applied to net-next.

2019-08-08 05:31:53

by Jesse Brandeburg

[permalink] [raw]
Subject: Re: [PATCH 1/2] net: ag71xx: Slighly simplify code in 'ag71xx_rings_init()'

On Wed, 31 Jul 2019 10:06:38 +0200
Christophe JAILLET <[email protected]> wrote:

> A few lines above, we have:
> tx_size = BIT(tx->order);
>
> So use 'tx_size' directly to be consistent with the way 'rx->descs_cpu' and
> 'rx->descs_dma' are computed below.
>
> Signed-off-by: Christophe JAILLET <[email protected]>

Reviewed-by: Jesse Brandeburg <[email protected]>