From nobody Fri Apr 17 18:25:26 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 ADE53C433EF for ; Sun, 24 Jul 2022 10:16:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231650AbiGXKQL (ORCPT ); Sun, 24 Jul 2022 06:16:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230321AbiGXKQJ (ORCPT ); Sun, 24 Jul 2022 06:16:09 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE991F5A2; Sun, 24 Jul 2022 03:16:07 -0700 (PDT) Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LrJsr6BWnzkWR3; Sun, 24 Jul 2022 18:13:36 +0800 (CST) Received: from dggpeml500008.china.huawei.com (7.185.36.147) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sun, 24 Jul 2022 18:16:05 +0800 Received: from huawei.com (10.67.175.34) by dggpeml500008.china.huawei.com (7.185.36.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sun, 24 Jul 2022 18:16:04 +0800 From: Ren Zhijie To: , , , , , CC: , , , Ren Zhijie Subject: [PATCH -next] PCI: imx6: Fix build error unused-function Date: Sun, 24 Jul 2022 18:13:53 +0800 Message-ID: <20220724101353.127875-1-renzhijie2@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.67.175.34] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500008.china.huawei.com (7.185.36.147) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_PM_SLEEP is not set, make ARCH=3Darm64 CROSS_COMPILE=3Daarch64-linux-gnu-, will be failed, like = this: drivers/pci/controller/dwc/pci-imx6.c:973:13: error: =E2=80=98imx6_pcie_hos= t_exit=E2=80=99 defined but not used [-Werror=3Dunused-function] static void imx6_pcie_host_exit(struct dw_pcie_rp *pp) ^~~~~~~~~~~~~~~~~~~ drivers/pci/controller/dwc/pci-imx6.c:904:13: error: =E2=80=98imx6_pcie_sto= p_link=E2=80=99 defined but not used [-Werror=3Dunused-function] static void imx6_pcie_stop_link(struct dw_pcie *pci) ^~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[4]: *** [drivers/pci/controller/dwc/pci-imx6.o] Error 1 These two functions imx6_pcie_host_exit() and imx6_pcie_stop_link() only be= called by imx6_pcie_suspend_noirq(), which was warpped by CONFIG_PM_SLEEP. To fix build error unused-function, use __maybe_unused to attach them. Fixes: 25ae5434c3de ("PCI: imx6: Reformat suspend callback to keep symmetri= c with resume") Signed-off-by: Ren Zhijie --- drivers/pci/controller/dwc/pci-imx6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller= /dwc/pci-imx6.c index 55e109d1ab27..533f5ef68e94 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -901,7 +901,7 @@ static int imx6_pcie_start_link(struct dw_pcie *pci) return 0; } =20 -static void imx6_pcie_stop_link(struct dw_pcie *pci) +static void __maybe_unused imx6_pcie_stop_link(struct dw_pcie *pci) { struct device *dev =3D pci->dev; =20 @@ -970,7 +970,7 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp) return ret; } =20 -static void imx6_pcie_host_exit(struct dw_pcie_rp *pp) +static void __maybe_unused imx6_pcie_host_exit(struct dw_pcie_rp *pp) { struct dw_pcie *pci =3D to_dw_pcie_from_pp(pp); struct imx6_pcie *imx6_pcie =3D to_imx6_pcie(pci); --=20 2.17.1