All of lore.kernel.org
 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 12/20] regulator: cros-ec: use devm_kmemdup_array()
Date: Mon, 3 Feb 2025 13:23:11 +0200	[thread overview]
Message-ID: <Z6CnH8nDLPlgAlmW@smile.fi.intel.com> (raw)
In-Reply-To: <Z6CdF2OQQcP76_bi@black.fi.intel.com>

On Mon, Feb 03, 2025 at 12:40:23PM +0200, Raag Jadav wrote:
> On Mon, Feb 03, 2025 at 11:51:10AM +0200, Andy Shevchenko wrote:
> > On Mon, Feb 03, 2025 at 01:38:54PM +0530, Raag Jadav wrote:
> > > Convert to use devm_kmemdup_array() which is more robust.

...

> > >  	data->voltages_mV =
> > > -		devm_kmemdup(dev, resp.voltages_mv,
> > > -			     sizeof(u16) * data->num_voltages, GFP_KERNEL);
> > > +		devm_kmemdup_array(dev, resp.voltages_mv, data->num_voltages,
> > > +				   sizeof(u16), GFP_KERNEL);
> > 
> > Wondering if this can be sizeof(*data->voltages_mV) that makes code robust
> > against type changes.
> 
> True, but I opted for a blind treewide conversion that is consistent with
> existing driver conventions. Perhaps a better place for it is a separate
> filewide series?

I think an additional series is just an increased churn. In this you are
changing an API in use, it's completely fine to update a parameter in
accordance with new API. I.o.w. I consider these two are coupled enough
to be semantically and logically in a single change along with the fact
that in all such case you are touching the same line(s).

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-02-03 11:23 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 [this message]
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
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=Z6CnH8nDLPlgAlmW@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.