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: <5ae09f8526a8847cb45435aa5280f905956ff588.camel@analog.com>
Date:   Sun, 22 Mar 2020 09:18:13 +0000
From:   "Ardelean, Alexandru" <alexandru.Ardelean@...log.com>
To:     "andriy.shevchenko@...ux.intel.com" 
        <andriy.shevchenko@...ux.intel.com>
CC:     "jic23@...nel.org" <jic23@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
        "lars@...afoo.de" <lars@...afoo.de>
Subject: Re: [PATCH v2 5/5] iio: adc: ad7793: use read_avail iio hook for
 scale available

On Sat, 2020-03-21 at 21:37 +0200, Andy Shevchenko wrote:
> [External]
> 
> On Sat, Mar 21, 2020 at 11:08:02AM +0200, Alexandru Ardelean wrote:
> > This change uses the read_avail and '.info_mask_shared_by_type_available'
> > modifier to set the available scale.
> > Essentially, nothing changes to the driver's ABI.
> > 
> > The main idea for this patch is to remove the AD7793 driver from
> > checkpatch's radar. There have been about ~3 attempts to fix/break the
> > 'in_voltage-voltage_scale_available' attribute, because checkpatch assumed
> > it to be an arithmetic operation and people were trying to change that.
> > +static int ad7793_read_avail(struct iio_dev *indio_dev,
> > +			     struct iio_chan_spec const *chan,
> > +			     const int **vals, int *type, int *length,
> > +			     long mask)
> >  {
> >  	struct ad7793_state *st = iio_priv(indio_dev);
> >  
> > +	switch (mask) {
> > +	case IIO_CHAN_INFO_SCALE:
> > +		*vals = (int *)st->scale_avail;
> > +		*type = IIO_VAL_INT_PLUS_NANO;
> > +		/* Values are stored in a 2D matrix  */
> > +		*length = ARRAY_SIZE(st->scale_avail) * 2;
> >  
> > +		return IIO_AVAIL_LIST;
> > +	}
> >  
> > +	return -EINVAL;
> 
> Wouldn't be better move this under default case?
> 

Ummm, sure.
I'm a bit vague how we do from here since Jonathan accepted this and the
patchset.
I'll send a V3 of the whole set [in a few days max].

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ