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@xxxxxxxxxxxxxx> > Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx> [...] > 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@xxxxxx> MBR, Sergey