Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH] hwmon: (coretemp) Remove unused for_each_sibling() and name_attr
@ 2026-11-20 16:59 Asaf Nuri Bertizlioğlu
  2026-11-20 17:02 ` sashiko-bot
  2026-11-20 19:26 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Asaf Nuri Bertizlioğlu @ 2026-11-20 16:59 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon, linux-kernel, Asaf Nuri Bertizlioğlu

The for_each_sibling() macro lost its only user in commit
e1b370b64031 ("hwmon: (coretemp) Simplify sibling management").

The name_attr member of struct platform_data has been unused since
commit d72d19c26c41 ("hwmon: (coretemp) Convert to use
devm_hwmon_device_register_with_groups"), which left the "name"
attribute to the hwmon core.

Remove both. No functional change.

Built with CONFIG_SMP=y and CONFIG_SMP=n at W=1 with no new
warnings. Apart from the struct platform_data allocation size,
which shrinks from 88 to 56 bytes, the generated code is unchanged.

The unused definitions were found with an LLM-based coding assistant,
which also drafted this changelog. Both findings were confirmed with
gcc -Wunused-macros, git grep and the git history.

Signed-off-by: Asaf Nuri Bertizlioğlu <asafbertizlioglu@gmail.com>
---
 drivers/hwmon/coretemp.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 96d57fe12de6..75ba3484b1e1 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -51,13 +51,6 @@ enum coretemp_attr_index {
 	TOTAL_ATTRS = ATTR_TTARGET + 1		/* Maximum no of possible attrs */
 };
 
-#ifdef CONFIG_SMP
-#define for_each_sibling(i, cpu) \
-	for_each_cpu(i, topology_sibling_cpumask(cpu))
-#else
-#define for_each_sibling(i, cpu)	for (i = 0; false; )
-#endif
-
 /*
  * Per-Core Temperature Data
  * @temp_valid: Whether the CPU reported @temp as valid. @temp is not
@@ -98,7 +91,6 @@ struct platform_data {
 	struct cpumask		cpumask;
 	struct temp_data	*pkg_data;
 	struct temp_data	**core_data;
-	struct device_attribute name_attr;
 };
 
 struct tjmax_pci {
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-20 19:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 16:59 [PATCH] hwmon: (coretemp) Remove unused for_each_sibling() and name_attr Asaf Nuri Bertizlioğlu
2026-11-20 17:02 ` sashiko-bot
2026-11-20 19:26 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox