From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753046AbcG0Ha3 (ORCPT ); Wed, 27 Jul 2016 03:30:29 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:56685 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753637AbcG0HaW (ORCPT ); Wed, 27 Jul 2016 03:30:22 -0400 From: Arnd Bergmann To: Ulf Hansson Cc: Adrian Hunter , Dong Aisheng , Haibo Chen , linux-mmc , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] mmc: sdhci-esdhc-imx: avoid unused function warnings Date: Wed, 27 Jul 2016 09:30:04 +0200 Message-ID: <4495455.SxyUtqbGIN@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-28-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: <20160726123246.879426-1-arnd@arndb.de> <19008164.GYnbEcydYS@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:BL/QF0uJsYHRKmpnMgicfSWx/TerdCIv2J59GViFgvzzapbhAV6 fogOZ9CXok1ovR0sZS7zI/CtXMUBArMj6yEkzp9c97PT0m7OS5hg2mRmUmL75MYqPNVc3mF qo+qxzAfc/3kQado8zx+HoIY0/qt+AmrSSbjzCMGYBb4ub3ZdU2N7fHEhBtNq5kkgKImI3L 5lk6ibzlvXCpmRQvLGa2w== X-UI-Out-Filterresults: notjunk:1;V01:K0:nlxhifhNHVk=:KdhTQLXJN2VOg4jDxj2aqt vtle4j/HReQmBhoSlzr6uqIgcvCaAhOVPND6au/mK+sIQc3J3HQnt8blkCXsKQfJddCzp41r4 JCkc9WRJfyJaHMhS3iF0Sg1LqUYqaCXfa8HE0o0qbF+8AsqXsCkWpOKYT0VG3M5LQi4YDXM/z BHiuwJYunYZjcZ4ci/zYNQ97PlLthy76lGTMlQI983bsN3qHBq3zpn3t4YHI5Js80NY7mHTUd EUmsnt2E7lhtCLfesnKyk5Y3pmOITsSYkVQTZdyrf7uE6qrTceimCu1wwbq9LnVwNQK+bO6D8 cZhDOlLCJqNKmDFGRIg41y2UmNDqxiNRAG/Y/9rrzd1npSNakyIMnnTZbb+qYSd582unPjVgT uTnvU4qBcOyk9CBQilxq42nn9jFGj8HhZKpO203wmzthd9OibAZcZyNJvwd9cnMoX2O/EeAmY 6QosK2HXvSJLE2nyqwD9LSOtk33Cq486AQyzzit3VBhQBH5awT+bzIspQNMhjJLdFsDuS4QSN kigDOZ3i8klVVMTn4oHW5xRqU4sduAxjRNgk2hXj185m+zfUZ1+wbBitjMo6TKM0Z5ss+/VSJ xGQnbstcuQVmn/ZFhwUAi9f5sb5MG8UlCIqBkcOBw3cxraPoC00CoCrYOoxmP+Iag0U1gZoIo 76m87rd/5yspGbqg0YY9O70xi54qVtU3hys46dDLyESeraJMtdmxJv0kvNFXzBaD2cfIIR7tj Ao6BC6ECs3BnKPQi Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, July 27, 2016 12:48:23 AM CEST Ulf Hansson wrote: > On 26 July 2016 at 22:56, Arnd Bergmann wrote: > > On Tuesday, July 26, 2016 10:18:53 PM CEST Ulf Hansson wrote: > >> > diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c > >> > index 2bb326bbc34a..593e34053c4b 100644 > >> > --- a/drivers/mmc/host/sdhci-esdhc-imx.c > >> > +++ b/drivers/mmc/host/sdhci-esdhc-imx.c > >> > @@ -1293,13 +1293,12 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev) > >> > return 0; > >> > } > >> > > >> > -#ifdef CONFIG_PM > >> > -static int sdhci_esdhc_suspend(struct device *dev) > >> > +static int __maybe_unused sdhci_esdhc_suspend(struct device *dev) > >> > >> Instead of using __maybe_unused, I prefer to change above "#ifdef > >> CONFIG_PMf" to "#ifdef CONFIG_PM_SLEEP". > >> I do realize that the runtime PM callbacks still requires #ifdef > >> CONFIG_PM, so yes that's requires an extra "ifdef". > >> > >> Sure, it's more a matter of taste (and micro optimizations). > > > > I was hoping that we could eventually do a mass-conversion to > > __maybe_unused, as everybody seems to get the #ifdef wrong. > > > > Any specific reason for your preference? > > Only that this is how I get used to do it - and that it becomes a bit > more clear what is needed to support the various PM configurations. > > If you still insist on the "maybe_unused" option, that's okay as well. I only have a mild preference for __maybe_unused because it's harder to get wrong. I have sent dozens of bugfixes for drivers that have incorrect #ifdef, and I'd prefer not having to send that many in the future, so I try to convert them to __maybe_unused whenever a problem shows up to slowly change the coding style in the kernel. Build time coverage is another point here, but that is also what caused problems in my patch since the declarations were hidden (I assume not intentionally). Arnd