From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E99F0C001B0 for ; Wed, 16 Aug 2023 13:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243971AbjHPNyH (ORCPT ); Wed, 16 Aug 2023 09:54:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235546AbjHPNxc (ORCPT ); Wed, 16 Aug 2023 09:53:32 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A5682110 for ; Wed, 16 Aug 2023 06:53:31 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id C68F0320092E; Wed, 16 Aug 2023 09:53:29 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Wed, 16 Aug 2023 09:53:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1692194009; x=1692280409; bh=Ii 4yG/ZcyE3q39VYUZ9Y40rpiAUHhEuHOoKZpmHnIVE=; b=XKQOm2vRAaeMr+s8ia bET6858Gma6hb0CAP8dE01xA+DqcXKFGMrEOvfVTh0+i2vJyn8htU0Xwl7Kn4vK3 5xgSDnQ7znZp6b0M10tQiV72JONEyKerZnlWEXwHcTQixD3WfmGznqNqStL021ER E5PUH8Mk07tqqmFuhJZ0bb483vknpjor3huVfhokUCNsmIfaLPcmS7jCQXx0aP62 T+s/6bfKSECdOPD9cQZjsAo+wMHET4RO2y0tmgzJiEYY6ecl7WYalBNb95kC9fW/ NbIw1889k1DkVlV+3SnrkLJQXwCElA1SN0Oo4//e8AK0ZbjUaH4MuF4EdtCjtoW2 tceA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1692194009; x=1692280409; bh=Ii4yG/ZcyE3q3 9VYUZ9Y40rpiAUHhEuHOoKZpmHnIVE=; b=fazCe2n5+x9PGnyaSSn7RwjPqyZVC 1ciHlLmGQP5bSXQ/00Bm2lXXR265/t3mANvGN6gbgaVWXExW6WdEzCw9YZICH3iA WKIvCsJOKhJt46Hruzyb51RNPQ84rOHaEn6eAiPxbKMHtswPXIU+1yZu988m2zUO CjXl4za2UZhtsN5+FCt4EdVhzGlc+opHsP/JrzCdbxJ54uzTC5qXubbljHivpHY8 Vx46Az8iooLs3nFlBLK/vyR0t3+no7lTiCjCscAm6fHxaCX3ySuZ7om6j7egv5wu N5EsVu3s7qx0ow0OydR+/Jf1V++kt/Sn3lr4uAOCxnYQ5Z5jxqxsQGZaw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddtledgjedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 68E88B6008D; Wed, 16 Aug 2023 09:53:28 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-624-g7714e4406d-fm-20230801.001-g7714e440 Mime-Version: 1.0 Message-Id: In-Reply-To: <20230815-rtc-stm32-unused-pm-funcs-v1-1-82eb8e02d903@kernel.org> References: <20230815-rtc-stm32-unused-pm-funcs-v1-1-82eb8e02d903@kernel.org> Date: Wed, 16 Aug 2023 15:53:07 +0200 From: "Arnd Bergmann" To: "Nathan Chancellor" , "Alessandro Zummo" , "Alexandre Belloni" Cc: "Maxime Coquelin" , "Alexandre Torgue" , linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, patches@lists.linux.dev Subject: Re: [PATCH] rtc: stm32: Use NOIRQ_SYSTEM_SLEEP_PM_OPS() Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org On Wed, Aug 16, 2023, at 00:16, Nathan Chancellor wrote: > 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. It was a mistake on my end: my randconfig tree has an experimental patch to clean up all 13 users of SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() that actually rely on the old behavior and changing the definition to be the same as NOIRQ_SYSTEM_SLEEP_PM_OPS. I should get back to that series and actually send out patches towards removing the deprecated helpers. Arnd