From: Arnd Bergmann <arnd@arndb.de>
To: Felipe Balbi <balbi@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dwc3: make PM functions as __maybe_unused
Date: Wed, 16 Nov 2016 17:08:45 +0100 [thread overview]
Message-ID: <12901342.P3on6xiMtS@wuerfel> (raw)
In-Reply-To: <87polvu177.fsf@linux.intel.com>
On Wednesday, November 16, 2016 1:13:48 PM CET Felipe Balbi wrote:
> Arnd Bergmann <arnd@arndb.de> writes:
> > A change to the suspend/resume handling in dwc3-pci introduced a
> > harmless warning:
> >
> > drivers/usb/dwc3/dwc3-pci.c:169:12: error: ‘dwc3_pci_dsm’ defined but not used [-Werror=unused-function]
> >
> > Replacing the #ifdef around the PM functions with __maybe_unused
> > annotations is the easiest way to make sure this doesn't happen
> > again. A similar problem happened two months earlier and we
> > ended up updating the #ifdef, but as it has come back now,
> > I'd suggest going back to my earlier approach.
> >
> > Fixes: 9cecca75b5a0 ("usb: dwc3: pci: call _DSM for suspend/resume")
> > Link: https://patchwork.kernel.org/patch/9318887/
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> I'll just move the ifdef around. We really need a real fix for this. Why
> couldn't we just always add PM callbacks and assume they won't be used
> if !PM && !PM_SLEEP?
I fully agree. This is now the most common warning that gets added
to linux-next, and there are sometimes several new ones on one day, so
I'm playing whack-a-mole here.
I have a rough plan for a proper solution already, but it's going to
be hard to do since there are so many drivers using the current
method. See https://www.mail-archive.com/netdev@vger.kernel.org/msg136759.html
for what I suggested last week.
> Adding __maybe_unused everywhere is rather unelegant
I agree, we shouldn't need the #ifdef or the __maybe_unused. I always
use the latter since it's easier to get right. In this particular case,
if you had applied the original patch, it the warning would not have
come back now.
Arnd
prev parent reply other threads:[~2016-11-16 16:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-15 16:05 [PATCH] dwc3: make PM functions as __maybe_unused Arnd Bergmann
2016-11-16 11:13 ` Felipe Balbi
2016-11-16 16:08 ` Arnd Bergmann [this message]
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=12901342.P3on6xiMtS@wuerfel \
--to=arnd@arndb.de \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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