From patchwork Tue Jun 14 10:19:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9175445 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 9CBAB6075D for ; Tue, 14 Jun 2016 10:18:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CCA028047 for ; Tue, 14 Jun 2016 10:18:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81A38282DC; Tue, 14 Jun 2016 10:18:43 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E145828047 for ; Tue, 14 Jun 2016 10:18:42 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7A01B2666A8; Tue, 14 Jun 2016 12:18:41 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 1C97F261ABB; Tue, 14 Jun 2016 12:18:29 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3D782261B01; Tue, 14 Jun 2016 12:18:26 +0200 (CEST) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by alsa0.perex.cz (Postfix) with ESMTP id E201F2616C9 for ; Tue, 14 Jun 2016 12:18:19 +0200 (CEST) Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0MMWH0-1b4UlE0Lqo-008H5g; Tue, 14 Jun 2016 12:18:14 +0200 From: Arnd Bergmann To: Mark Brown Date: Tue, 14 Jun 2016 12:19:31 +0200 Message-ID: <24871235.njqcnbLnL2@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-22-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <5926900.hCFXH4RQH6@wuerfel> References: <5926900.hCFXH4RQH6@wuerfel> MIME-Version: 1.0 X-Provags-ID: V03:K0:zBRzr0q+TIuVNncvHjPbuqKLjM1sZxTDgRYLh1g783slz6HSccA WuzRQ6sxjTXNLXuyz6+z9qLhGInWItvkmK7nQJYFAB8V86+lj5g2pN/DMicKeKdsU4tm5i8 dpoygryyZ5CfhTo0T1jY1VeS0Bzhm6RLymOWLsgnGic6QtW034SSY76/oNEX3QAiM5o7W9t h+CAE12cnakUVCKEjg+Yw== X-UI-Out-Filterresults: notjunk:1; V01:K0:Lpr+aFrmN4A=:ubuuZduqyXEfaZnYWmd7F+ uwqJL3HqvS1QNiNyJk+8Q5chrbH0Q5jSFkF/RuOtZY7WCWxM4ap59NcefTSJClWHVeJ+7G1R2 xnByb4nPnU7oZQLVo/wy6GvYioNOzmbXbR07auFWlx35Ju/dtLbxHyhhsTYeJgK+GWAoLTtQI snTmxZz9w+fzAuRsamm6afWlVeO4N3mszIH7i71evx99VaQxFqXOMSXxuRFG11/rJsEYlj9Cj fOcG5PGaJqxTQhaJUOwKlzqCFP7wjEQZ7V0iczGq6qcRPDTHuSRdtxzgRLwXNHZSP4TiH1VJ6 a2v6ElWRms0dIIPcSG9K/38zf1R7t073JD+GrNlCDh4GVrQhb8rjrljTj7u2VOqTmvlS8PvQi SUMT9SFGNXUzom7EkiTy0qwaB7C/MRzuRAIs27zx3yq2fUnIBkBKsq9UXDIWAk1XFx815Qw66 fhOoouofVD+NoRobBMpupWSSEeETKMnWNAFvAK5THuGFbUmcgTIdA1pNQQ5VrcnBlAGfIKbaG zEdghPYAmB6PNC2YtMC/M4GdfmFj/qWKhvyTsM1HZu9ngJdDDRY+mLYos9ehxMnMpvGSDVSWr ZUppzWauXJNyMXm3KoSfMylz+Ta+qQRh2sbFuEi+CoKYeUsCFCA/7r1+QDBuQP3xlbmA1oPPb Vx23NdUYdgZa8k5E/BLj0+ZhMNPsvu1onNf0v7JTPfj9oQJ6YGFDvBozq4cOv/j886XgojnLi 8N6duu/h42NkGabl Cc: Ben Zhang , alsa-devel@alsa-project.org, John Hsu , Liam Girdwood , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 2/2] ASoC: nau8825: mark pm functions __maybe_unused X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Subject: [PATCH] ASoC: nau8825: mark pm functions __maybe_unused The newly added nau8825_dai_is_active() function is only called from the PM logic that is build-time conditional in this driver, so we get a warning when CONFIG_PM is disabled: sound/soc/codecs/nau8825.c:229:13: error: 'nau8825_dai_is_active' defined but not used [-Werror=unused-function] static bool nau8825_dai_is_active(struct nau8825 *nau8825) By replacing the #ifdef around the functions with a __maybe_unused annotation, the code becomes more robust to this kind of problem and we no longer get the warning while also slightly improving readability. Signed-off-by: Arnd Bergmann Fixes: b50455fab459 ("ASoC: nau8825: cross talk suppression measurement function") --- Like the first patch, this is for a warning that just appeared on today's linux-next. diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c index 4b0a1b8d9405..3f30e6ed210c 100644 --- a/sound/soc/codecs/nau8825.c +++ b/sound/soc/codecs/nau8825.c @@ -2216,8 +2216,7 @@ static int nau8825_set_bias_level(struct snd_soc_codec *codec, return 0; } -#ifdef CONFIG_PM -static int nau8825_suspend(struct snd_soc_codec *codec) +static int __maybe_unused nau8825_suspend(struct snd_soc_codec *codec) { struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); @@ -2229,7 +2228,7 @@ static int nau8825_suspend(struct snd_soc_codec *codec) return 0; } -static int nau8825_resume(struct snd_soc_codec *codec) +static int __maybe_unused nau8825_resume(struct snd_soc_codec *codec) { struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); @@ -2253,10 +2252,6 @@ static int nau8825_resume(struct snd_soc_codec *codec) return 0; } -#else -#define nau8825_suspend NULL -#define nau8825_resume NULL -#endif static struct snd_soc_codec_driver nau8825_codec_driver = { .probe = nau8825_codec_probe,