hwmon: (coretemp) Remove unused for_each_sibling() and name_attr
Subsystems (2)
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
@@ -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
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 14 lines
The
for_each_sibling()macro lost its only user in commite1b370b64031("hwmon: (coretemp) Simplify sibling management").The
name_attrmember of structplatform_datahas been unused since commitd72d19c26c41("hwmon: (coretemp) Convert to usedevm_hwmon_device_register_with_groups"), which left the "name" attribute to the hwmon core.Remove both. No functional change.
Built with
CONFIG_SMP=yandCONFIG_SMP=nat W=1 with no new warnings. Apart from the structplatform_dataallocation 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.
Signed-off-by Asaf Nuri Bertizlioğlu <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 14 lines · Asaf Nuri Bertizlioğlu
The
for_each_sibling()macro lost its only user in commite1b370b64031("hwmon: (coretemp) Simplify sibling management").The
name_attrmember of structplatform_datahas been unused since commitd72d19c26c41("hwmon: (coretemp) Convert to usedevm_hwmon_device_register_with_groups"), which left the "name" attribute to the hwmon core.Remove both. No functional change.
Built with
CONFIG_SMP=yandCONFIG_SMP=nat W=1 with no new warnings. Apart from the structplatform_dataallocation 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.
Signed-off-by Asaf Nuri Bertizlioğlu <[email protected]>
Applied.
Thanks,
Guenter