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: <6515314.rRh5qNlOdM@wuerfel>
Date:   Wed, 07 Sep 2016 13:35:30 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Felipe Balbi <balbi@...nel.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        John Youn <John.Youn@...opsys.com>, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH for v4.8] usb: dwc3: mark PM function as __maybe_unused

On Wednesday, September 7, 2016 1:39:16 PM CEST Felipe Balbi wrote:
> 
> seems like it would've been enough to define dwc3_pci_pm_dummy() if
> CONFIG_PM_SLEEP. Right? IOW:
> 
> diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
> index 0a32430f4c41..6df0f5dad9a4 100644
> --- a/drivers/usb/dwc3/dwc3-pci.c
> +++ b/drivers/usb/dwc3/dwc3-pci.c
> @@ -249,7 +249,9 @@ static int dwc3_pci_runtime_resume(struct device *dev)
>  
>         return pm_runtime_get(&dwc3->dev);
>  }
> +#endif /* CONFIG_PM */
>  
> +#ifdef CONFIG_PM_SLEEP
>  static int dwc3_pci_pm_dummy(struct device *dev)
>  {
>         /*
> @@ -262,7 +264,7 @@ static int dwc3_pci_pm_dummy(struct device *dev)
>          */
>         return 0;
>  }
> -#endif /* CONFIG_PM */
> +#endif /* CONFIG_PM_SLEEP */
>  
>  static struct dev_pm_ops dwc3_pci_dev_pm_ops = {
>         SET_SYSTEM_SLEEP_PM_OPS(dwc3_pci_pm_dummy, dwc3_pci_pm_dummy)
> 
> Can you check if this is enough for you? Works just fine here.
> 

I'm sure this solves the problem too

Acked-by: Arnd Bergmann <arnd@...db.de>

I usually prefer the __maybe_unused annotation over the #ifdef
because it's much harder to get wrong, but I'm really only interested
in killing that last warning in the v4.8 kernel build at the
moment ;-)

I am getting a bit annoyed with seeing at least half a dozen such
bugs every week (in linux-next) and I have an idea for how to replace
SET_SYSTEM_SLEEP_PM_OPS() etc with something that doesn't need any
#ifdef of __maybe_unused, but that is a bigger chunk of work that
will require careful planning.

	Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ