lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a09EHDzjhz9dD9DPGujuBz-=RqhtTM58rqBedJVSxLFjg@mail.gmail.com>
Date:   Wed, 10 Jul 2019 16:19:41 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Zhang Rui <rui.zhang@...el.com>
Cc:     Eduardo Valentin <edubezval@...il.com>,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Linux PM list <linux-pm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drivers: thermal: processor_thermal: mark pm function __maybe_unused

On Wed, Jul 10, 2019 at 3:34 PM Zhang Rui <rui.zhang@...el.com> wrote:

>
> From 6c395f66e98c895cf3ebf87c0b2fc63b6a57a196 Mon Sep 17 00:00:00 2001
> From: Zhang Rui <rui.zhang@...el.com>
> Date: Tue, 9 Jul 2019 21:19:12 +0800
> Subject: [PATCH] drivers: thermal: processor_thermal_device: Fix build warning
>
> As a system sleep callback, proc_thermal_resume() should be defined only
> if CONFIG_PM_SLEEP is set.
>
> This fixes a build warning when CONFIG_PM_SLEEP is not set,
> 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)
>
> Fixes: aaba9791fbb4 ("drivers: thermal: processor_thermal: Read PPCC on resume")
> Reported-by: Arnd Bergmann <arnd@...db.de>
> Signed-off-by: Zhang Rui <rui.zhang@...el.com>

This looks correct to me as well.

> ---
>  drivers/thermal/intel/int340x_thermal/processor_thermal_device.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> index a3210f0..77dae1e 100644
> --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
> @@ -443,6 +443,7 @@ static void  proc_thermal_pci_remove(struct pci_dev *pdev)
>         pci_disable_device(pdev);
>  }
>
> +#ifdef CONFIG_PM_SLEEP
>  static int proc_thermal_resume(struct device *dev)
>  {
>         struct proc_thermal_device *proc_dev;
> @@ -452,6 +453,9 @@ static int proc_thermal_resume(struct device *dev)
>
>         return 0;
>  }
> +#else
> +#define proc_thermal_resume NULL
> +#endif

I would suggest you drop the #else part though, as it is not needed here.

Please apply whichever version you find most readable otherwise.

Thanks,

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ