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: <20250518171334.6deb684b@jic23-huawei>
Date: Sun, 18 May 2025 17:13:34 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: David Lechner <dlechner@...libre.com>
Cc: Pop Ioan Daniel <pop.ioan-daniel@...log.com>, Lars-Peter Clausen
 <lars@...afoo.de>, Michael Hennerich <Michael.Hennerich@...log.com>, Nuno
 Sá <nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>,
 Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
 Conor Dooley <conor+dt@...nel.org>, Sergiu Cuciurean
 <sergiu.cuciurean@...log.com>, Dragos Bogdan <dragos.bogdan@...log.com>,
 Antoniu Miclaus <antoniu.miclaus@...log.com>, Olivier Moysan
 <olivier.moysan@...s.st.com>, Javier Carrasco
 <javier.carrasco.cruz@...il.com>, Matti Vaittinen
 <mazziesaccount@...il.com>, Tobias Sperling <tobias.sperling@...ting.com>,
 Marcelo Schmitt <marcelo.schmitt@...log.com>, Alisa-Dariana Roman
 <alisadariana@...il.com>, João Paulo Gonçalves <joao.goncalves@...adex.com>, Herve Codina
 <herve.codina@...tlin.com>, linux-iio@...r.kernel.org,
 devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/4] iio: backend: update
 iio_backend_oversampling_ratio_set

On Fri, 16 May 2025 10:06:18 -0500
David Lechner <dlechner@...libre.com> wrote:

> On 5/16/25 5:58 AM, Pop Ioan Daniel wrote:
> > In the function iio_backend_oversampling_ratio_set the chan parameter
> > was added. The function can be used in contexts where the channel
is added

(tense is wrong given this patch is doing it).  However it should be
in imperative.

"Add chan parameter to iio_backed_oversampling_ration_set() to allow
for contexts where the channel must be specified. Modify all
existing users."


> > must be specified. All affected files have been modified.
> > 
> > Signed-off-by: Pop Ioan Daniel <pop.ioan-daniel@...log.com>
> > ---
> > changes in v3:
> >  - fix ad4851_set_oversampling_ratio function channel error
> >  drivers/iio/adc/ad4851.c           | 6 +++---
> >  drivers/iio/adc/adi-axi-adc.c      | 3 ++-
> >  drivers/iio/industrialio-backend.c | 3 ++-
> >  include/linux/iio/backend.h        | 3 ++-
> >  4 files changed, 9 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/iio/adc/ad4851.c b/drivers/iio/adc/ad4851.c
> > index 98ebc853db79..fccfca256670 100644
> > --- a/drivers/iio/adc/ad4851.c
> > +++ b/drivers/iio/adc/ad4851.c
> > @@ -294,7 +294,7 @@ static int ad4851_scale_fill(struct iio_dev *indio_dev)
> >  }
> >  
> >  static int ad4851_set_oversampling_ratio(struct iio_dev *indio_dev,
> > -					 const struct iio_chan_spec *chan,
> > +					 unsigned int chan,  
> 
> I think passing the channel here is misleading since this is setting the
> oversampling ratio for all channels, not just the one specified.
> 
> I would suggest to make a separate patch that removes the unused
> const struct iio_chan_spec *chan parameter first.
> 
> >  					 unsigned int osr)
> >  {
> >  	struct ad4851_state *st = iio_priv(indio_dev);
> > @@ -321,7 +321,7 @@ static int ad4851_set_oversampling_ratio(struct iio_dev *indio_dev,
> >  			return ret;
> >  	}
> >  
> > -	ret = iio_backend_oversampling_ratio_set(st->back, osr);
> > +	ret = iio_backend_oversampling_ratio_set(st->back, chan, osr);  
> 
> 
> Then in this patch, just pass 0 here instead of chan with a comment that
> the channel is ignored by the backend being used here.

Is it implausible that such a backend could be written for this device?  If
so then I agree.

J
> 
> >  	if (ret)
> >  		return ret;
> >    
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ