All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: deepakx.nagaraju@intel.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	jdavem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	mun.yew.tham@intel.com,
	Andy Schevchenko <andriy.schevchenko@linux.intel.com>
Subject: Re: [PATCH v2 4/4] net: ethernet: altera: rename functions and their prototypes
Date: Sat, 23 Dec 2023 15:06:42 +0000	[thread overview]
Message-ID: <20231223150642.GE201037@kernel.org> (raw)
In-Reply-To: <20231221134041.27104-5-deepakx.nagaraju@intel.com>

On Thu, Dec 21, 2023 at 09:40:41PM +0800, deepakx.nagaraju@intel.com wrote:
> From: Nagaraju DeepakX <deepakx.nagaraju@intel.com>
> 
> Move standard DMA interface for sgdma and msgdma and rename them
> from tse_private to dma_private.
> 
> Signed-off-by: Nagaraju DeepakX <deepakx.nagaraju@intel.com>
> Reviewed-by: Andy Schevchenko <andriy.schevchenko@linux.intel.com>

...

> diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c

...

> @@ -252,42 +256,42 @@ static void tse_free_tx_buffer(struct altera_tse_private *priv,
> 
>  static int alloc_init_skbufs(struct altera_tse_private *priv)
>  {
> -	unsigned int rx_descs = priv->rx_ring_size;
> -	unsigned int tx_descs = priv->tx_ring_size;
> +	struct altera_dma_private *dma = &priv->dma_priv;
> +	unsigned int rx_descs = dma->rx_ring_size;
> +	unsigned int tx_descs = dma->tx_ring_size;
>  	int ret = -ENOMEM;
>  	int i;
> 
>  	/* Create Rx ring buffer */
> -	priv->rx_ring = kcalloc(rx_descs, sizeof(struct tse_buffer), GFP_KERNEL);
> -	if (!priv->rx_ring)
> +	dma->rx_ring = kcalloc(rx_descs, sizeof(struct altera_dma_private), GFP_KERNEL);

Hi Nagaraju,

Sorry, I didn't notice this until after I sent my previous review
to this patch.

Is struct altera_dma_private correct on the line above?
It seems to me that it should, rather, be struct altera_dma_buffer.
Likewise a few lines below.

Flagged by Smatch.

> +	if (!dma->rx_ring)
>  		goto err_rx_ring;
> 
>  	/* Create Tx ring buffer */
> -	priv->tx_ring = kcalloc(tx_descs, sizeof(struct tse_buffer), GFP_KERNEL);
> -	if (!priv->tx_ring)
> +	dma->tx_ring = kcalloc(tx_descs, sizeof(struct altera_dma_private), GFP_KERNEL);
> +	if (!dma->tx_ring)
>  		goto err_tx_ring;

> 
> -	priv->tx_cons = 0;
> -	priv->tx_prod = 0;
> +	dma->tx_cons = 0;
> +	dma->tx_prod = 0;
> 
>  	/* Init Rx ring */
>  	for (i = 0; i < rx_descs; i++) {
> -		ret = tse_init_rx_buffer(priv, &priv->rx_ring[i],
> -					 priv->rx_dma_buf_sz);
> +		ret = tse_init_rx_buffer(priv, &priv->dma_priv.rx_ring[i], dma->rx_dma_buf_sz);
>  		if (ret)
>  			goto err_init_rx_buffers;
>  	}
> 
> -	priv->rx_cons = 0;
> -	priv->rx_prod = 0;
> +	dma->rx_cons = 0;
> +	dma->rx_prod = 0;
> 
>  	return 0;
>  err_init_rx_buffers:
>  	while (--i >= 0)
> -		tse_free_rx_buffer(priv, &priv->rx_ring[i]);
> -	kfree(priv->tx_ring);
> +		tse_free_rx_buffer(priv, &priv->dma_priv.rx_ring[i]);
> +	kfree(dma->tx_ring);
>  err_tx_ring:
> -	kfree(priv->rx_ring);
> +	kfree(dma->rx_ring);
>  err_rx_ring:
>  	return ret;
>  }

...

  parent reply	other threads:[~2023-12-23 15:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13  7:11 [PATCH 0/5] Rename functions and their prototypes and move to common files deepakx.nagaraju
2023-12-13  7:11 ` [PATCH 1/5] net: ethernet: altera: remove unneeded assignments deepakx.nagaraju
2023-12-16 20:03   ` Simon Horman
2023-12-13  7:11 ` [PATCH 2/5] net: ethernet: altera: fix indentation warnings deepakx.nagaraju
2023-12-13  7:11 ` [PATCH 3/5] net: ethernet: altera: move read write functions deepakx.nagaraju
2023-12-16 20:03   ` Simon Horman
2023-12-13  7:11 ` [PATCH 4/5] net: ethernet: altera: sorting headers in alphabetical order deepakx.nagaraju
2023-12-14 19:06   ` Jakub Kicinski
2023-12-13  7:11 ` [PATCH 5/5] net: ethernet: altera: rename functions and their prototypes deepakx.nagaraju
2023-12-21 13:40   ` [PATCH v2 0/4] Rename functions and their prototypes and move to common files deepakx.nagaraju
2023-12-21 13:40     ` [PATCH v2 1/4] net: ethernet: altera: remove unneeded assignments deepakx.nagaraju
2023-12-21 13:40     ` [PATCH v2 2/4] net: ethernet: altera: fix indentation warnings deepakx.nagaraju
2023-12-23 14:57       ` Simon Horman
2023-12-21 13:40     ` [PATCH v2 3/4] net: ethernet: altera: move read write functions deepakx.nagaraju
2023-12-21 13:40     ` [PATCH v2 4/4] net: ethernet: altera: rename functions and their prototypes deepakx.nagaraju
2023-12-23 14:54       ` Simon Horman
2023-12-23 15:06       ` Simon Horman [this message]
2024-01-03 11:23   ` [PATCH 5/5] " Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231223150642.GE201037@kernel.org \
    --to=horms@kernel.org \
    --cc=andriy.schevchenko@linux.intel.com \
    --cc=deepakx.nagaraju@intel.com \
    --cc=edumazet@google.com \
    --cc=jdavem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mun.yew.tham@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.