All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: Fix build error on some platforms that use cpufreq_for_each_*
@ 2014-05-07 16:33 Stratos Karafotis
  2014-05-08  5:39 ` Viresh Kumar
  2014-05-08  8:27 ` Geert Uytterhoeven
  0 siblings, 2 replies; 4+ messages in thread
From: Stratos Karafotis @ 2014-05-07 16:33 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar; +Cc: Geert Uytterhoeven, linux-pm, LKML

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.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
---
 drivers/cpufreq/cpufreq.c | 11 -----------
 include/linux/cpufreq.h   | 11 +++++++++--
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index bfe82b6..a05c921 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -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                 *
  *********************************************************************/
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 9d803b5..3f45889 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -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
-- 
1.9.0

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

* Re: [PATCH] cpufreq: Fix build error on some platforms that use cpufreq_for_each_*
  2014-05-07 16:33 [PATCH] cpufreq: Fix build error on some platforms that use cpufreq_for_each_* Stratos Karafotis
@ 2014-05-08  5:39 ` Viresh Kumar
  2014-05-08  8:27 ` Geert Uytterhoeven
  1 sibling, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2014-05-08  5:39 UTC (permalink / raw)
  To: Stratos Karafotis; +Cc: Rafael J. Wysocki, Geert Uytterhoeven, linux-pm, LKML

On 7 May 2014 22:03, Stratos Karafotis <stratosk@semaphore.gr> wrote:
> 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.
>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
> ---
>  drivers/cpufreq/cpufreq.c | 11 -----------
>  include/linux/cpufreq.h   | 11 +++++++++--
>  2 files changed, 9 insertions(+), 13 deletions(-)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

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

* Re: [PATCH] cpufreq: Fix build error on some platforms that use cpufreq_for_each_*
  2014-05-07 16:33 [PATCH] cpufreq: Fix build error on some platforms that use cpufreq_for_each_* Stratos Karafotis
  2014-05-08  5:39 ` Viresh Kumar
@ 2014-05-08  8:27 ` Geert Uytterhoeven
  2014-05-08 11:33   ` Rafael J. Wysocki
  1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2014-05-08  8:27 UTC (permalink / raw)
  To: Stratos Karafotis; +Cc: Rafael J. Wysocki, Viresh Kumar, linux-pm, LKML

Hi Stratos,

On Wed, May 7, 2014 at 6:33 PM, Stratos Karafotis <stratosk@semaphore.gr> wrote:
> 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!

> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>

Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* Re: [PATCH] cpufreq: Fix build error on some platforms that use cpufreq_for_each_*
  2014-05-08  8:27 ` Geert Uytterhoeven
@ 2014-05-08 11:33   ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2014-05-08 11:33 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Stratos Karafotis, Viresh Kumar, linux-pm, LKML

On Thursday, May 08, 2014 10:27:15 AM Geert Uytterhoeven wrote:
> Hi Stratos,
> 
> On Wed, May 7, 2014 at 6:33 PM, Stratos Karafotis <stratosk@semaphore.gr> wrote:
> > 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!
> 
> > Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
> 
> Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> 

Applied, thanks!

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

end of thread, other threads:[~2014-05-08 11:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-07 16:33 [PATCH] cpufreq: Fix build error on some platforms that use cpufreq_for_each_* Stratos Karafotis
2014-05-08  5:39 ` Viresh Kumar
2014-05-08  8:27 ` Geert Uytterhoeven
2014-05-08 11:33   ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.