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: 102221 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1967551qgf; Tue, 14 Jun 2016 03:18:28 -0700 (PDT) X-Received: by 10.66.80.134 with SMTP id r6mr27539577pax.66.1465899508243; Tue, 14 Jun 2016 03:18:28 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ag11si23582368pac.34.2016.06.14.03.18.27; Tue, 14 Jun 2016 03:18:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752478AbcFNKS0 (ORCPT + 30 others); Tue, 14 Jun 2016 06:18:26 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:59681 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbcFNKSY (ORCPT ); Tue, 14 Jun 2016 06:18:24 -0400 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 Cc: Liam Girdwood , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, John Hsu , Ben Zhang Subject: [PATCH 2/2] ASoC: nau8825: mark pm functions __maybe_unused 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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,