From patchwork Wed Jul 27 07:10:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9249313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8E35C6077C for ; Wed, 27 Jul 2016 07:11:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C16227AC2 for ; Wed, 27 Jul 2016 07:11:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7071427BEE; Wed, 27 Jul 2016 07:11:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35DC127BE5 for ; Wed, 27 Jul 2016 07:11:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751472AbcG0HKz (ORCPT ); Wed, 27 Jul 2016 03:10:55 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:64825 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751339AbcG0HKy (ORCPT ); Wed, 27 Jul 2016 03:10:54 -0400 Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0MeShL-1bf84j3whb-00QFUq; Wed, 27 Jul 2016 09:10:43 +0200 From: Arnd Bergmann To: Adrian Hunter Cc: Ulf Hansson , Dong Aisheng , Haibo Chen , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mmc: sdhci-esdhc-imx: avoid unused function warnings Date: Wed, 27 Jul 2016 09:10:41 +0200 Message-ID: <23920359.udOifghZQl@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-28-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20160726123246.879426-1-arnd@arndb.de> References: <20160726123246.879426-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:ccEMJhumxES90V05mnjbbciXcdl+QoKjoZp10SEtF/Uo4s5efhD rnjmW13L9moTpu9c9lr6txqD9dX00pl+JE1+/fLeA3O6VopTRzeaH1Bx5tDiNAI0Prod1nb fSP6trOkBnhy8TUp/Asaf28tow1PnTdN+nrLknSoAL6r8Xd5Yv5Yp8plADJzC03KNhRhuhj YyPnYfgDgHYuB2AbU0OSA== X-UI-Out-Filterresults: notjunk:1; V01:K0:M9hEJdpfxCA=:HT21o+bYFGvk6NBiqQnq0f OFKynNXLdsg9QEccdwcavC0l5PotmCDtqZZn49CQrqWDylBnE/klbyypoEZOCm54YH1DjndzL zLTosFWJYLeQ/fMd4WbUMbn9r2kSTzYOw4goRBjWOK29Y7soju5eGMk1ARbHnALoIw84TP0rV TDwzZ/s2R3b4k/1SpYECLzrekyzDgphaT6dWK/3cboVDrI7CZy0SIw7jIq//H00XksPfbOYGU aMmUzEqaBWi3d7YYA1Wz/ddRp4SLp3ZXC3Ww1B1++WiJf9biEeWofHaIpzV4gX/HOf1kkKUfc dUWxJeY7nc5kMNMzfM0cxMAgNw2ka9XQSw9v5NPdVe2h6IZ4m56Ch7zz5P6K8o8vUPYGESyye uFJYQTxJ3O8AtOZo+UdVo9HEwB3L2FHoMhtbq8bywxeDN5E/SppIkjTaZcgPZOs74DLjxIz5Z TwXex8dYCq0y+8xB4YzQcSE0RKZvMa1rB5bxUTJBpymiHuSiI5MhhgqWm5ns0OFvJpu4d7XGH cncJLoJl3CD1BEUhrH8+SXHznGabo1FKO+edSIZf2CcThFN1EKFYPG4E8Qx7f+LqvAEyspcuS aWjiLKkreADob1bQ30VuhB9CljmH3dfa47Qpuc0EPejQ5JwSAdIAxdXL97GEFthmBts9yKuA0 Ps6edoxTPXJUIZ/gWojFknc481yLNtC8CrzEjt2mWWIUFjsjL0rYH+2cQt2Ye39sWx5/5yA3Q bWCTSLS9z7zsH2le Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tuesday, July 26, 2016 2:32:34 PM CEST Arnd Bergmann wrote: > The driver has just gained a slightly incorrect pm-sleep implementation that causes > warnings when CONFIG_PM is set but CONFIG_PM_SLEEP is not: > > drivers/mmc/host/sdhci-esdhc-imx.c:1302:12: error: 'sdhci_esdhc_resume' defined but not used [-Werror=unused-function] > static int sdhci_esdhc_resume(struct device *dev) > ^~~~~~~~~~~~~~~~~~ > drivers/mmc/host/sdhci-esdhc-imx.c:1297:12: error: 'sdhci_esdhc_suspend' defined but not used [-Werror=unused-function] > static int sdhci_esdhc_suspend(struct device *dev) > > This replaces the incorrect #ifdef with a __maybe_unused annotation that does > the right thing in all configurations and is more readable. > > Signed-off-by: Arnd Bergmann > Fixes: b70d0b3b5b29 ("mmc: sdhci-esdhc-imx: add esdhc specific suspend resume callback") It turns out that the version of the fix above requires another change below. Fixing up the #ifdef as Ulf suggested would not require that, but on the other hand, we generally don't hide declarations in header files unless there is an alternative in the #else path, so we probably want to do that anyway. We could either fold this patch into the one I sent already, or have this one applied separately and use the version that Ulf preferred for the warning fix. I can send whichever we decide to do with a proper changelog once we have consensus. Signed-off-by: Arnd Bergmann --- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h index d38053bf9e4d..173ef914281d 100644 --- a/drivers/mmc/host/sdhci-pltfm.h +++ b/drivers/mmc/host/sdhci-pltfm.h @@ -109,9 +109,9 @@ static inline void *sdhci_pltfm_priv(struct sdhci_pltfm_host *host) return (void *)host->private; } -#ifdef CONFIG_PM extern int sdhci_pltfm_suspend(struct device *dev); extern int sdhci_pltfm_resume(struct device *dev); +#ifdef CONFIG_PM extern const struct dev_pm_ops sdhci_pltfm_pmops; #define SDHCI_PLTFM_PMOPS (&sdhci_pltfm_pmops) #else diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 0411c9f36461..9a77cb009fc8 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -686,12 +686,10 @@ void sdhci_set_bus_width(struct sdhci_host *host, int width); void sdhci_reset(struct sdhci_host *host, u8 mask); void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing); -#ifdef CONFIG_PM extern int sdhci_suspend_host(struct sdhci_host *host); extern int sdhci_resume_host(struct sdhci_host *host); extern void sdhci_enable_irq_wakeups(struct sdhci_host *host); extern int sdhci_runtime_suspend_host(struct sdhci_host *host); extern int sdhci_runtime_resume_host(struct sdhci_host *host); -#endif #endif /* __SDHCI_HW_H */