From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Arnd Bergmann <arnd@arndb.de>, "David S. Miller" <davem@davemloft.net>
Cc: "Yoshihiro Kaneko" <ykaneko0929@gmail.com>,
"Kazuya Mizuguchi" <kazuya.mizuguchi.ks@renesas.com>,
"Simon Horman" <horms+renesas@verge.net.au>,
"Masaru Nagai" <masaru.nagai.vx@renesas.com>,
"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ravb: avoid unused function warnings
Date: Sun, 28 Aug 2016 00:48:10 +0300 [thread overview]
Message-ID: <31a6f978-0bb7-df20-ea81-2fc32c94b855@cogentembedded.com> (raw)
In-Reply-To: <d26d8354-3ea3-29b0-d40c-253dd023e1e9@cogentembedded.com>
Hello.
On 08/27/2016 01:48 AM, Sergei Shtylyov wrote:
>> When CONFIG_PM_SLEEP is disabled, we get a couple of harmless warnings:
>>
>> drivers/net/ethernet/renesas/ravb_main.c:2117:12: error: 'ravb_resume'
>> defined but not used [-Werror=unused-function]
>> drivers/net/ethernet/renesas/ravb_main.c:2104:12: error: 'ravb_suspend'
>> defined but not used [-Werror=unused-function]
>>
>> The simplest solution here is to replace the #ifdef with __maybe_unused
>> annotations, which lets the compiler do the right thing by itself.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> Fixes: 0184165b2f42 ("ravb: add sleep PM suspend/resume support")
>
> That was the patch I didn't review, sorry about that...
>
>> ---
>> drivers/net/ethernet/renesas/ravb_main.c | 14 ++++----------
>> 1 file changed, 4 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c
>> b/drivers/net/ethernet/renesas/ravb_main.c
>> index cad23ba06904..630536bc72f9 100644
>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> [...]
>> @@ -2166,17 +2165,12 @@ static const struct dev_pm_ops ravb_dev_pm_ops = {
>> SET_RUNTIME_PM_OPS(ravb_runtime_nop, ravb_runtime_nop, NULL)
>> };
>>
>> -#define RAVB_PM_OPS (&ravb_dev_pm_ops)
>> -#else
>> -#define RAVB_PM_OPS NULL
>> -#endif
>> -
>> static struct platform_driver ravb_driver = {
>> .probe = ravb_probe,
>> .remove = ravb_remove,
>> .driver = {
>> .name = "ravb",
>> - .pm = RAVB_PM_OPS,
>> + .pm = &ravb_dev_pm_ops,
>
> I guess it's safe to have this pointing to the 'struct dev_pm_ops' filled
> with NULLs? Looking at the PM code left me somewhat unsure...
Well, this means CONFIG_PM[_SLEEP] not defined anyway and the PM code
calling the methods absent, so it should be safe indeed...
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
MBR, Sergei
next prev parent reply other threads:[~2016-08-27 21:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-26 15:30 Arnd Bergmann
2016-08-26 22:48 ` Sergei Shtylyov
2016-08-27 21:48 ` Sergei Shtylyov [this message]
2016-08-31 6:32 ` David Miller
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=31a6f978-0bb7-df20-ea81-2fc32c94b855@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=horms+renesas@verge.net.au \
--cc=kazuya.mizuguchi.ks@renesas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=masaru.nagai.vx@renesas.com \
--cc=netdev@vger.kernel.org \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=ykaneko0929@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®