All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Liviu Stan" <liviu.stan@analog.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org
Subject: Re: [PATCH v2 5/7] iio: core: Add IIO_COVERAGE_PERCENT channel type
Date: Thu, 14 May 2026 20:16:52 +0000	[thread overview]
Message-ID: <20260514201652.EBCBAC2BCB7@smtp.kernel.org> (raw)
In-Reply-To: <20260514144712.64374-6-liviu.stan@analog.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] Embedding the measurement unit ('percent') directly into the IIO channel type name violates IIO UAPI design principles.
- [Medium] The new channel type `IIO_COVERAGE_PERCENT` was not added to the `event_is_known()` switch statement in `tools/iio/iio_event_monitor.c`, breaking the tool for this channel type.
- [Low] The new ABI documentation specifies an incorrect and outdated KernelVersion.
--

commit 705b17eefc8a8d4b3eadfd2e4bd4137ac5a8e6eb
Author: Liviu Stan <liviu.stan@analog.com>

iio: core: Add IIO_COVERAGE_PERCENT channel type
    
This commit adds a new channel type for sensors that report fractional
coverage as a percentage. The first user is the ADT7604 leak detector,
where the value represents the portion of the sensing element that is
wetted.

> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 4fc9f6bd42812..73aa5ac4a91a4 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
[ ... ]
> +What:		/sys/bus/iio/devices/iio:deviceX/in_coveragepercentX_raw
> +KernelVersion:	6.15

Is this KernelVersion correct? Given that 6.15 was released in 2025,
shouldn't this reflect the upcoming kernel version for this new interface?

> +Contact:	linux-iio@vger.kernel.org
> +Description:
> +		Raw (unscaled no offset etc.) coverage reading. Used for sensors
> +		that report fractional coverage as a percentage, such as leak
> +		detectors where the value represents what portion of the sensing
> +		element is wetted. Units after application of scale and offset are
> +		percent.

[ ... ]

> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index 22eefd048ba92..4329d28f78b09 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
[ ... ]
> @@ -98,6 +98,7 @@ static const char * const iio_chan_type_name_spec[] = {
>  	[IIO_CHROMATICITY] = "chromaticity",
>  	[IIO_ATTENTION] = "attention",
>  	[IIO_ALTCURRENT] = "altcurrent",
> +	[IIO_COVERAGE_PERCENT] = "coveragepercent",
>  };

Does embedding the measurement unit into the IIO channel type name conflict
with the IIO UAPI design?

Typically, channel types represent the physical quantity, while the unit
is determined by applying scale and offset to the raw values.

If a future sensor measures coverage using a different scale, such as a
fractional value from 0.0 to 1.0 or parts-per-million, wouldn't the
coveragepercent string become misleading and inflexible?

[ ... ]

> diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c
> index 03ca33869ce85..1ba0386133839 100644
> --- a/tools/iio/iio_event_monitor.c
> +++ b/tools/iio/iio_event_monitor.c
[ ... ]
> @@ -65,6 +65,7 @@ static const char * const iio_chan_type_name_spec[] = {
>  	[IIO_CHROMATICITY] = "chromaticity",
>  	[IIO_ATTENTION] = "attention",
>  	[IIO_ALTCURRENT] = "altcurrent",
> +	[IIO_COVERAGE_PERCENT] = "coveragepercent",
>  };

Does this omit an update to the event_is_known() switch statement?

If IIO_COVERAGE_PERCENT is missing from the switch block in event_is_known(),
the statement will fall through to the default case and return false.

Would this cause the iio_event_monitor tool to falsely flag events from
this new channel as unknown and fail to parse or print their information?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260514144712.64374-1-liviu.stan@analog.com?part=5

  reply	other threads:[~2026-05-14 20:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14 14:46 [PATCH v2 0/7] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
2026-05-14 14:46 ` [PATCH v2 1/7] iio: temperature: ltc2983: Fix macro parenthesization and rename Liviu Stan
2026-05-14 19:32   ` sashiko-bot
2026-05-14 14:46 ` [PATCH v2 2/7] iio: temperature: ltc2983: Use local device pointer consistently Liviu Stan
2026-05-14 19:39   ` sashiko-bot
2026-05-14 14:46 ` [PATCH v2 3/7] iio: temperature: ltc2983: Fix inconsistent channel wording in messages Liviu Stan
2026-05-14 19:47   ` sashiko-bot
2026-05-14 14:46 ` [PATCH v2 4/7] iio: temperature: ltc2983: Use fwnode_property_present() for optional properties Liviu Stan
2026-05-14 20:04   ` sashiko-bot
2026-05-14 14:46 ` [PATCH v2 5/7] iio: core: Add IIO_COVERAGE_PERCENT channel type Liviu Stan
2026-05-14 20:16   ` sashiko-bot [this message]
2026-05-15  8:38   ` Francesco Lavra
2026-05-15  9:01     ` Stan, Liviu
2026-05-14 14:46 ` [PATCH v2 6/7] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983 Liviu Stan
2026-05-14 20:43   ` sashiko-bot
2026-05-14 14:46 ` [PATCH v2 7/7] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
2026-05-15  8:38   ` Francesco Lavra
2026-05-15  9:07     ` Stan, Liviu
2026-05-15  6:42 ` [PATCH v2 0/7] " Stan, Liviu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260514201652.EBCBAC2BCB7@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=liviu.stan@analog.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.