From nobody Tue Jun 23 20:23:30 2026 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 8507DC433F5 for ; Sun, 27 Feb 2022 19:02:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230444AbiB0TDH (ORCPT ); Sun, 27 Feb 2022 14:03:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiB0TDD (ORCPT ); Sun, 27 Feb 2022 14:03:03 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5C1A5FA3 for ; Sun, 27 Feb 2022 11:02:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:In-Reply-To:References; bh=YfQbssbJA1/QK0xiwfMG4SCzxBs35964gNoSR30NeXQ=; b=JczdytqmndjlTMd/bVQ5nSTOiP OMAYQx++3w03oJLNvZNBZzFSJA6N7eDVuQa/nhfACbj0kZ9RcBChuBEVyudafsQv/BrzR8pfuATm5 iesHKo7YSe24ONtbh92AnSX7twu2JnuHk8LcyNK+1Yvnh+C97PNDnOdJiAdF5XzSnqvq8QyJN1UsN eKHoBqfq9PkHtM2XhyesIGNiD4dzj9u52ASwHqzjLAfmJtMGUNjwiRD4g8oqXojJxDS59YcDJfr9E 55Du+wCSJHxDCR5h2Y/Uu4DxYHS5AGO5nktGCn0lSQFiDyav4ipKtvLEq2NKAY1Iox5mIWmyXcNYv BRV84GwQ==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOOoK-00A1Mx-Bh; Sun, 27 Feb 2022 19:02:24 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Wei WANG , Kai-Heng Feng , Greg Kroah-Hartman , Arnd Bergmann Subject: [PATCH -next v3] misc: rtsx: fix build for CONFIG_PM not set Date: Sun, 27 Feb 2022 11:02:23 -0800 Message-Id: <20220227190223.28789-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFG_WERROR=3Dy and CONFIG_PM is not set, there are fatal build errors, so use appropriate macros for SYSTEM_SLEEP and RUNTIME_SLEEP PM_OPS to prevent these. The #ifdef CONFIG_PM / #endif blocks can also be removed since any dead code will be dropped by them. ../drivers/misc/cardreader/rtsx_pcr.c:1057:13: error: =E2=80=98rtsx_enable_= aspm=E2=80=99 defined but not used [-Werror=3Dunused-function] static void rtsx_enable_aspm(struct rtsx_pcr *pcr) miscread001.out:../drivers/misc/cardreader/rtsx_pcr.c:1065:13: error: =E2= =80=98rtsx_comm_pm_power_saving=E2=80=99 defined but not used [-Werror=3Dun= used-function] miscread001.out: static void rtsx_comm_pm_power_saving(struct rtsx_pcr *pcr) ../drivers/misc/cardreader/rtsx_pcr.c:1084:13: error: =E2=80=98rtsx_pm_powe= r_saving=E2=80=99 defined but not used [-Werror=3Dunused-function] static void rtsx_pm_power_saving(struct rtsx_pcr *pcr) Fixes: 597568e8df04 ("misc: rtsx: Rework runtime power management flow") Signed-off-by: Randy Dunlap Cc: Wei WANG Cc: Kai-Heng Feng Cc: Greg Kroah-Hartman Suggested-by: Arnd Bergmann Paul Cercueil --- v3: Use SYSTEM_SLEEP_PM_OPS() and RUNTIME_PM_OPS() to avoid the build errors. This eliminates the need for #ifdef CONFIG_PM/#endif blocks of code and of __maybe_unused. drivers/misc/cardreader/rtsx_pcr.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) --- linux-next-20220225.orig/drivers/misc/cardreader/rtsx_pcr.c +++ linux-next-20220225/drivers/misc/cardreader/rtsx_pcr.c @@ -1699,7 +1699,6 @@ out: return ret; } =20 -#ifdef CONFIG_PM =20 static void rtsx_pci_shutdown(struct pci_dev *pcidev) { @@ -1784,17 +1783,10 @@ static int rtsx_pci_runtime_resume(struc return 0; } =20 -#else /* CONFIG_PM */ - -#define rtsx_pci_shutdown NULL -#define rtsx_pci_runtime_suspend NULL -#define rtsx_pic_runtime_resume NULL - -#endif /* CONFIG_PM */ - static const struct dev_pm_ops rtsx_pci_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(rtsx_pci_suspend, rtsx_pci_resume) - SET_RUNTIME_PM_OPS(rtsx_pci_runtime_suspend, rtsx_pci_runtime_resume, rts= x_pci_runtime_idle) + SYSTEM_SLEEP_PM_OPS(rtsx_pci_suspend, rtsx_pci_resume) + RUNTIME_PM_OPS(rtsx_pci_runtime_suspend, rtsx_pci_runtime_resume, + rtsx_pci_runtime_idle) }; =20 static struct pci_driver rtsx_pci_driver =3D {