Skip to contentSkip to conversation

cpufreq: Fix build error on some platforms that use cpufreq_for_each_*

PATCH Applied Stratos Karafotis 4 participants 4 messages May 7, 2014 – May 8, 2014 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: Fix build error on some platforms that use cpufreq_for_each_*

On platforms that use cpufreq_for_each_* macros, build fails if CONFIG_CPU_FREQ=n, e.g. ARM/shmobile/koelsch/non-multiplatform:

drivers/built-in.o: In function `clk_round_parent':
clkdev.c:(.text+0xcf168): undefined reference to cpufreq_next_valid' drivers/built-in.o: In function clk_rate_table_find':
clkdev.c:(.text+0xcf820): undefined reference to `cpufreq_next_valid' make[3]: *** [vmlinux] Error 1

Fix this making cpufreq_next_valid function inline and move it to cpufreq.h.

---
 drivers/cpufreq/cpufreq.c | 11 -----------
 include/linux/cpufreq.h   | 11 +++++++++--
 2 files changed, 9 insertions(+), 13 deletions(-)
drivers/cpufreq/cpufreq.c +0 -11
index bfe82b6..a05c921 100644
@@ -237,17 +237,6 @@ void cpufreq_cpu_put(struct cpufreq_policy *policy)
 }
 EXPORT_SYMBOL_GPL(cpufreq_cpu_put);
 
-bool cpufreq_next_valid(struct cpufreq_frequency_table **pos)
-{
-	while ((*pos)->frequency != CPUFREQ_TABLE_END)
-		if ((*pos)->frequency != CPUFREQ_ENTRY_INVALID)
-			return true;
-		else
-			(*pos)++;
-	return false;
-}
-EXPORT_SYMBOL_GPL(cpufreq_next_valid);
-
 /*********************************************************************
  *            EXTERNALLY AFFECTING FREQUENCY CHANGES                 *
  *********************************************************************/
include/linux/cpufreq.h +9 -2
index 9d803b5..3f45889 100644
@@ -489,8 +489,15 @@ static inline void dev_pm_opp_free_cpufreq_table(struct device *dev,
 }
 #endif
 
-
-bool cpufreq_next_valid(struct cpufreq_frequency_table **pos);
+static inline bool cpufreq_next_valid(struct cpufreq_frequency_table **pos)
+{
+	while ((*pos)->frequency != CPUFREQ_TABLE_END)
+		if ((*pos)->frequency != CPUFREQ_ENTRY_INVALID)
+			return true;
+		else
+			(*pos)++;
+	return false;
+}
 
 /*
  * cpufreq_for_each_entry -	iterate over a cpufreq_frequency_table
Signature · 1 line
1.9.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Stratos Karafotis

On platforms that use cpufreq_for_each_* macros, build fails if CONFIG_CPU_FREQ=n, e.g. ARM/shmobile/koelsch/non-multiplatform:

drivers/built-in.o: In function `clk_round_parent':
clkdev.c:(.text+0xcf168): undefined reference to cpufreq_next_valid' drivers/built-in.o: In function clk_rate_table_find':
clkdev.c:(.text+0xcf820): undefined reference to `cpufreq_next_valid' make[3]: *** [vmlinux] Error 1

Fix this making cpufreq_next_valid function inline and move it to cpufreq.h.

Quoted 6 lines
---
 drivers/cpufreq/cpufreq.c | 11 -----------
 include/linux/cpufreq.h   | 11 +++++++++--
 2 files changed, 9 insertions(+), 13 deletions(-)
Tested-by on v1 1/1
#2 lore raw
In reply to Stratos Karafotis

Hi Stratos,

Quoted 11 lines · Stratos Karafotis

On platforms that use cpufreq_for_each_* macros, build fails if CONFIG_CPU_FREQ=n, e.g. ARM/shmobile/koelsch/non-multiplatform:

drivers/built-in.o: In function `clk_round_parent':
clkdev.c:(.text+0xcf168): undefined reference to cpufreq_next_valid' drivers/built-in.o: In function clk_rate_table_find':
clkdev.c:(.text+0xcf820): undefined reference to `cpufreq_next_valid' make[3]: *** [vmlinux] Error 1

Fix this making cpufreq_next_valid function inline and move it to cpufreq.h.

Thanks!

Quoted 2 lines

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#3 lore raw
Quoted 15 lines · Geert Uytterhoeven

Hi Stratos,

Quoted 11 lines · Stratos Karafotis

On platforms that use cpufreq_for_each_* macros, build fails if CONFIG_CPU_FREQ=n, e.g. ARM/shmobile/koelsch/non-multiplatform:

drivers/built-in.o: In function `clk_round_parent':
clkdev.c:(.text+0xcf168): undefined reference to cpufreq_next_valid' drivers/built-in.o: In function clk_rate_table_find':
clkdev.c:(.text+0xcf820): undefined reference to `cpufreq_next_valid' make[3]: *** [vmlinux] Error 1

Fix this making cpufreq_next_valid function inline and move it to cpufreq.h.

Quoted 7 lines

Thanks!

Quoted 2 lines

Applied, thanks!

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.