Skip to contentSkip to conversation

cpufreq: apple: remove duplicate intializer

PATCH Applied Arnd Bergmann 3 participants 3 messages Dec 15, 2022 – Dec 16, 2022

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

PATCH 1/1 cpufreq: apple: remove duplicate intializer

From: Arnd Bergmann <[email protected]>

When -Woverride-init is enabled, gcc notices that the .attr field is initialized twice:

drivers/cpufreq/apple-soc-cpufreq.c:331:27: error: initialized field overwritten [-Werror=override-init]
331 | .attr = apple_soc_cpufreq_hw_attr,

      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~

Remove the first one, since this is not actually used.

---
 drivers/cpufreq/apple-soc-cpufreq.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/apple-soc-cpufreq.c +0 -1
index d1801281cdd9..6f26395184c4 100644
@@ -321,7 +321,6 @@ static struct cpufreq_driver apple_soc_cpufreq_driver = {
 	.flags		= CPUFREQ_HAVE_GOVERNOR_PER_POLICY |
 			  CPUFREQ_NEED_INITIAL_FREQ_CHECK | CPUFREQ_IS_COOLING_DEV,
 	.verify		= cpufreq_generic_frequency_table_verify,
-	.attr		= cpufreq_generic_attr,
 	.get		= apple_soc_cpufreq_get_rate,
 	.init		= apple_soc_cpufreq_init,
 	.exit		= apple_soc_cpufreq_exit,
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When -Woverride-init is enabled, gcc notices that the .attr field is initialized twice:

Quoted 7 lines

drivers/cpufreq/apple-soc-cpufreq.c:331:27: error: initialized field overwritten [-Werror=override-init]
331 | .attr = apple_soc_cpufreq_hw_attr,

      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~

Remove the first one, since this is not actually used.

Quoted 20 lines
---
 drivers/cpufreq/apple-soc-cpufreq.c | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/apple-soc-cpufreq.c +0 -2
index d1801281cdd9..6f26395184c4 100644
@@ -321,7 +321,6 @@ static struct cpufreq_driver apple_soc_cpufreq_driver = {
        .flags          = CPUFREQ_HAVE_GOVERNOR_PER_POLICY |
                          CPUFREQ_NEED_INITIAL_FREQ_CHECK | CPUFREQ_IS_COOLING_DEV,
        .verify         = cpufreq_generic_frequency_table_verify,
-       .attr           = cpufreq_generic_attr,
        .get            = apple_soc_cpufreq_get_rate,
        .init           = apple_soc_cpufreq_init,
        .exit           = apple_soc_cpufreq_exit,
--

2.35.1

maintainer Applied
#2 lore raw
Quoted 11 lines · Eric Curtin
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When -Woverride-init is enabled, gcc notices that the .attr field is initialized twice:

drivers/cpufreq/apple-soc-cpufreq.c:331:27: error: initialized field overwritten [-Werror=override-init]
331 | .attr = apple_soc_cpufreq_hw_attr,

      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 5 lines
Quoted 3 lines

Remove the first one, since this is not actually used.

Applied. Thanks.

Signature · 1 line
viresh