RE: [PATCH 1/2] iio: pressure: mpl3115: do not rely on structure field ordering

2017-02-01 Thread Ken.Lin
e; Sanchayan Maity; Ken.Lin; > linux- > i...@vger.kernel.org > Subject: Re: [PATCH 1/2] iio: pressure: mpl3115: do not rely on structure > field > ordering > > On 2017-02-01 10:57, Peter Meerwald-Stadler wrote: > >>> - .info_mask_separate =

Re: [PATCH 1/2] iio: pressure: mpl3115: do not rely on structure field ordering

2017-02-01 Thread Jonathan Cameron
Ouch. I should have actually read that driver! Will probably pick up this evening. On 1 February 2017 08:09:26 GMT+00:00, Peter Rosin wrote: >Fixes a regression triggered by a change in the layout of >struct iio_chan_spec, but the real bug is in the driver which assumed >a specific structure lay

Re: [PATCH 1/2] iio: pressure: mpl3115: do not rely on structure field ordering

2017-02-01 Thread Peter Rosin
On 2017-02-01 10:57, Peter Meerwald-Stadler wrote: >>> - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), >>> BIT(IIO_CHAN_INFO_SCALE), >>> + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | >>> BIT(IIO_CHAN_INFO_SCALE), >>> as originally inten

Re: [PATCH 1/2] iio: pressure: mpl3115: do not rely on structure field ordering

2017-02-01 Thread Peter Meerwald-Stadler
> > - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), > > BIT(IIO_CHAN_INFO_SCALE), > > + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | > > BIT(IIO_CHAN_INFO_SCALE), > > as originally intended > > I considered that option, but the code in

Re: [PATCH 1/2] iio: pressure: mpl3115: do not rely on structure field ordering

2017-02-01 Thread Peter Rosin
On 2017-02-01 10:31, Peter Meerwald-Stadler wrote: > Fixes a regression triggered by a change in the layout of struct iio_chan_spec, but the real bug is in the driver which assumed a specific structure layout in the first place. > >>> what do you mean by 'driver which assumed a spe

Re: [PATCH 1/2] iio: pressure: mpl3115: do not rely on structure field ordering

2017-02-01 Thread Peter Meerwald-Stadler
> >> Fixes a regression triggered by a change in the layout of > >> struct iio_chan_spec, but the real bug is in the driver which assumed > >> a specific structure layout in the first place. > > what do you mean by 'driver which assumed a specific structure'? > > Look again, the two bits are not

Re: [PATCH 1/2] iio: pressure: mpl3115: do not rely on structure field ordering

2017-02-01 Thread Peter Rosin
On 2017-02-01 10:10, Peter Meerwald-Stadler wrote: > Hello, > >> Fixes a regression triggered by a change in the layout of >> struct iio_chan_spec, but the real bug is in the driver which assumed >> a specific structure layout in the first place. > > I don't think that this is a proper fix > > m

Re: [PATCH 1/2] iio: pressure: mpl3115: do not rely on structure field ordering

2017-02-01 Thread Peter Meerwald-Stadler
Hello, > Fixes a regression triggered by a change in the layout of > struct iio_chan_spec, but the real bug is in the driver which assumed > a specific structure layout in the first place. I don't think that this is a proper fix maybe the driver is unique in that it uses mask_separate for INFO_S

[PATCH 1/2] iio: pressure: mpl3115: do not rely on structure field ordering

2017-02-01 Thread Peter Rosin
Fixes a regression triggered by a change in the layout of struct iio_chan_spec, but the real bug is in the driver which assumed a specific structure layout in the first place. # cat /sys/bus/iio/devices/iio\:device1/in_pressure_scale_available Segmentation fault Unable to handle kernel NULL point