linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Raag Jadav <raag.jadav@intel.com>
Cc: gregkh@linuxfoundation.org, rafael@kernel.org,
	linus.walleij@linaro.org, mika.westerberg@linux.intel.com,
	dmitry.torokhov@gmail.com, lgirdwood@gmail.com,
	broonie@kernel.org, sre@kernel.org, jic23@kernel.org,
	przemyslaw.kitszel@intel.com, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	linux-sound@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH v3 14/20] iio: adc: xilinx-xadc-core: use devm_kmemdup_array()
Date: Mon, 3 Feb 2025 11:54:42 +0200	[thread overview]
Message-ID: <Z6CSYn7ZDVNELIIv@smile.fi.intel.com> (raw)
In-Reply-To: <20250203080902.1864382-15-raag.jadav@intel.com>

On Mon, Feb 03, 2025 at 01:38:56PM +0530, Raag Jadav wrote:
> Convert to use devm_kmemdup_array() which is more robust.

...

> -	channels = devm_kmemdup(dev, channel_templates,
> -				sizeof(channels[0]) * max_channels, GFP_KERNEL);
> +	channels = devm_kmemdup_array(dev, channel_templates, max_channels,
> +				      sizeof(channels[0]), GFP_KERNEL);

I would use more regular sizeof(*channels)

>  	if (!channels)
>  		return -ENOMEM;

P.S. For all sizeof() replacements the changes would probably need the updated
commit messages.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-02-03  9:54 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03  8:08 [PATCH v3 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Raag Jadav
2025-02-03  8:08 ` [PATCH v3 01/20] driver core: Split devres APIs to device/devres.h Raag Jadav
2025-02-05 16:27   ` kernel test robot
2025-02-06  6:13     ` Raag Jadav
2025-02-06 15:12       ` Andy Shevchenko
2025-02-06 15:14         ` Andy Shevchenko
2025-02-06 18:11           ` Raag Jadav
2025-02-06 18:56             ` Andy Shevchenko
2025-02-03  8:08 ` [PATCH v3 02/20] iio: imu: st_lsm9ds0: Replace device.h with what is needed Raag Jadav
2025-02-03 11:19   ` Jonathan Cameron
2025-02-03  8:08 ` [PATCH v3 03/20] devres: Introduce devm_kmemdup_array() Raag Jadav
2025-02-03  8:08 ` [PATCH v3 04/20] pinctrl: intel: copy communities using devm_kmemdup_array() Raag Jadav
2025-02-03  8:08 ` [PATCH v3 05/20] pinctrl: baytrail: " Raag Jadav
2025-02-06 18:45   ` Linus Walleij
2025-02-03  8:08 ` [PATCH v3 06/20] pinctrl: cherryview: use devm_kmemdup_array() Raag Jadav
2025-02-06 18:46   ` Linus Walleij
2025-02-03  8:08 ` [PATCH v3 07/20] pinctrl: tangier: " Raag Jadav
2025-02-03  8:08 ` [PATCH v3 08/20] pinctrl: pxa2xx: " Raag Jadav
2025-02-03  8:08 ` [PATCH v3 09/20] input: sparse-keymap: " Raag Jadav
2025-02-03  8:08 ` [PATCH v3 10/20] input: ipaq-micro-keys: " Raag Jadav
2025-02-06 18:46   ` Linus Walleij
2025-02-03  8:08 ` [PATCH v3 11/20] regulator: devres: " Raag Jadav
2025-02-03  8:08 ` [PATCH v3 12/20] regulator: cros-ec: " Raag Jadav
2025-02-03  9:51   ` Andy Shevchenko
2025-02-03 10:40     ` Raag Jadav
2025-02-03 11:23       ` Andy Shevchenko
2025-02-03  8:08 ` [PATCH v3 13/20] power: supply: sc27xx: " Raag Jadav
2025-02-03  8:08 ` [PATCH v3 14/20] iio: adc: xilinx-xadc-core: " Raag Jadav
2025-02-03  9:54   ` Andy Shevchenko [this message]
2025-02-03 10:42     ` Raag Jadav
2025-02-03 11:14       ` Jonathan Cameron
2025-02-03 11:25         ` Andy Shevchenko
2025-02-03 11:24       ` Andy Shevchenko
2025-02-03  8:08 ` [PATCH v3 15/20] ASoC: Intel: avs: " Raag Jadav
2025-02-03  8:08 ` [PATCH v3 16/20] ASoC: hdac_hdmi: " Raag Jadav
2025-02-03  9:52   ` Andy Shevchenko
2025-02-03  8:08 ` [PATCH v3 17/20] ASoC: tlv320dac33: " Raag Jadav
2025-02-03  9:52   ` Andy Shevchenko
2025-02-03  8:09 ` [PATCH v3 18/20] ASoC: uda1380: " Raag Jadav
2025-02-03  9:57   ` Andy Shevchenko
2025-02-03  8:09 ` [PATCH v3 19/20] ASoC: meson: axg-tdm-interface: " Raag Jadav
2025-02-03  8:09 ` [PATCH v3 20/20] ASoC: uniphier: " Raag Jadav
2025-02-03  9:53   ` Andy Shevchenko
2025-02-03  9:48 ` [PATCH v3 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array() Andy Shevchenko
2025-02-03 10:34   ` Raag Jadav
2025-02-03 11:29     ` Andy Shevchenko

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=Z6CSYn7ZDVNELIIv@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=rafael@kernel.org \
    --cc=sre@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).