lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e5d568fe-5aa2-4233-aff7-6d4b105e9ab9@roeck-us.net>
Date: Tue, 5 Aug 2025 06:10:06 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: "a.shimko" <artyom.shimko@...il.com>, linux-hwmon@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, sudeep.holla@....com,
 cristian.marussi@....com, jdelvare@...e.com, guenter.roeck@...ux.com
Subject: Re: [PATCH 1/3] hwmon: scmi: Add default case with debug output

On 8/5/25 05:43, a.shimko wrote:
> From: Artem Shimko <artyom.shimko@...il.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@...il.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;

>   		}
>   	}
>   


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ