From: Guenter Roeck <linux@roeck-us.net>
To: "a.shimko" <artyom.shimko@gmail.com>, linux-hwmon@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, sudeep.holla@arm.com,
cristian.marussi@arm.com, jdelvare@suse.com,
guenter.roeck@linux.com
Subject: Re: [PATCH 1/3] hwmon: scmi: Add default case with debug output
Date: Tue, 5 Aug 2025 06:10:06 -0700 [thread overview]
Message-ID: <e5d568fe-5aa2-4233-aff7-6d4b105e9ab9@roeck-us.net> (raw)
In-Reply-To: <20250805125003.12573-2-artyom.shimko@gmail.com>
On 8/5/25 05:43, a.shimko wrote:
> From: Artem Shimko <artyom.shimko@gmail.com>
>
> Improve handling of unsupported sensor types:
> - Add default case in sensor type switch statement
> - Log skipped sensors with debug information including:
> * Sensor ID
> * Sensor type
> * Sensor name (if available)
> - Use rate-limited dev_dbg for safety
>
The code doesn't actually do that, and it would be pointless
and make the message useless.
> Debug output format:
> "Skipping unsupported sensor ID:%d Type:%d (%s)"
>
> Signed-off-by: Artem Shimko <artyom.shimko@gmail.com>
> ---
> drivers/hwmon/scmi-hwmon.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/hwmon/scmi-hwmon.c b/drivers/hwmon/scmi-hwmon.c
> index 364199b332c0..a3b5b5c0ec25 100644
> --- a/drivers/hwmon/scmi-hwmon.c
> +++ b/drivers/hwmon/scmi-hwmon.c
> @@ -275,6 +275,10 @@ static int scmi_hwmon_probe(struct scmi_device *sdev)
> nr_count[type]++;
> break;
> }
> + default:
> + dev_dbg(dev, "Skipping unsupported sensor ID:%d Type:%d (%s)\n",
> + i, sensor->type, sensor->name ? sensor->name : "unnamed");
> + continue;
break;
> }
>
> if (nr_count[hwmon_temp])
> @@ -323,6 +327,10 @@ static int scmi_hwmon_probe(struct scmi_device *sdev)
> idx = --nr_count[type];
> *(scmi_sensors->info[type] + idx) = sensor;
> break;
> + default:
> + dev_dbg(dev, "Skipping unsupported sensor ID:%d Type:%d (%s)\n",
> + i, sensor->type, sensor->name ? sensor->name : "unnamed");
> + continue;
break;
> }
> }
>
next prev parent reply other threads:[~2025-08-05 13:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-05 12:43 [PATCH v2 0/3] hwmon: scmi: Driver improvements and fixes a.shimko
2025-08-05 12:43 ` [PATCH 1/3] hwmon: scmi: Add default case with debug output a.shimko
2025-08-05 13:10 ` Guenter Roeck [this message]
2025-08-06 15:12 ` kernel test robot
2025-08-05 12:43 ` [PATCH 2/3] hwmon: scmi: Remove redundant devm_kfree call a.shimko
2025-08-05 13:13 ` Guenter Roeck
2025-08-05 12:43 ` [PATCH 3/3] hwmon: scmi: Enhance error reporting with dev_err_probe a.shimko
2025-08-05 13:20 ` Guenter Roeck
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=e5d568fe-5aa2-4233-aff7-6d4b105e9ab9@roeck-us.net \
--to=linux@roeck-us.net \
--cc=artyom.shimko@gmail.com \
--cc=cristian.marussi@arm.com \
--cc=guenter.roeck@linux.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sudeep.holla@arm.com \
/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
all inboxes | Powered by JetHome®