From: sashiko-bot@kernel.org
To: "AngeloGioacchino Del Regno" <angelogioacchino.delregno@collabora.com>
Cc: neil.armstrong@linaro.org, linux-phy@lists.infradead.org,
vkoul@kernel.org, olteanv@gmail.com
Subject: Re: [PATCH RESEND v8 10/10] iio: adc: qcom-spmi-iadc: Remove regmap R/W wrapper functions
Date: Tue, 12 May 2026 21:55:55 +0000 [thread overview]
Message-ID: <20260512215555.71608C2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260511100805.121432-11-angelogioacchino.delregno@collabora.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] Format Specifier Mismatch in `iadc_version_check`
- [Low] Implicit Signed/Unsigned Arithmetic Conversion in `iadc_rsense_read`
--
commit e3f3f37b20b194577f3177eac52f98e565837579
Author: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
iio: adc: qcom-spmi-iadc: Remove regmap R/W wrapper functions
This commit migrates the driver to use the regmap api directly instead of
relying on custom read and write wrapper functions. It simplifies the driver
as the spmi subdevice natively handles the register base address internally.
> diff --git a/drivers/iio/adc/qcom-spmi-iadc.c b/drivers/iio/adc/qcom-spmi-iadc.c
> index 55a09c0e2d5cb..503f90b2a5bad 100644
> --- a/drivers/iio/adc/qcom-spmi-iadc.c
> +++ b/drivers/iio/adc/qcom-spmi-iadc.c
[ ... ]
> @@ -392,10 +369,10 @@ static int iadc_update_offset(struct iadc_chip *iadc)
>
> static int iadc_version_check(struct iadc_chip *iadc)
> {
> - u8 val;
> + u32 val;
This isn't a bug, but since val is now a u32, should the subsequent
dev_err() format specifiers in this function be updated from %d to %u to
avoid compiler warnings?
> int ret;
>
> - ret = iadc_read(iadc, IADC_PERPH_TYPE, &val);
> + ret = regmap_read(iadc->regmap, IADC_PERPH_TYPE, &val);
> if (ret < 0)
> return ret;
[ ... ]
> @@ -428,7 +405,7 @@ static int iadc_version_check(struct iadc_chip *iadc)
> static int iadc_rsense_read(struct iadc_chip *iadc, struct device_node *node)
> {
> int ret, sign, int_sense;
> - u8 deviation;
> + u32 deviation;
Does changing deviation to u32 cause an implicit unsigned arithmetic
conversion later in this function?
When calculating int_sense, sign can be -1:
int_sense += sign * deviation * IADC_INT_RSENSE_DEVIATION;
Since deviation is unsigned, -1 will be promoted to an unsigned value.
Could this trigger static analysis warnings, and would explicitly casting
deviation to int during the calculation be safer?
>
> ret = of_property_read_u32(node, "qcom,external-resistor-micro-ohms",
> &iadc->rsense[IADC_EXT_RSENSE]);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260511100805.121432-1-angelogioacchino.delregno@collabora.com?part=10
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2026-05-12 21:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 10:07 [PATCH RESEND v8 00/10] SPMI: Implement sub-devices and migrate drivers AngeloGioacchino Del Regno
2026-05-11 10:07 ` [PATCH RESEND v8 01/10] spmi: Remove redundant dev_name() print in spmi_device_add() AngeloGioacchino Del Regno
2026-05-11 10:07 ` [PATCH RESEND v8 02/10] spmi: Print error status with %pe format AngeloGioacchino Del Regno
2026-05-11 10:07 ` [PATCH RESEND v8 03/10] spmi: Remove unneeded goto in spmi_device_add() error path AngeloGioacchino Del Regno
2026-05-11 10:07 ` [PATCH RESEND v8 04/10] spmi: Implement spmi_subdevice_alloc_and_add() and devm variant AngeloGioacchino Del Regno
2026-05-12 1:57 ` sashiko-bot
2026-05-11 10:08 ` [PATCH RESEND v8 05/10] nvmem: qcom-spmi-sdam: Migrate to devm_spmi_subdevice_alloc_and_add() AngeloGioacchino Del Regno
2026-05-12 4:14 ` sashiko-bot
2026-05-11 10:08 ` [PATCH RESEND v8 06/10] power: reset: qcom-pon: " AngeloGioacchino Del Regno
2026-05-11 10:08 ` [PATCH RESEND v8 07/10] phy: qualcomm: eusb2-repeater: " AngeloGioacchino Del Regno
2026-05-12 6:10 ` sashiko-bot
2026-05-11 10:08 ` [PATCH RESEND v8 08/10] misc: qcom-coincell: " AngeloGioacchino Del Regno
2026-05-11 10:08 ` [PATCH RESEND v8 09/10] iio: adc: qcom-spmi-iadc: " AngeloGioacchino Del Regno
2026-05-11 10:08 ` [PATCH RESEND v8 10/10] iio: adc: qcom-spmi-iadc: Remove regmap R/W wrapper functions AngeloGioacchino Del Regno
2026-05-12 21:55 ` sashiko-bot [this message]
2026-05-11 13:17 ` [PATCH RESEND v8 00/10] SPMI: Implement sub-devices and migrate drivers 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=20260512215555.71608C2BCB0@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=linux-phy@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=olteanv@gmail.com \
--cc=sashiko@lists.linux.dev \
--cc=vkoul@kernel.org \
/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