diff mbox series

x86/mce/therm_throt: mark throttle_active_work as __maybe_unused

Message ID 20191210203925.3119091-1-arnd@arndb.de (mailing list archive)
State New, archived
Headers show
Series x86/mce/therm_throt: mark throttle_active_work as __maybe_unused | expand

Commit Message

Arnd Bergmann Dec. 10, 2019, 8:39 p.m. UTC
throttle_active_work() is only called if CONFIG_SYSFS is set,
otherwise we get a harmless warning:

arch/x86/kernel/cpu/mce/therm_throt.c:238:13: error: 'throttle_active_work' defined but not used [-Werror=unused-function]

Mark the function as __maybe_unused to avoid the warning.

Fixes: f6656208f04e ("x86/mce/therm_throt: Optimize notifications of thermal throttle")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/kernel/cpu/mce/therm_throt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Srinivas Pandruvada Dec. 11, 2019, 6:26 p.m. UTC | #1
On Tue, 2019-12-10 at 21:39 +0100, Arnd Bergmann wrote:
> throttle_active_work() is only called if CONFIG_SYSFS is set,
> otherwise we get a harmless warning:
> 
> arch/x86/kernel/cpu/mce/therm_throt.c:238:13: error:
> 'throttle_active_work' defined but not used [-Werror=unused-function]
> 
> Mark the function as __maybe_unused to avoid the warning.
> 
> Fixes: f6656208f04e ("x86/mce/therm_throt: Optimize notifications of
> thermal throttle")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  arch/x86/kernel/cpu/mce/therm_throt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/cpu/mce/therm_throt.c
> b/arch/x86/kernel/cpu/mce/therm_throt.c
> index b38010b541d6..8963493a1e9e 100644
> --- a/arch/x86/kernel/cpu/mce/therm_throt.c
> +++ b/arch/x86/kernel/cpu/mce/therm_throt.c
> @@ -235,7 +235,7 @@ static void get_therm_status(int level, bool
> *proc_hot, u8 *temp)
>  	*temp = (msr_val >> 16) & 0x7F;
>  }
>  
> -static void throttle_active_work(struct work_struct *work)
> +static void __maybe_unused throttle_active_work(struct work_struct
> *work)
>  {
>  	struct _thermal_state *state =
> container_of(to_delayed_work(work),
>  						struct _thermal_state,
> therm_work);
diff mbox series

Patch

diff --git a/arch/x86/kernel/cpu/mce/therm_throt.c b/arch/x86/kernel/cpu/mce/therm_throt.c
index b38010b541d6..8963493a1e9e 100644
--- a/arch/x86/kernel/cpu/mce/therm_throt.c
+++ b/arch/x86/kernel/cpu/mce/therm_throt.c
@@ -235,7 +235,7 @@  static void get_therm_status(int level, bool *proc_hot, u8 *temp)
 	*temp = (msr_val >> 16) & 0x7F;
 }
 
-static void throttle_active_work(struct work_struct *work)
+static void __maybe_unused throttle_active_work(struct work_struct *work)
 {
 	struct _thermal_state *state = container_of(to_delayed_work(work),
 						struct _thermal_state, therm_work);