From: sashiko-bot@kernel.org
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v1 2/2] thermal: hwmon: Use extra_groups for adding temperature attributes
Date: Wed, 22 Apr 2026 22:28:00 +0000 [thread overview]
Message-ID: <20260422222801.285B1C19425@smtp.kernel.org> (raw)
In-Reply-To: <2267033.irdbgypaU6@rafael.j.wysocki>
Sashiko AI review found 1 potential issue(s):
- [Low] Incomplete refactoring leaves unused fields in `struct thermal_hwmon_temp`.
--
commit 31b1d3d5cb622738ced37ad0ce85eba8a7a4b533
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
thermal: hwmon: Use extra_groups for adding temperature attributes
This commit simplifies the thermal hwmon device registration by passing an
attribute group directly via the extra_groups argument instead of adding
each sysfs attribute individually.
> diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c
> index 46c40c0852804..49d06cf27bd87 100644
> --- a/drivers/thermal/thermal_hwmon.c
> +++ b/drivers/thermal/thermal_hwmon.c
[ ... ]
> /* one temperature input for each thermal zone */
> struct thermal_hwmon_temp {
> struct list_head hwmon_node;
> struct thermal_zone_device *tz;
> - struct thermal_hwmon_attr temp_input; /* hwmon sys attr */
> - struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */
> + struct device_attribute temp_input; /* hwmon sys attr */
> + struct device_attribute temp_crit; /* hwmon sys attr */
> };
Are temp_input and temp_crit still needed in struct thermal_hwmon_temp?
Now that the attributes are registered via the static thermal_hwmon_group
using DEVICE_ATTR_RO, it looks like these fields are no longer initialized
or used anywhere in the updated code.
Could they be removed entirely to avoid keeping dead fields and to save memory
in the dynamically allocated struct thermal_hwmon_device?
--
Sashiko AI review · https://sashiko.dev/#/patchset/5100596.31r3eYUQgx@rafael.j.wysocki?part=2
prev parent reply other threads:[~2026-04-22 22:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 18:53 [PATCH v1 0/2] thermal: hwmon: Rework of automatic hwmon device registration Rafael J. Wysocki
2026-04-22 18:54 ` [PATCH v1 1/2] thermal: hwmon: Register one hwmon device for each thermal zone Rafael J. Wysocki
2026-04-22 22:07 ` sashiko-bot
2026-04-30 19:41 ` Rafael J. Wysocki
2026-04-22 19:09 ` [PATCH v1 2/2] thermal: hwmon: Use extra_groups for adding temperature attributes Rafael J. Wysocki
2026-04-22 22:28 ` 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=20260422222801.285B1C19425@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=sashiko@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