Re: [PATCH] drivers: thermal: processor_thermal: mark pm function __maybe_unused
From: Zhang Rui
Date: Wed Jul 10 2019 - 09:34:29 EST
Hi, Arnd,
thanks for the report.
On ä, 2019-07-08 at 14:47 +0200, Arnd Bergmann wrote:
> Without CONFIG_PM, we get a harmless warning:
>
> drivers/thermal/intel/int340x_thermal/processor_thermal_device.c:446:
> 12: error: 'proc_thermal_resume' defined but not used [-
> Werror=unused-function]
> Âstatic int proc_thermal_resume(struct device *dev)
>
> Mark it __maybe_unused to shut up the warning.
>
> Fixes: aaba9791fbb4 ("drivers: thermal: processor_thermal: Read PPCC
> on resume")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
> Â.../thermal/intel/int340x_thermal/processor_thermal_device.cÂÂÂÂ| 2
> +-
> Â1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git
> a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> index a3210f09f366..5ce639a99330 100644
> ---
> a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> +++
> b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> @@ -443,7 +443,7 @@ static voidÂÂproc_thermal_pci_remove(struct
> pci_dev *pdev)
> Â pci_disable_device(pdev);
> Â}
> Â
> -static int proc_thermal_resume(struct device *dev)
> +static int __maybe_unused proc_thermal_resume(struct device *dev)
> Â{
> Â struct proc_thermal_device *proc_dev;
> Â
I'd rather prefer to add #ifdef CONFIG_PM_SLEEP for
proc_thermal_resume().
Just like the patch below, what do you think?
thanks,
rui