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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170110204117.GB4371@f23x64.localdomain>
Date:   Tue, 10 Jan 2017 12:41:17 -0800
From:   Darren Hart <dvhart@...radead.org>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] platform/x86: shut up unused-function warning

On Tue, Jan 10, 2017 at 04:28:47PM +0100, Arnd Bergmann wrote:
> The newly added driver guards its "resume" callback with an #ifdef CONFIG_PM
> that should be CONFIG_PM_SLEEP instead, leading to a warning in some configurations:
> 
> drivers/platform/x86/surface3-wmi.c:248:12: error: 's3_wmi_resume' defined but not used [-Werror=unused-function]
> 
> Using a __maybe_unused annotation without an #ifdef avoids the mistake more
> reliably.

Thanks Arnd,

This appears to be the preferred approach from coding-style.rst 20) Conditional
Compilation - we have some cleanup to do in this area I guess.

Queued to next, thanks.

> 
> Fixes: 3dda3b3798f9 ("platform/x86: Add custom surface3 platform device for controlling LID")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>  drivers/platform/x86/surface3-wmi.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/platform/x86/surface3-wmi.c b/drivers/platform/x86/surface3-wmi.c
> index cbf4d83a7271..6ac1d1349d7e 100644
> --- a/drivers/platform/x86/surface3-wmi.c
> +++ b/drivers/platform/x86/surface3-wmi.c
> @@ -244,13 +244,11 @@ static int s3_wmi_remove(struct platform_device *device)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_PM
> -static int s3_wmi_resume(struct device *dev)
> +static int __maybe_unused s3_wmi_resume(struct device *dev)
>  {
>  	s3_wmi_send_lid_state();
>  	return 0;
>  }
> -#endif
>  static SIMPLE_DEV_PM_OPS(s3_wmi_pm, NULL, s3_wmi_resume);
>  
>  static struct platform_driver s3_wmi_driver = {
> -- 
> 2.9.0
> 
> 

-- 
Darren Hart
Intel Open Source Technology Center

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ