From patchwork Mon Jul 4 02:56:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ren Zhijie X-Patchwork-Id: 12904616 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 6C1B2C433EF for ; Mon, 4 Jul 2022 02:59: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=CsukxuE2P8jWupc4D5qBtYJ/PwXCrhcaeYH4PaXVQNI=; b=wVl/hsAUDnEnM79pCpUXBiRiyE VtyHN5rwSEGtKY9+h3miu6eAhnK5DJ5MXAlKyRrF/77Hc1qW5httxShSGHBxXnJrhD5oL3SkLB4Lc Z1yDO1cZxOEUO10LgeUGOnsP8PzkSQnMSN8EhVZZ25gxmXL3DE3jyAr3h/DCFOEI+vUu0sptQIm6/ SpFzXeuJBB1UVjd7VSOn9ND0Gj6N2OBxmooPcr5SkswNkmRnxBKDSMnSvbMegvMMy6QQTjj17Qbd7 nhZBhiiV7wiVCG0vlNVwpyfcJwkAXoIL46V6uPwm0ZkpjFbPHZootzmugG/SwsH2A+f4RMVW0nvZB UNQDG6Aw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8CIw-003u8L-Sf; Mon, 04 Jul 2022 02:59:18 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8CIm-003tqr-2J; Mon, 04 Jul 2022 02:59:10 +0000 Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Lbr790KjpzkWlS; Mon, 4 Jul 2022 10:56:53 +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; Mon, 4 Jul 2022 10:58:23 +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; Mon, 4 Jul 2022 10:58:23 +0800 From: Ren Zhijie To: , , , , CC: , , , , "Ren Zhijie" Subject: [PATCH -next] scsi: ufs: ufs-mediatek: Fix build error Date: Mon, 4 Jul 2022 10:56:32 +0800 Message-ID: <20220704025632.235968-1-renzhijie2@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.175.34] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500008.china.huawei.com (7.185.36.147) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220703_195908_324870_11AD4D3E X-CRM114-Status: UNSURE ( 8.86 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org If CONFIG_PM is not set, make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-, will be failed, like this: drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_runtime_suspend’: drivers/ufs/host/ufs-mediatek.c:1435:8: error: implicit declaration of function ‘ufshcd_runtime_suspend’; did you mean ‘ufs_mtk_runtime_suspend’? [-Werror=implicit-function-declaration] ret = ufshcd_runtime_suspend(dev); ^~~~~~~~~~~~~~~~~~~~~~ ufs_mtk_runtime_suspend drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_runtime_resume’: drivers/ufs/host/ufs-mediatek.c:1450:9: error: implicit declaration of function ‘ufshcd_runtime_resume’; did you mean ‘ufs_mtk_runtime_resume’? [-Werror=implicit-function-declaration] return ufshcd_runtime_resume(dev); ^~~~~~~~~~~~~~~~~~~~~ ufs_mtk_runtime_resume At top level: drivers/ufs/host/ufs-mediatek.c:1444:12: error: ‘ufs_mtk_runtime_resume’ defined but not used [-Werror=unused-function] static int ufs_mtk_runtime_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~ drivers/ufs/host/ufs-mediatek.c:1430:12: error: ‘ufs_mtk_runtime_suspend’ defined but not used [-Werror=unused-function] static int ufs_mtk_runtime_suspend(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors The declarations of func "ufshcd_runtime_suspend()" and "ufshcd_runtime_resume()" depended on CONFIG_PM, so the function wrappers "ufs_mtk_runtime_suspend()" and "ufs_mtk_runtime_resume()" both should warpped by CONFIG_PM too. Reported-by: Hulk Robot Fixes: e7bf1d50063c ("scsi: ufs: ufs-mediatek: Fix build warnings") Signed-off-by: Ren Zhijie Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu --- drivers/ufs/host/ufs-mediatek.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c index c958279bdd8f..e006c2528a3a 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -1427,6 +1427,7 @@ static int ufs_mtk_system_resume(struct device *dev) } #endif +#ifdef CONFIG_PM static int ufs_mtk_runtime_suspend(struct device *dev) { struct ufs_hba *hba = dev_get_drvdata(dev); @@ -1449,6 +1450,7 @@ static int ufs_mtk_runtime_resume(struct device *dev) return ufshcd_runtime_resume(dev); } +#endif static const struct dev_pm_ops ufs_mtk_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(ufs_mtk_system_suspend,