From patchwork Thu Dec 15 16:38:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13074346 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0E0FC4167B for ; Thu, 15 Dec 2022 16:39:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=/zbA2YpO7YAjxIppeYULUtKEKy/MsouI8BdHxg32p/g=; b=eZuo04fnukDzpJ MVS/QNa32kRSdw2PfztbAHn+kBeMNhTRrd2B9C3X2/Vr97auRwOPJGy0thfxA/AD8RB+NtO9BYpHs RCAUn1WV47fLxbNTBAtq/FQEVl7W81ZABXLWbt/TUZROLiXS2gWJtzW1Ii1b5IGhn0danMtdz4LDI 6uO1yKBj48TyBV9oCx8KBdLfK9Qk9z37fGk/t1V0vEZ8HYhxzYMp0ZxvvsrHifXvmnxHZ3ECwzguF WlcoxWOT6L22rVWASaq0mJDqUfPi/adsLgciVcxuCLagrKy0/NQLiQ2x6fFHiPBciT8rHu3iXdOEg CC/NYM7ISiuS/Nji+Blw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5rFi-00ALpz-IJ; Thu, 15 Dec 2022 16:38:34 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5rFf-00ALp1-Rd for linux-arm-kernel@lists.infradead.org; Thu, 15 Dec 2022 16:38:33 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6C98EB81C03; Thu, 15 Dec 2022 16:38:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51DD5C433EF; Thu, 15 Dec 2022 16:38:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671122309; bh=LtPCFB4V5acknIfWU3F4wsNAnbz+KIAtyg0mtXMQWrM=; h=From:To:Cc:Subject:Date:From; b=i27Oha7ARR2shAbNBwOWm9Gvo6ud+O5kgC1Nt8Al88aXIaNkEciVfu4FIvMcC2f+S fIAGhucXXYmAHTR6uJpBTrbTLQxn+qTdB+GboCfhjioRLJVlxw5ZU8qiHU4PB9bC8B xLmz67VRT6YtM/ydtdjY1B4gK6zLHj/2VQzvtGCv5WHsv2w2DSxAvtVsklSfoRbKI5 gVdIuiHV91k9kjHv/WMUZ40p/62kLJeEZBk7GR8SkXJZ3gHUwGpnaH9iKJ76PeO8zb yD9AVHlg+Bvp2kCXy/D3Ez6/TWyCoMcJaJyyPM6taMfThURBwh1kyesXv6GkJt5Nwg kUcXf9fCJPXyg== From: Arnd Bergmann To: Dvorkin Dmitry , Wells Lu , Linus Walleij Cc: Arnd Bergmann , William Dean , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl: sp7021: fix unused function warning Date: Thu, 15 Dec 2022 17:38:10 +0100 Message-Id: <20221215163822.542622-1-arnd@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221215_083832_065887_8E9BA7F9 X-CRM114-Status: GOOD ( 13.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann sppctl_gpio_inv_get is only used from the debugfs code inside of an #ifdef, so we get a warning without that: drivers/pinctrl/sunplus/sppctl.c:393:12: error: 'sppctl_gpio_inv_get' defined but not used [-Werror=unused-function] 393 | static int sppctl_gpio_inv_get(struct gpio_chip *chip, unsigned int offset) | ^~~~~~~~~~~~~~~~~~~ Replace the #ifdef with an IS_ENABLED() check that avoids the warning. Fixes: aa74c44be19c ("pinctrl: Add driver for Sunplus SP7021") Signed-off-by: Arnd Bergmann --- drivers/pinctrl/sunplus/sppctl.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/sunplus/sppctl.c b/drivers/pinctrl/sunplus/sppctl.c index 2b3335ab56c6..25101293268f 100644 --- a/drivers/pinctrl/sunplus/sppctl.c +++ b/drivers/pinctrl/sunplus/sppctl.c @@ -499,7 +499,6 @@ static int sppctl_gpio_set_config(struct gpio_chip *chip, unsigned int offset, return 0; } -#ifdef CONFIG_DEBUG_FS static void sppctl_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) { const char *label; @@ -521,7 +520,6 @@ static void sppctl_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) seq_puts(s, "\n"); } } -#endif static int sppctl_gpio_new(struct platform_device *pdev, struct sppctl_pdata *pctl) { @@ -550,9 +548,8 @@ static int sppctl_gpio_new(struct platform_device *pdev, struct sppctl_pdata *pc gchip->get = sppctl_gpio_get; gchip->set = sppctl_gpio_set; gchip->set_config = sppctl_gpio_set_config; -#ifdef CONFIG_DEBUG_FS - gchip->dbg_show = sppctl_gpio_dbg_show; -#endif + gchip->dbg_show = IS_ENABLED(CONFIG_DEBUG_FS) ? + sppctl_gpio_dbg_show : NULL; gchip->base = -1; gchip->ngpio = sppctl_gpio_list_sz; gchip->names = sppctl_gpio_list_s;