public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Liu Ying <victor.liu@nxp•com>
To: Arnd Bergmann <arnd@arndb•de>,
	Stephen Rothwell <sfr@canb•auug.org.au>, Greg KH <greg@kroah•com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	linux-next <linux-next@vger•kernel.org>
Subject: Re: linux-next: build warnings after merge of the char-misc tree
Date: Mon, 14 Nov 2022 17:03:31 +0800	[thread overview]
Message-ID: <23be5d9c69ae758602b9de97d47f787fa104961d.camel@nxp.com> (raw)
In-Reply-To: <02828ff7-c734-4b55-b86e-5cc777e1a35b@app.fastmail.com>

Hi Arnd,

On Mon, 2022-11-14 at 08:33 +0100, Arnd Bergmann wrote:
> On Mon, Nov 14, 2022, at 08:17, Stephen Rothwell wrote:
> > Hi all,
> > 
> > After merging the char-misc tree, today's linux-next build (powerpc
> > allnoconfig) produced these warnings:
> > 
> > drivers/bus/simple-pm-bus.c:96:12: warning: 
> > 'simple_pm_bus_runtime_resume' defined but not used [-Wunused-function]
> >    96 | static int simple_pm_bus_runtime_resume(struct device *dev)
> >       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > drivers/bus/simple-pm-bus.c:87:12: warning: 
> > 'simple_pm_bus_runtime_suspend' defined but not used [-Wunused-function]
> >    87 | static int simple_pm_bus_runtime_suspend(struct device *dev)
> >       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 
> > Introduced by commit
> > 
> >   882cf4c913d7 ("drivers: bus: simple-pm-bus: Use clocks")
> 
> I see that this is caused by the patch using the old-style
> SET_RUNTIME_PM_OPS/SET_NOIRQ_SYSTEM_SLEEP_PM_OPS macros
> instead of the correct SYSTEM_SLEEP_PM_OPS/NOIRQ_SYSTEM_SLEEP_PM_OPS
> versions.
> 

You meant RUNTIME_PM_OPS/NOIRQ_SYSTEM_SLEEP_PM_OPS macros should be
used, right?

Why not add __maybe_unused to the callbacks like below snippet instead?
This way, the old-style macros may determine those callbacks are NULL
or non-NULL according to CONFIG_PM_SLEEP and CONFIG_PM.
-------------------------------8<-------------------------------------
--- a/drivers/bus/simple-pm-bus.c
+++ b/drivers/bus/simple-pm-bus.c
@@ -84,7 +84,7 @@ static int simple_pm_bus_remove(struct
platform_device *pdev)
        return 0;
 }

-static int simple_pm_bus_runtime_suspend(struct device *dev)
+static int __maybe_unused simple_pm_bus_runtime_suspend(struct device
*dev)
 {
        struct simple_pm_bus *bus = dev_get_drvdata(dev);

@@ -93,7 +93,7 @@ static int simple_pm_bus_runtime_suspend(struct
device *dev)
        return 0;
 }

-static int simple_pm_bus_runtime_resume(struct device *dev)
+static int __maybe_unused simple_pm_bus_runtime_resume(struct device
*dev)
 {
        struct simple_pm_bus *bus = dev_get_drvdata(dev);
        int ret;
-------------------------------8<-------------------------------------

Regards,
Liu Ying


  parent reply	other threads:[~2022-11-14  9:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14  7:17 linux-next: build warnings after merge of the char-misc tree Stephen Rothwell
2022-11-14  7:33 ` Arnd Bergmann
2022-11-14  9:02   ` Greg KH
2022-11-14  9:03   ` Liu Ying [this message]
2022-11-14  9:16     ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2025-11-14  4:39 Stephen Rothwell
2025-11-14  4:33 Stephen Rothwell
2021-01-11  3:42 Stephen Rothwell
2015-04-13  9:37 Stephen Rothwell
2015-04-13 10:43 ` Greg KH
2015-04-13 10:44   ` Winkler, Tomas
2015-04-13 10:47   ` Stephen Rothwell
2015-04-13 14:17   ` Steven Rostedt
2015-04-13 15:01   ` Steven Rostedt
2015-04-13 13:34 ` Greg KH

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=23be5d9c69ae758602b9de97d47f787fa104961d.camel@nxp.com \
    --to=victor.liu@nxp$(echo .)com \
    --cc=arnd@arndb$(echo .)de \
    --cc=greg@kroah$(echo .)com \
    --cc=gregkh@linuxfoundation$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=sfr@canb$(echo .)auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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