DMA Engine development
 help / color / mirror / Atom feed
From: Basavaraj Natikar <bnatikar@amd.com>
To: Eder Zulian <ezulian@redhat.com>,
	nathan.lynch@amd.com, Basavaraj.Natikar@amd.com,
	vkoul@kernel.org, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] dmaengine: ptdma: Remove unused pointer dma_cmd_cache
Date: Thu, 17 Apr 2025 13:05:10 +0530	[thread overview]
Message-ID: <2b81a054-b716-44e8-b2ea-5012a4536629@amd.com> (raw)
In-Reply-To: <20250415121312.870124-1-ezulian@redhat.com>


On 4/15/2025 5:43 PM, Eder Zulian wrote:
> The pointer 'struct kmem_cache *dma_cmd_cache' was introduced in commit
> 'b0b4a6b10577 ("dmaengine: ptdma: register PTDMA controller as a DMA
> resource")' but it was never used.
>
> Changes since v1:
> - Remove the 'err_cache' label and return -ENOMEM directly instead of
>    assigning -ENOMEM to 'ret' and jumping to the label, since there
>    are no unmanaged allocations to unwind. Based on suggestion from
>    Nathan Lynch.
> - Fix checkpatch.pl error: ERROR: Please use git commit description style
>    'commit <12+ chars of sha1> ("<title line>")'
>
> Signed-off-by: Eder Zulian <ezulian@redhat.com>
> ---
> V1 -> V2: Addressed review comments and fix error detected by
> checkpatch.pl.
>
>   drivers/dma/amd/ptdma/ptdma-dmaengine.c | 16 ++++------------
>   drivers/dma/amd/ptdma/ptdma.h           |  1 -
>   2 files changed, 4 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/dma/amd/ptdma/ptdma-dmaengine.c b/drivers/dma/amd/ptdma/ptdma-dmaengine.c
> index 3a8014fb9cb4..aefb91c29bb5 100644
> --- a/drivers/dma/amd/ptdma/ptdma-dmaengine.c
> +++ b/drivers/dma/amd/ptdma/ptdma-dmaengine.c
> @@ -583,18 +583,14 @@ int pt_dmaengine_register(struct pt_device *pt)
>   	desc_cache_name = devm_kasprintf(pt->dev, GFP_KERNEL,
>   					 "%s-dmaengine-desc-cache",
>   					 dev_name(pt->dev));
> -	if (!desc_cache_name) {
> -		ret = -ENOMEM;
> -		goto err_cache;
> -	}
> +	if (!desc_cache_name)
> +		return -ENOMEM;
>   
>   	pt->dma_desc_cache = kmem_cache_create(desc_cache_name,
>   					       sizeof(struct pt_dma_desc), 0,
>   					       SLAB_HWCACHE_ALIGN, NULL);
> -	if (!pt->dma_desc_cache) {
> -		ret = -ENOMEM;
> -		goto err_cache;
> -	}
> +	if (!pt->dma_desc_cache)
> +		return -ENOMEM;
>   
>   	dma_dev->dev = pt->dev;
>   	dma_dev->src_addr_widths = DMA_SLAVE_BUSWIDTH_64_BYTES;
> @@ -648,9 +644,6 @@ int pt_dmaengine_register(struct pt_device *pt)
>   err_reg:
>   	kmem_cache_destroy(pt->dma_desc_cache);
>   
> -err_cache:
> -	kmem_cache_destroy(pt->dma_cmd_cache);
> -
>   	return ret;
>   }
>   EXPORT_SYMBOL_GPL(pt_dmaengine_register);
> @@ -662,5 +655,4 @@ void pt_dmaengine_unregister(struct pt_device *pt)
>   	dma_async_device_unregister(dma_dev);
>   
>   	kmem_cache_destroy(pt->dma_desc_cache);
> -	kmem_cache_destroy(pt->dma_cmd_cache);
>   }
> diff --git a/drivers/dma/amd/ptdma/ptdma.h b/drivers/dma/amd/ptdma/ptdma.h
> index 0a7939105e51..ef3f55632107 100644
> --- a/drivers/dma/amd/ptdma/ptdma.h
> +++ b/drivers/dma/amd/ptdma/ptdma.h
> @@ -254,7 +254,6 @@ struct pt_device {
>   	/* Support for the DMA Engine capabilities */
>   	struct dma_device dma_dev;
>   	struct pt_dma_chan *pt_dma_chan;
> -	struct kmem_cache *dma_cmd_cache;
>   	struct kmem_cache *dma_desc_cache;
>   
>   	wait_queue_head_t lsb_queue;

Looks good to me.

Acked-by: Basavaraj Natikar<Basavaraj.Natikar@amd.com>

Thanks,
--
Basavaraj


  parent reply	other threads:[~2025-04-17  7:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15 12:13 [PATCH v2] dmaengine: ptdma: Remove unused pointer dma_cmd_cache Eder Zulian
2025-04-16 14:56 ` Nathan Lynch
2025-04-17  7:35 ` Basavaraj Natikar [this message]
2025-04-17 15:18 ` Vinod Koul

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=2b81a054-b716-44e8-b2ea-5012a4536629@amd.com \
    --to=bnatikar@amd.com \
    --cc=Basavaraj.Natikar@amd.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=ezulian@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan.lynch@amd.com \
    --cc=vkoul@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox