* [PATCH] iio: iio_format_list() should set stride=1 for IIO_VAL_CHAR
@ 2025-08-12 11:12 Ben Collins
2025-08-12 14:14 ` David Lechner
2025-08-12 20:44 ` Andy Shevchenko
0 siblings, 2 replies; 5+ messages in thread
From: Ben Collins @ 2025-08-12 11:12 UTC (permalink / raw)
To: linux-iio
Cc: linux-kernel, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko
[-- Attachment #1: Type: text/plain, Size: 1192 bytes --]
iio_format_list() sets a stride across the val array of 1 for INT
type, and 2 for all others. Add IIO_VAL_CHAR so it also gets a
stride of 1 assuming val is an array of integers with char type
values.
No drivers currently use this, but I found this issue adding an
avail callback for IIO_INFO_THERMOCOUPLE_TYPE for a driver I'm
working on.
Signed-off-by: Ben Collins <bcollins@kernel.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: David Lechner <dlechner@baylibre.com>
Cc: Nuno Sá <nuno.sa@analog.com>
Cc: Andy Shevchenko <andy@kernel.org>
---
drivers/iio/industrialio-core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 159d6c5ca3cec..eb6a54f8115de 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -790,6 +790,7 @@ static ssize_t iio_format_list(char *buf, const int *vals, int type, int length,
switch (type) {
case IIO_VAL_INT:
+ case IIO_VAL_CHAR:
stride = 1;
break;
default:
--
2.50.1
--
Ben Collins
https://libjwt.io
https://github.com/benmcollins
--
3EC9 7598 1672 961A 1139 173A 5D5A 57C7 242B 22CF
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: iio_format_list() should set stride=1 for IIO_VAL_CHAR
2025-08-12 11:12 [PATCH] iio: iio_format_list() should set stride=1 for IIO_VAL_CHAR Ben Collins
@ 2025-08-12 14:14 ` David Lechner
2025-08-12 20:44 ` Andy Shevchenko
1 sibling, 0 replies; 5+ messages in thread
From: David Lechner @ 2025-08-12 14:14 UTC (permalink / raw)
To: linux-iio, linux-kernel, Jonathan Cameron, Nuno Sá,
Andy Shevchenko
On 8/12/25 6:12 AM, Ben Collins wrote:
> iio_format_list() sets a stride across the val array of 1 for INT
> type, and 2 for all others. Add IIO_VAL_CHAR so it also gets a
> stride of 1 assuming val is an array of integers with char type
> values.
>
> No drivers currently use this, but I found this issue adding an
> avail callback for IIO_INFO_THERMOCOUPLE_TYPE for a driver I'm
> working on.
>
> Signed-off-by: Ben Collins <bcollins@kernel.org>
> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: David Lechner <dlechner@baylibre.com>
> Cc: Nuno Sá <nuno.sa@analog.com>
> Cc: Andy Shevchenko <andy@kernel.org>
>
> ---
> drivers/iio/industrialio-core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index 159d6c5ca3cec..eb6a54f8115de 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -790,6 +790,7 @@ static ssize_t iio_format_list(char *buf, const int *vals, int type, int length,
>
> switch (type) {
> case IIO_VAL_INT:
> + case IIO_VAL_CHAR:
> stride = 1;
> break;
> default:
Reviewed-by: David Lechner <dlechner@baylibre.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: iio_format_list() should set stride=1 for IIO_VAL_CHAR
2025-08-12 11:12 [PATCH] iio: iio_format_list() should set stride=1 for IIO_VAL_CHAR Ben Collins
2025-08-12 14:14 ` David Lechner
@ 2025-08-12 20:44 ` Andy Shevchenko
2025-08-13 13:15 ` Andy Shevchenko
1 sibling, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2025-08-12 20:44 UTC (permalink / raw)
To: linux-iio, linux-kernel, Jonathan Cameron, David Lechner,
Nuno Sá, Andy Shevchenko
On Tue, Aug 12, 2025 at 1:13 PM Ben Collins <bcollins@kernel.org> wrote:
>
> iio_format_list() sets a stride across the val array of 1 for INT
> type, and 2 for all others. Add IIO_VAL_CHAR so it also gets a
> stride of 1 assuming val is an array of integers with char type
> values.
>
> No drivers currently use this, but I found this issue adding an
> avail callback for IIO_INFO_THERMOCOUPLE_TYPE for a driver I'm
> working on.
>
> Signed-off-by: Ben Collins <bcollins@kernel.org>
Please, keep the Cc list after the '---' line (note, you may have more
than a single one in the patch, hence you may just add it here). This
will reduce the unneeded noise in the commit message as the very same
information will be available in the email headers and in lore
archive.
> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: David Lechner <dlechner@baylibre.com>
> Cc: Nuno Sá <nuno.sa@analog.com>
> Cc: Andy Shevchenko <andy@kernel.org>
>
> ---
> drivers/iio/industrialio-core.c | 1 +
> 1 file changed, 1 insertion(+)
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: iio_format_list() should set stride=1 for IIO_VAL_CHAR
2025-08-12 20:44 ` Andy Shevchenko
@ 2025-08-13 13:15 ` Andy Shevchenko
2025-08-16 13:25 ` Jonathan Cameron
0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2025-08-13 13:15 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-iio, linux-kernel, Jonathan Cameron, David Lechner,
Nuno Sá, Andy Shevchenko
On Tue, Aug 12, 2025 at 10:44:13PM +0200, Andy Shevchenko wrote:
> On Tue, Aug 12, 2025 at 1:13 PM Ben Collins <bcollins@kernel.org> wrote:
...
> > Signed-off-by: Ben Collins <bcollins@kernel.org>
>
> Please, keep the Cc list after the '---' line (note, you may have more
> than a single one in the patch, hence you may just add it here). This
> will reduce the unneeded noise in the commit message as the very same
> information will be available in the email headers and in lore
> archive.
>
> > Cc: Jonathan Cameron <jic23@kernel.org>
> > Cc: David Lechner <dlechner@baylibre.com>
> > Cc: Nuno Sá <nuno.sa@analog.com>
> > Cc: Andy Shevchenko <andy@kernel.org>
> >
> > ---
> > drivers/iio/industrialio-core.c | 1 +
> > 1 file changed, 1 insertion(+)
Forgot to add that no need to resend just for _this_ case, take the above
advice for the future contributions. I hope Jonathan may remove these Cc from
the commit message.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: iio_format_list() should set stride=1 for IIO_VAL_CHAR
2025-08-13 13:15 ` Andy Shevchenko
@ 2025-08-16 13:25 ` Jonathan Cameron
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2025-08-16 13:25 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Andy Shevchenko, linux-iio, linux-kernel, David Lechner,
Nuno Sá, Andy Shevchenko
On Wed, 13 Aug 2025 16:15:16 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Tue, Aug 12, 2025 at 10:44:13PM +0200, Andy Shevchenko wrote:
> > On Tue, Aug 12, 2025 at 1:13 PM Ben Collins <bcollins@kernel.org> wrote:
>
> ...
>
> > > Signed-off-by: Ben Collins <bcollins@kernel.org>
> >
> > Please, keep the Cc list after the '---' line (note, you may have more
> > than a single one in the patch, hence you may just add it here). This
> > will reduce the unneeded noise in the commit message as the very same
> > information will be available in the email headers and in lore
> > archive.
> >
> > > Cc: Jonathan Cameron <jic23@kernel.org>
> > > Cc: David Lechner <dlechner@baylibre.com>
> > > Cc: Nuno Sá <nuno.sa@analog.com>
> > > Cc: Andy Shevchenko <andy@kernel.org>
> > >
> > > ---
> > > drivers/iio/industrialio-core.c | 1 +
> > > 1 file changed, 1 insertion(+)
>
> Forgot to add that no need to resend just for _this_ case, take the above
> advice for the future contributions. I hope Jonathan may remove these Cc from
> the commit message.
>
Tweaked that and applied.
Thanks,
Jonathan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-08-16 13:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-12 11:12 [PATCH] iio: iio_format_list() should set stride=1 for IIO_VAL_CHAR Ben Collins
2025-08-12 14:14 ` David Lechner
2025-08-12 20:44 ` Andy Shevchenko
2025-08-13 13:15 ` Andy Shevchenko
2025-08-16 13:25 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).