From patchwork Tue Aug 15 22:16:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13354364 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 4FC53C0015E for ; Tue, 15 Aug 2023 22:17:27 +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:Cc:To:Message-Id:MIME-Version:Subject: Date: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=IoX5oDs8iHPge/FogIxCmSlpv1NIrUV/AINDvppG0fk=; b=pgRlU/VsfCIUXY 1o6RSkGaTSRDxzCxUl+sqrLUzd4s7vSom1rer1w7zGAbd7FW7TOINzaOei6kag4BL1QiZW+bc0lnm XFPrMlOz8rghQrz9Lu6CC0IVNOj/wKOl6fYNhV8A01rsCSxajmMCmtIH/2M9adI6ywCpP1A51k9TD xJ8FMdpKoq55kFwQNV0d4vY9EddShlMWxZaSC7pOyI3jQZ+L6rugzRkuaqCceWowaaS8JTc4j8dGD ZUY+/DhiRiUkWmKCQSdDr1vL4n5c9M6YSg9HH94O6PL7B6DjbMtZ5eb2hyzhNbLkhDW4Ar15gCvBb heoIMgxrlGTqIJXk4n/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qW2LL-002hLB-2n; Tue, 15 Aug 2023 22:16:51 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qW2LI-002hKY-2z for linux-arm-kernel@lists.infradead.org; Tue, 15 Aug 2023 22:16:50 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2FF1162A47; Tue, 15 Aug 2023 22:16:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C56DC433C8; Tue, 15 Aug 2023 22:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692137807; bh=XwXvMZmSyw0Fultdv91spvUYs8G7JznbXwG0CGzyAxM=; h=From:Date:Subject:To:Cc:From; b=KaH3eQclvi001FrOcutYbDGQo7hpeSF0k96n1brchRa+PiK6n2Ae+08jPrhGrUg8T eGCnjPwfFEWv+aMO+PZtOQKDFyPKAdFvH/OSA/jtdlDAW4KZqzIs2CCVlesgdEr8Hh MTwHqy+4AcvB3zN7Fto4z2hfELMIGWO6M4uO+lrwREwp/cETpubtrlMs5hock/a7hQ cW6lJXtRXM2fhmXtByLyZjKJcHtJjUQb0IaZuON8+tszOg3o2QwPmXObWcboYaF5ge TMS6t95ODItsb5blWCaSKTaqKU3ogPmd6ZEZayY/9p48hBjFqAEqfR1M14/gQ4k2Li geulV0KHc0eWw== From: Nathan Chancellor Date: Tue, 15 Aug 2023 15:16:41 -0700 Subject: [PATCH] rtc: stm32: Use NOIRQ_SYSTEM_SLEEP_PM_OPS() MIME-Version: 1.0 Message-Id: <20230815-rtc-stm32-unused-pm-funcs-v1-1-82eb8e02d903@kernel.org> X-B4-Tracking: v=1; b=H4sIAEj522QC/x3MMQ6DMAxA0asgz1hKAq1Cr4IYWscpHkhRTBAS4 u5EHd/w/wnKWVjh1ZyQeReVX6qwbQM0v9OXUUI1OOM64+0D80ao29I5LKkoB1wXjCWR4mCC7z/ kyNgn1H7NHOX4v8fpum502a94awAAAA== To: a.zummo@towertech.it, alexandre.belloni@bootlin.com Cc: mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, arnd@arndb.de, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, patches@lists.linux.dev, Nathan Chancellor X-Mailer: b4 0.13-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2767; i=nathan@kernel.org; h=from:subject:message-id; bh=XwXvMZmSyw0Fultdv91spvUYs8G7JznbXwG0CGzyAxM=; b=owGbwMvMwCEmm602sfCA1DTG02pJDCm3f/rNPqfvaPfxjI/qv/SEwyGPJnwSUl0SduxYtgDPp S69U5dPdJSyMIhxMMiKKbJUP1Y9bmg45yzjjVOTYOawMoEMYeDiFICJbCxm+B/Vfi3Ps2eVwv+z d45+XBFroiSRWzq3mEllOSNb0qquM7wMv9kzPjClnctoZ5LVLOpb6rI3oe17fUy/WCuD88+wnYt X8QMA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230815_151649_176035_59F85266 X-CRM114-Status: GOOD ( 20.53 ) 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 After the switch to SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() and a subsequent fix, stm32_rtc_{suspend,resume}() are unused when CONFIG_PM_SLEEP is not set because SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() is a no-op in that configuration: drivers/rtc/rtc-stm32.c:904:12: error: 'stm32_rtc_resume' defined but not used [-Werror=unused-function] 904 | static int stm32_rtc_resume(struct device *dev) | ^~~~~~~~~~~~~~~~ drivers/rtc/rtc-stm32.c:894:12: error: 'stm32_rtc_suspend' defined but not used [-Werror=unused-function] 894 | static int stm32_rtc_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors The non-"SET_" version of this macro, NOIRQ_SYSTEM_SLEEP_PM_OPS(), is designed to handle this situation by only assigning the callbacks when CONFIG_PM_SLEEP is set while allowing the functions to appear used to the compiler. Switch to that macro to resolve the warnings. There is no functional change with this, as SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() is defined using NOIRQ_SYSTEM_SLEEP_PM_OPS() when CONFIG_PM_SLEEP is set. Signed-off-by: Nathan Chancellor Reviewed-by: Arnd Bergmann --- I am not sure what to do about a Fixes: tag for this change. I am not sure how Arnd triggered the error/warning in commit a69c610e13e2 ("rtc: stm32: remove incorrect #ifdef check"), since from what I can tell, SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() is only defined in terms of NOIRQ_SYSTEM_SLEEP_PM_OPS() when CONFIG_PM_SLEEP is set, so I am not sure how those functions could be absent in the source file but used in NOIRQ_SYSTEM_SLEEP_PM_OPS() when CONFIG_PM_SLEEP is unset... I could be missing something though. However, I think this change should have been done as part of commit fb9a7e5360dc ("rtc: stm32: change PM callbacks to "_noirq()"") because the "SET_" macros are deprecated and that would have made Arnd's change necessary so... assign an appropriate Fixes: tag based on that information as you will :) --- drivers/rtc/rtc-stm32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: 4f3688dca15053555ade31a785a9c75837a64fb8 change-id: 20230815-rtc-stm32-unused-pm-funcs-90d84bc2c016 Best regards, diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c index 3ce4b3d08155..76753c71d92e 100644 --- a/drivers/rtc/rtc-stm32.c +++ b/drivers/rtc/rtc-stm32.c @@ -923,7 +923,7 @@ static int stm32_rtc_resume(struct device *dev) } static const struct dev_pm_ops stm32_rtc_pm_ops = { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(stm32_rtc_suspend, stm32_rtc_resume) + NOIRQ_SYSTEM_SLEEP_PM_OPS(stm32_rtc_suspend, stm32_rtc_resume) }; static struct platform_driver stm32_rtc_driver = {