Re: [PATCH v7 4/6] iio: ABI: Add support for floating-point numbers in buffer scan elements

From: Jonathan Cameron

Date: Sat Mar 07 2026 - 07:52:38 EST


On Fri, 6 Mar 2026 14:09:51 +0200
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:

> On Thu, Mar 05, 2026 at 08:37:48AM -0600, David Lechner wrote:
> > On 3/5/26 3:23 AM, Andy Shevchenko wrote:
> > > On Thu, Mar 5, 2026 at 11:09 AM Francesco Lavra <flavra@xxxxxxxxxxxx> wrote:
> > >> On Wed, 2026-03-04 at 16:45 -0600, David Lechner wrote:
> > >>> On 3/4/26 2:06 AM, Francesco Lavra wrote:
> > >>>> In the data storage description of a scan element, the first character
> > >>>> after the colon can have the values 's' and 'u' to specify signed and
> > >>>> unsigned integers, respectively.
> > >>>> Add 'f' as an allowed value to specify floating-point numbers formatted
> > >>>> according to the IEEE 754 standard.
>
> ...
>
> > >>>> - Format is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift] .
> > >>>> + Format is [be|le]:[f|s|u]bits/storagebits[Xrepeat][>>shift] .
> > >>>>
> > >>>> * *be* or *le*, specifies big or little endian.
> > >>>> + * *f*, specifies if floating-point.
> > >>>> * *s* or *u*, specifies if signed (2's complement) or unsigned.
> > >>>
> > >>> I would keep all of the format options on one bullet point.
> > >>
> > >> That's what I did initially, but Andy suggested doing differently [1].
> > >
> > > And still I think it's better to not mix them. The floating in the
> > > same sentence is confusing (along with 2's complement mention and
> > > sign).
> >
> > Then I would split up all 3. It is strange to mix some and not
> > all.
>
> I don't find it 'strange'. The integer are grouped together, floats do not
> belong to that group.
Maybe two paragaraphs in one bullet point?
* *f*, specifies if floating-point.
*s* or *u*, specifies if signed (2's complement) or unsigned.

Though then we'll definitely need to check it didn't break the formatting
in the docs generated from these files.

For me any of the above are fine.


>
> ...
>
> > >>>> -is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift], where:
> > >>>> +is [be|le]:[f|s|u]bits/storagebits[Xrepeat][>>shift], where:
> > >>>>
> > >>>> - **be** or **le** specifies big or little-endian.
> > >>>> +- **f** specifies if floating-point.
> > >>>> - **s** or **u** specifies if signed (2's complement) or unsigned.
> > >>>
> > >>> same here
> > >>
> > >> [1] https://lore.kernel.org/linux-iio/aZ7dCdLs5xcJ4UGW@xxxxxxxxxxxxxxxxxx/
> > >
> > > Same here.
>