From: Dave Jiang <dave.jiang@intel.com>
To: Frank Li <Frank.li@nxp.com>
Cc: Vinod Koul <vkoul@kernel.org>,
Dong Aisheng <aisheng.dong@nxp.com>,
Andi Shyti <andi.shyti@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-i2c@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org, carlos.song@nxp.com
Subject: Re: [PATCH v2 1/2] dmaengine: Add cleanup FREE defines for dma_async_tx_descriptor
Date: Thu, 4 Dec 2025 08:07:53 -0700 [thread overview]
Message-ID: <77ff15d7-cdb9-46f7-9f05-97aff2dc8ee9@intel.com> (raw)
In-Reply-To: <aTDkODHZg0JfrZJC@lizhi-Precision-Tower-5810>
On 12/3/25 6:30 PM, Frank Li wrote:
> On Wed, Dec 03, 2025 at 03:48:41PM -0700, Dave Jiang wrote:
>>
>>
>> On 10/3/25 9:26 AM, Frank Li wrote:
>>> Add cleanup FREE defines for dma_async_tx_descriptor to support automatic
>>> cleanup and simplify error handling.
>>>
>>> Signed-off-by: Frank Li <Frank.Li@nxp.com>
>>> ---
>>> Check patch report exceed 100 chars, but it's still better put into one
>>> line to keep consistent with other DEFINE_FREE and better readablity
>>>
>>> change in v2
>>> - remove surpoiouse remove empty line
>>> ---
>>> include/linux/dmaengine.h | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
>>> index 99efe2b9b4ea9844ca6161208362ef18ef111d96..27fa1646a807c49c781e1bce9e3e7d9a3c66f41d 100644
>>> --- a/include/linux/dmaengine.h
>>> +++ b/include/linux/dmaengine.h
>>> @@ -5,6 +5,7 @@
>>> #ifndef LINUX_DMAENGINE_H
>>> #define LINUX_DMAENGINE_H
>>>
>>> +#include <linux/cleanup.h>
>>> #include <linux/device.h>
>>> #include <linux/err.h>
>>> #include <linux/uio.h>
>>> @@ -1612,6 +1613,8 @@ static inline int dmaengine_desc_free(struct dma_async_tx_descriptor *desc)
>>> return desc->desc_free(desc);
>>> }
>>>
>>> +DEFINE_FREE(dma_async_tx_descriptor, struct dma_async_tx_descriptor *, if (_T) dmaengine_desc_free(_T))
>>
>> maybe free_dma_async_tx may be clearer as the name vs dma_async_tx_descriptor.
>
> If that, 'dmaengine_desc_free' is better because avoid create new name for
> it.
That works too.
>
> Frank
>>
>> DJ
>>
>>> +
>>> /* --- DMA device --- */
>>>
>>> int dma_async_device_register(struct dma_device *device);
>>>
>>
>
next prev parent reply other threads:[~2025-12-04 15:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-03 16:26 [PATCH v2 0/2] dmaengine: Add cleanup to simple code Frank Li
2025-10-03 16:26 ` [PATCH v2 1/2] dmaengine: Add cleanup FREE defines for dma_async_tx_descriptor Frank Li
2025-12-03 22:19 ` Frank Li
2025-12-03 22:48 ` Dave Jiang
2025-12-04 1:30 ` Frank Li
2025-12-04 15:07 ` Dave Jiang [this message]
2025-12-16 15:01 ` Vinod Koul
2025-10-03 16:26 ` [PATCH v2 2/2] i2c: lpi2c: Use cleanup helper for dma_async_tx_descriptor error handling Frank Li
2025-12-03 22:52 ` Dave Jiang
2025-12-04 1:27 ` Frank Li
2025-12-04 15:09 ` Dave Jiang
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=77ff15d7-cdb9-46f7-9f05-97aff2dc8ee9@intel.com \
--to=dave.jiang@intel.com \
--cc=Frank.li@nxp.com \
--cc=aisheng.dong@nxp.com \
--cc=andi.shyti@kernel.org \
--cc=carlos.song@nxp.com \
--cc=dmaengine@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).