mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: Shuvam Pandey <shuvampandey1@gmail.com>,
	Jonathan Cameron <jic23@kernel.org>
Cc: "Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: nxp-sar-adc: zero-initialize dma_slave_config
Date: Mon, 6 Apr 2026 08:59:34 -0500	[thread overview]
Message-ID: <3c24723f-801c-46a5-9257-910f3c181235@baylibre.com> (raw)
In-Reply-To: <20260406095324.99671-1-shuvampandey1@gmail.com>

On 4/6/26 4:53 AM, Shuvam Pandey wrote:
> nxp_sar_adc_start_cyclic_dma() only fills the RX-side members of
> dma_slave_config before passing it to dmaengine_slave_config().
> 
> Zero-initialize the structure so unused members do not contain stack
> garbage. Some DMA engines consult optional dma_slave_config fields, so
> leaving them uninitialized can cause DMA setup failures.
> 
> Fixes: 4434072a893e ("iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms")
> Signed-off-by: Shuvam Pandey <shuvampandey1@gmail.com>
> ---
>  drivers/iio/adc/nxp-sar-adc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/nxp-sar-adc.c b/drivers/iio/adc/nxp-sar-adc.c
> index 9efa883c277d..7d7b5a580167 100644
> --- a/drivers/iio/adc/nxp-sar-adc.c
> +++ b/drivers/iio/adc/nxp-sar-adc.c
> @@ -659,7 +659,7 @@ static void nxp_sar_adc_dma_cb(void *data)
>  static int nxp_sar_adc_start_cyclic_dma(struct iio_dev *indio_dev)
>  {
>  	struct nxp_sar_adc *info = iio_priv(indio_dev);
> -	struct dma_slave_config config;
> +	struct dma_slave_config config = {};

IIO style is to have space between braces.

Wait and see if Jonathan asks for a new version first though
before sending one for trivial changes like that.

>  	struct dma_async_tx_descriptor *desc;
>  	int ret;
>  

Reviewed-by: David Lechner <dlechner@baylibre.com>


  reply	other threads:[~2026-04-06 13:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-06  9:53 Shuvam Pandey
2026-04-06 13:59 ` David Lechner [this message]
2026-04-20 18:07   ` Jonathan Cameron

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=3c24723f-801c-46a5-9257-910f3c181235@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=andy@kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=shuvampandey1@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®