Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ariana Lazar" <ariana.lazar@microchip.com>
Cc: devicetree@vger.kernel.org, linux-hwmon@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v5 3/5] iio: core: add iio_fill_val_int_64() helper
Date: Tue, 03 Nov 2026 14:42:25 +0000	[thread overview]
Message-ID: <sashiko-outbox-195469@kernel.org> (raw)
In-Reply-To: <20261103-pac1711-v5-3-71c20101a52e@microchip.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] iio: core: iio_fill_val_int_64() duplicates iio_val_s64_decompose()
--

commit 9e24103c43e24f77958f3d94346bd3b90fbffa99
Author: Ariana Lazar <ariana.lazar@microchip.com>

iio: core: add iio_fill_val_int_64() helper

This commit adds the iio_fill_val_int_64() inline helper to
include/linux/iio/iio.h to split a 64-bit integer into lower and upper 32-bit
output parameters for IIO_VAL_INT_64.

> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index 711c00f673713..d8fd300a125d6 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -1099,6 +1099,21 @@ ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals);
>  int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer,
>  	int *fract);
>  
> +/**
> + * iio_fill_val_int_64() - Fill the value fields used to represent a 64-bit integer
> + * @value: The 64-bit value to be represented
> + * @val: the lower 32 bits of @value
> + * @val2: the upper 32 bits of @value
> + *
> + * Populate @val and @val2 with the lower and upper halves of @value, as
> + * expected by IIO_VAL_INT_64.
> + */
> +static inline void iio_fill_val_int_64(s64 value, int *val, int *val2)
> +{
> +	*val = lower_32_bits(value);
> +	*val2 = upper_32_bits(value);
> +}

[Severity: Low]
Does iio_fill_val_int_64() in include/linux/iio/iio.h duplicate the existing
iio_val_s64_decompose() helper in include/linux/iio/types.h?

include/linux/iio/types.h (which is already included by
include/linux/iio/iio.h) defines:

static inline void iio_val_s64_decompose(s64 dec64, s32 *val0, s32 *val1)
{
	*val0 = lower_32_bits(dec64);
	*val1 = upper_32_bits(dec64);
}

iio_val_s64_decompose() is already used for IIO_VAL_INT_64 in the IIO core
(drivers/iio/industrialio-core.c), KUnit format tests
(iio_test_iio_format_value_integer_64() in drivers/iio/test/iio-test-format.c),
and existing IIO drivers (such as drivers/iio/flow/slf3s.c,
drivers/iio/frequency/adf41513.c, and drivers/iio/adc/ti-ads112c14.c) to
populate the read_raw int *val and int *val2 output parameters.

Could callers such as pac1711 use iio_val_s64_decompose() directly instead of
introducing a second helper for the same operation?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261103-pac1711-v5-0-71c20101a52e@microchip.com?part=3

  reply	other threads:[~2026-11-03 14:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 14:37 [PATCH v5 0/5] Add support for Microchip PAC1711 Power Monitor Ariana Lazar
2026-11-03 14:37 ` [PATCH v5 1/5] unaligned: introduce be56 unaligned accessors Ariana Lazar
2026-11-04  7:54   ` Joshua Crofts
2026-11-03 14:37 ` [PATCH v5 2/5] iio: core: add IIO_CHARGE channel type Ariana Lazar
2026-11-03 16:13   ` Andy Shevchenko
2026-11-03 14:37 ` [PATCH v5 3/5] iio: core: add iio_fill_val_int_64() helper Ariana Lazar
2026-11-03 14:42   ` sashiko-bot [this message]
2026-11-03 16:14   ` Andy Shevchenko
2026-11-03 14:37 ` [PATCH v5 4/5] dt-bindings: iio: adc: add support for PAC1711 Ariana Lazar
2026-11-03 14:37 ` [PATCH v5 5/5] " Ariana Lazar
2026-11-03 14:59   ` sashiko-bot
2026-11-03 16:40   ` Andy Shevchenko
2026-11-04  1:36   ` Jonathan Cameron

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=sashiko-outbox-195469@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ariana.lazar@microchip.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox