From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
To: balbi@ti.com, Fabio Estevam <fabio.estevam@freescale.com>
Cc: paulz@synopsys.com, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, Linux PM <linux-pm@vger.kernel.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: [PATCH] usb: dwc2: Fix build warning when CONFIG_PM_SLEEP=n
Date: Sat, 22 Nov 2014 02:18:14 +0100 [thread overview]
Message-ID: <546FE456.5030302@intel.com> (raw)
In-Reply-To: <20141119150148.GA5202@saruman>
On 11/19/2014 4:01 PM, Felipe Balbi wrote:
> HI,
>
> On Wed, Nov 19, 2014 at 12:37:53PM -0200, Fabio Estevam wrote:
>> Building with bcm2835_defconfig, which has CONFIG_PM_SLEEP=n causes the
>> following build warning:
>>
>> drivers/usb/dwc2/platform.c:227:12: warning: 'dwc2_suspend' defined but not used [-Wunused-function]
>> drivers/usb/dwc2/platform.c:237:12: warning: 'dwc2_resume' defined but not used [-Wunused-function]
>>
>> Annotate these functions with '__maybe_unused' to prevent the warnings.
>>
>> Reported-by: Olof's autobuilder <build@lixom.net>
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>> ---
>> drivers/usb/dwc2/platform.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
>> index 57eb8a3..ff0ed0b 100644
>> --- a/drivers/usb/dwc2/platform.c
>> +++ b/drivers/usb/dwc2/platform.c
>> @@ -224,7 +224,7 @@ static int dwc2_driver_probe(struct platform_device *dev)
>> return retval;
>> }
>>
>> -static int dwc2_suspend(struct device *dev)
>> +static int __maybe_unused dwc2_suspend(struct device *dev)
> that SET_SYSTEM_SLEEP_PM_OPS again.
>
> Rafael, do you mind taking a patch like below:
I might, but ->
> diff --git a/include/linux/pm.h b/include/linux/pm.h
> index 383fd68..928e295 100644
> --- a/include/linux/pm.h
> +++ b/include/linux/pm.h
> @@ -318,7 +318,6 @@ struct dev_pm_ops {
> int (*runtime_idle)(struct device *dev);
> };
>
> -#ifdef CONFIG_PM_SLEEP
> #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
> .suspend = suspend_fn, \
> .resume = resume_fn, \
> @@ -326,11 +325,7 @@ struct dev_pm_ops {
> .thaw = resume_fn, \
> .poweroff = suspend_fn, \
> .restore = resume_fn,
> -#else
> -#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
> -#endif
>
> -#ifdef CONFIG_PM_SLEEP
> #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
> .suspend_late = suspend_fn, \
> .resume_early = resume_fn, \
> @@ -338,27 +333,16 @@ struct dev_pm_ops {
> .thaw_early = resume_fn, \
> .poweroff_late = suspend_fn, \
> .restore_early = resume_fn,
> -#else
> -#define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
> -#endif
>
> -#ifdef CONFIG_PM_RUNTIME
> #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
> .runtime_suspend = suspend_fn, \
> .runtime_resume = resume_fn, \
> .runtime_idle = idle_fn,
> -#else
> -#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
> -#endif
>
> -#ifdef CONFIG_PM
> #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
> .runtime_suspend = suspend_fn, \
> .runtime_resume = resume_fn, \
> .runtime_idle = idle_fn,
> -#else
> -#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
> -#endif
>
> /*
> * Use this if you want to use the same suspend and resume callbacks for suspend
>
> nobody will ever build a kernel without CONFIG_PM
-> that is not true. The "tiny kernel" people what to be able to unset
CONFIG_PM in particular.
> or any of its friends anyway and all that ifdeferry or __maybe_unused just to silence
> compilers warnings are very annoying.
>
We are modifying the power Kconfig in 3.19-rc1 so that PM_SLEEP will
always select PM_RUNTIME, so some of the #ifdefs can safely go away.
Rafael
parent reply other threads:[~2014-11-22 1:18 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20141119150148.GA5202@saruman>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=546FE456.5030302@intel.com \
--to=rafael.j.wysocki@intel.com \
--cc=balbi@ti.com \
--cc=fabio.estevam@freescale.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=paulz@synopsys.com \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.