linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] intel_idle: fix intel_idle_state_needs_timer_stop build failure
@ 2020-12-03 22:30 Arnd Bergmann
  2020-12-03 23:12 ` Randy Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2020-12-03 22:30 UTC (permalink / raw)
  To: Jacob Pan, Len Brown, Peter Zijlstra, Rafael J. Wysocki
  Cc: Arnd Bergmann, Chen Yu, Borislav Petkov, Thomas Gleixner,
	linux-pm, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The newly added function is defined inside of an #ifdef section but
used outside, leading to a build failure:

drivers/idle/intel_idle.c:1510:7: error: implicit declaration of function 'intel_idle_state_needs_timer_stop' [-Werror,-Wimplicit-function-declaration]
                if (intel_idle_state_needs_timer_stop(&drv->states[drv->state_count]))
                    ^

Move it ahead of the CONFIG_ACPI_PROCESSOR_CSTATE check.

Fixes: 6e1d2bc675bd ("intel_idle: Fix intel_idle() vs tracing")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/idle/intel_idle.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 7ee7ffe22ae3..d79335506ecd 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1140,6 +1140,20 @@ static bool __init intel_idle_max_cstate_reached(int cstate)
 	return false;
 }
 
+static bool __init intel_idle_state_needs_timer_stop(struct cpuidle_state *state)
+{
+	unsigned long eax = flg2MWAIT(state->flags);
+
+	if (boot_cpu_has(X86_FEATURE_ARAT))
+		return false;
+
+	/*
+	 * Switch over to one-shot tick broadcast if the target C-state
+	 * is deeper than C1.
+	 */
+	return !!((eax >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK);
+}
+
 #ifdef CONFIG_ACPI_PROCESSOR_CSTATE
 #include <acpi/processor.h>
 
@@ -1210,20 +1224,6 @@ static bool __init intel_idle_acpi_cst_extract(void)
 	return false;
 }
 
-static bool __init intel_idle_state_needs_timer_stop(struct cpuidle_state *state)
-{
-	unsigned long eax = flg2MWAIT(state->flags);
-
-	if (boot_cpu_has(X86_FEATURE_ARAT))
-		return false;
-
-	/*
-	 * Switch over to one-shot tick broadcast if the target C-state
-	 * is deeper than C1.
-	 */
-	return !!((eax >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK);
-}
-
 static void __init intel_idle_init_cstates_acpi(struct cpuidle_driver *drv)
 {
 	int cstate, limit = min_t(int, CPUIDLE_STATE_MAX, acpi_state_table.count);
-- 
2.27.0


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

* Re: [PATCH] intel_idle: fix intel_idle_state_needs_timer_stop build failure
  2020-12-03 22:30 [PATCH] intel_idle: fix intel_idle_state_needs_timer_stop build failure Arnd Bergmann
@ 2020-12-03 23:12 ` Randy Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2020-12-03 23:12 UTC (permalink / raw)
  To: Arnd Bergmann, Jacob Pan, Len Brown, Peter Zijlstra, Rafael J. Wysocki
  Cc: Arnd Bergmann, Chen Yu, Borislav Petkov, Thomas Gleixner,
	linux-pm, linux-kernel

On 12/3/20 2:30 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The newly added function is defined inside of an #ifdef section but
> used outside, leading to a build failure:
> 
> drivers/idle/intel_idle.c:1510:7: error: implicit declaration of function 'intel_idle_state_needs_timer_stop' [-Werror,-Wimplicit-function-declaration]
>                 if (intel_idle_state_needs_timer_stop(&drv->states[drv->state_count]))
>                     ^
> 
> Move it ahead of the CONFIG_ACPI_PROCESSOR_CSTATE check.
> 
> Fixes: 6e1d2bc675bd ("intel_idle: Fix intel_idle() vs tracing")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/idle/intel_idle.c | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
> 

Peter has already fixed this one.

thanks.
-- 
~Randy


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

end of thread, other threads:[~2020-12-03 23:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 22:30 [PATCH] intel_idle: fix intel_idle_state_needs_timer_stop build failure Arnd Bergmann
2020-12-03 23:12 ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).