Skip to contentSkip to conversation

hwmon: (coretemp) Remove unused for_each_sibling() and name_attr

PATCH Applied Asaf Nuri Bertizlioğlu 3 participants 3 messages Nov 20

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (coretemp) Remove unused for_each_sibling() and name_attr

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.

---
 drivers/hwmon/coretemp.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/hwmon/coretemp.c +0 -8
index 96d57fe12de6..75ba3484b1e1 100644
@@ -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 {
Signature · 1 line
2.56.0
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 14 lines

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.

Quoted 5 lines

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.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer Applied
#2 lore raw
In reply to Asaf Nuri Bertizlioğlu
Quoted 14 lines · 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.

Quoted 5 lines

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.

Applied.

Thanks,
Guenter