From: sashiko-bot@kernel.org
To: Frank.Li@oss.nxp.com
Cc: imx@lists.linux.dev, Frank.Li@kernel.org,
dmaengine@vger.kernel.org, vkoul@kernel.org
Subject: Re: [PATCH 1/2] dmaengine: add dmaengine_prep_slave_sg_context() to wrap prep_slave_sg
Date: Thu, 17 Sep 2026 20:15:44 +0000 [thread overview]
Message-ID: <20260917201545.32F4D1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260917-b4-dmaengine-prep-slave-sg-v1-1-239c12864143@nxp.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] dmaengine: missing NULL pointer checks in dmaengine_prep_slave_sg_context()
- [Low] dmaengine: missing __deprecated attribute on dmaengine_prep_slave_sg_context()
- [Low] dmaengine: typo 'Depercated' in API comment
--
commit 624ba4c53934aaa9d35d6692c60ed829474f761a
Author: Frank Li <Frank.Li@nxp.com>
dmaengine: add dmaengine_prep_slave_sg_context() to wrap prep_slave_sg
This adds a wrapper function for dmaengine_prep_slave_sg_context() to allow
certain consumers and providers to use the context argument without accessing
the DMA engine callback pointer directly. It also prepares to make the DMA
engine provider internals private, and marks the new wrapper as deprecated.
> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index c3a49a33307c6..b4589cad6d742 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -1084,6 +1084,19 @@ dmaengine_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
> return dmaengine_prep_config_sg(chan, sgl, sg_len, dir, flags, NULL);
> }
>
> +/* Depercated, don't use it except sound/soc/sprd/ */
[Severity: Low]
This isn't a bug, but there's a typo in the comment: "Depercated" instead of
"Deprecated".
> +static inline struct dma_async_tx_descriptor *
[Severity: Low]
Since the comment and commit message note this function is deprecated, should
it be marked with the __deprecated compiler attribute so that any new usages
trigger a compile-time warning?
> +dmaengine_prep_slave_sg_context(struct dma_chan *chan, struct scatterlist *sgl,
> + unsigned int sg_len, enum dma_transfer_direction dir,
> + unsigned long flags, void *context)
> +{
> + if (!chan->device->device_prep_slave_sg)
[Severity: Medium]
Does this expose callers to a NULL pointer dereference if an uninitialized
or invalid channel is passed?
Other public wrappers in the DMA engine API, such as dmaengine_prep_config_sg(),
explicitly check if (!chan || !chan->device) before accessing the device
pointer.
Should this function include the same safeguard?
> + return NULL;
> +
> + return chan->device->device_prep_slave_sg(chan, sgl, sg_len, dir,
> + flags, context);
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260917-b4-dmaengine-prep-slave-sg-v1-0-239c12864143@nxp.com?part=1
next prev parent reply other threads:[~2026-09-17 20:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 20:08 [PATCH 0/2] dmaengine: add dmaengine_prep_slave_sg_context() API Frank.Li
2026-09-17 20:08 ` [PATCH 1/2] dmaengine: add dmaengine_prep_slave_sg_context() to wrap prep_slave_sg Frank.Li
2026-09-17 20:15 ` sashiko-bot [this message]
2026-09-17 20:08 ` [PATCH 2/2] ASoC: sprd: replace direct ->device_prep*() calls with standard DMA engine API Frank.Li
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=20260917201545.32F4D1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=Frank.Li@oss.nxp.com \
--cc=dmaengine@vger.kernel.org \
--cc=imx@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--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