Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Flaviu Nistor" <flaviu.nistor@gmail.com>
Cc: linux-hwmon@vger.kernel.org, robh@kernel.org,
	devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 2/2] hwmon: (lm90) Reject channel 2 on chips with only one remote sensor
Date: Wed, 26 Aug 2026 18:57:42 +0000	[thread overview]
Message-ID: <20260826185743.58CD01F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260826184750.4798-3-flaviu.nistor@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Incorrect format specifier '%d' used for 'u32' variable.
--

commit dbab4ee8e2d548c97ffd31b1a3d640af352905b1
Author: Flaviu Nistor <flaviu.nistor@gmail.com>

hwmon: (lm90) Reject channel 2 on chips with only one remote sensor

This commit validates firmware channel definitions against chip capabilities
and returns -EINVAL when channel 2 is configured on devices with 1 remote
channel.

> diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
> index 1c603272538aa..3faeb2c6ab01b 100644
> --- a/drivers/hwmon/lm90.c
> +++ b/drivers/hwmon/lm90.c
> @@ -2712,6 +2712,11 @@ static int lm90_probe_channel(struct i2c_client *client,
>  		return -EINVAL;
>  	}
>  
> +	if (id == 2 && !(data->flags & LM90_HAVE_TEMP3)) {
> +		dev_err(dev, "channel %d is not supported for this chip in %pfw\n", id, child);

[Severity: Low]
Does this code use the correct format specifier for the id variable?

While passing an unsigned 32-bit integer to a %d specifier works for small
values (since id is guaranteed to be exactly 2 on this path), it is
semantically incorrect for a u32 variable and violates format string
contracts, leading to potential compiler warnings (-Wformat).

Would it be better to use %u as the format specifier for a u32?

> +		return -EINVAL;
> +	}
> +
>  	err = fwnode_property_read_string(child, "label", &data->channel_label[id]);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260826184750.4798-1-flaviu.nistor@gmail.com?part=2

      reply	other threads:[~2026-08-26 18:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26 18:47 [PATCH v2 0/2] hwmon: lm90: Fix DT channel constraints and reject unsupported channel 2 Flaviu Nistor
2026-08-26 18:47 ` [PATCH v2 1/2] dt-bindings: hwmon: national,lm90: Fix channel constraints for temperature offset Flaviu Nistor
2026-08-26 18:59   ` sashiko-bot
2026-08-27 17:01   ` Conor Dooley
2026-08-27 17:22     ` Conor Dooley
2026-08-26 18:47 ` [PATCH v2 2/2] hwmon: (lm90) Reject channel 2 on chips with only one remote sensor Flaviu Nistor
2026-08-26 18:57   ` sashiko-bot [this message]

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=20260826185743.58CD01F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=flaviu.nistor@gmail.com \
    --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