From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932981AbcKPQJC convert rfc822-to-8bit (ORCPT ); Wed, 16 Nov 2016 11:09:02 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:51918 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753151AbcKPQJA (ORCPT ); Wed, 16 Nov 2016 11:09:00 -0500 From: Arnd Bergmann To: Felipe Balbi Cc: Greg Kroah-Hartman , Heikki Krogerus , 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 Message-ID: <12901342.P3on6xiMtS@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <87polvu177.fsf@linux.intel.com> References: <20161115160555.847337-1-arnd@arndb.de> <87polvu177.fsf@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K0:E7ddlMbfN8vPMipmFfnibH+dtQXPirWT4ewEY23dyCph611zc9u QlN0HBYMYc96PSlO0QBtwhuCLpV8Fq+63kMMYpM2aN2LIC6I5cmBTAq0T86b2ENVcWzpZ46 3OBU5Sx4VpEoyd8YYu3FILTayXfKv+xZA3MACVe8BaSikXq9y3z6Ik1EndIHwiXOinYUJG8 6PP7enb6GTNJFaRKXZ20Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:7d+kbdY96Zc=:fNUT8WWTLWz0JbcGK6InS2 9WnAQbJE/A4+X9TuK00T653bPKY+PdRur8FkRbZUBr9WHrpqAE9qTSOYL/YVDbeOJv71HvJjP cCf6oG0AfIwbtwYLGS2kTg0+9Yjv70z/CQxWNnOkO6PmI4NnmFn8xo6i26Ko7kSTbUxQebWyR /LUKB+oeKu7hjIuWZlz700jAImaoIw5qJLQE6GA2O+1yfE2ifdO77MbPvyvQ+LARzG70JZq1H 7GFQ1vVrRnpqKdVpk7b2eFs6pJFM3dljpKLVD1uvHCCX3kvEhvh7kT6bYvuhh8xQkZWLkZVGL C7pfow5AusX5A3HNdEWTnLcrSusYhN6LP5SH0om12rKHa/QqXCrzpJ60sXN04UJVs+MOeafoE eyvc5MFq45OKCjAN8lBZx0T4of+SgmuTyVDDc3dX1OOEH3L2u3OnNByrEMRRbbAOFJI58FZSu k3+DGlCvL3TsKNKm7C91Cm9bamF+pZ6lNUNGi+RpRH00kmIzEn07AwUIVo+041B13Pbhniqmt utUvxHKMhkhj9udu8zrT4nekq88M7YEu7f6B6D75qHmKoJXOL104qRxzKOLnrapFEzJO09Zr/ MtHa+bvj+G/9RD8tOUkCfYx+3mOGOgmgTt4Lq5tzNHM76eFAHEGtq/9zWwUEFmG9myKemKBQ5 hWetde/U5CIdwgZSMToZAZTvzHD/+iRfQXH7OQlyZo6TOeftzciRwur2KNGjOYHq5KVIG5Rs3 v/EUdF8WkuYXCRWz Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, November 16, 2016 1:13:48 PM CET Felipe Balbi wrote: > Arnd Bergmann 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 > > 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