[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <92a268d0-91b3-9d88-1408-485764f12306@omp.ru>
Date: Wed, 25 Aug 2021 23:53:41 +0300
From: Sergey Shtylyov <s.shtylyov@....ru>
To: Biju Das <biju.das.jz@...renesas.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
CC: Sergey Shtylyov <s.shtylyov@....ru>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
Andrew Lunn <andrew@...n.ch>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Adam Ford <aford173@...il.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
<netdev@...r.kernel.org>, <linux-renesas-soc@...r.kernel.org>,
Chris Paterson <Chris.Paterson2@...esas.com>,
Biju Das <biju.das@...renesas.com>
Subject: Re: [PATCH net-next 05/13] ravb: Factorise ravb_ring_free function
On 8/25/21 10:01 AM, Biju Das wrote:
> R-Car uses extended descriptor in RX, whereas RZ/G2L uses normal
> descriptor. Factorise ravb_ring_free function so that it can
> support later SoC.
>
> Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
[...]
> diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h
> index 209e030935aa..7cb30319524a 100644
> --- a/drivers/net/ethernet/renesas/ravb.h
> +++ b/drivers/net/ethernet/renesas/ravb.h
[...]
> index 883db1049882..dc388a32496a 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -216,31 +216,42 @@ static int ravb_tx_free(struct net_device *ndev, int q, bool free_txed_only)
> return free_num;
> }
>
> +static void ravb_rx_ring_free(struct net_device *ndev, int q)
> +{
> + struct ravb_private *priv = netdev_priv(ndev);
> + unsigned int ring_size;
> + unsigned int i;
> +
> + if (!priv->rx_ring[q])
> + return;
> +
> + for (i = 0; i < priv->num_rx_ring[q]; i++) {
> + struct ravb_ex_rx_desc *desc = &priv->rx_ring[q][i];
> +
> + if (!dma_mapping_error(ndev->dev.parent,
> + le32_to_cpu(desc->dptr)))
> + dma_unmap_single(ndev->dev.parent,
> + le32_to_cpu(desc->dptr),
> + RX_BUF_SZ,
> + DMA_FROM_DEVICE);
I think we could reflow this argument list, so that it takes less lines...
> + }
> + ring_size = sizeof(struct ravb_ex_rx_desc) *
> + (priv->num_rx_ring[q] + 1);
Here as well...
[...]
Reviewed-by: Sergey Shtylyov <s.shtylyov@....ru>
MBR, Sergey
Powered by blists - more mailing lists