lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z6CnH8nDLPlgAlmW@smile.fi.intel.com>
Date: Mon, 3 Feb 2025 13:23:11 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Raag Jadav <raag.jadav@...el.com>
Cc: gregkh@...uxfoundation.org, rafael@...nel.org, linus.walleij@...aro.org,
	mika.westerberg@...ux.intel.com, dmitry.torokhov@...il.com,
	lgirdwood@...il.com, broonie@...nel.org, sre@...nel.org,
	jic23@...nel.org, przemyslaw.kitszel@...el.com,
	linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-input@...r.kernel.org, linux-sound@...r.kernel.org,
	linux-pm@...r.kernel.org, linux-iio@...r.kernel.org
Subject: Re: [PATCH v3 12/20] regulator: cros-ec: use devm_kmemdup_array()

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



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ