lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230221113808.1050790-1-zhangshida@kylinos.cn>
Date:   Tue, 21 Feb 2023 19:38:08 +0800
From:   Stephen Zhang <starzhangzsd@...il.com>
To:     stanley.chu@...iatek.com, martin.petersen@...cle.com,
        jejb@...ux.ibm.com, artin.petersen@...cle.com,
        matthias.bgg@...il.com, angelogioacchino.delregno@...labora.com,
        beanhuo@...ron.com, bvanassche@....org, avri.altman@....com,
        yoshihiro.shimoda.uh@...esas.com
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, zhangshida@...inos.cn,
        starzhangzsd@...il.com, k2ci <kernel-bot@...inos.cn>,
        Manivannan Sadhasivam <mani@...nel.org>
Subject: [PATCH v3] scsi: ufs: mediatek: Guard runtime PM functions

From: Shida Zhang <zhangshida@...inos.cn>

In a configuration with CONFIG_SCSI_UFS_MEDIATEK set to 'm' and
CONFIG_PM set to 'n', errors occur at compile time:

====
../drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_runtime_suspend’:
../drivers/ufs/host/ufs-mediatek.c:1621:8: error: implicit declaration of function ‘ufshcd_runtime_suspend’; did you mean ‘ufs_mtk_runtime_suspend’? [-Werror=implicit-function-declaration]
../drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_runtime_resume’:
../drivers/ufs/host/ufs-mediatek.c:1636:9: error: implicit declaration of function ‘ufshcd_runtime_resume’; did you mean ‘ufs_mtk_runtime_resume’? [-Werror=implicit-function-declaration]
====

Fix these errors by guarding the runtime PM functions with CONFIG_PM.

Reported-by: k2ci <kernel-bot@...inos.cn>
Signed-off-by: Shida Zhang <zhangshida@...inos.cn>
Reviewed-by: Manivannan Sadhasivam <mani@...nel.org>
---
Changes in v3
  Reword the subject and the commit message.
Changes in v2:
  Guard these functions with CONFIG_PM instead of selecting it.

 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 21d9b047539f..73e217260390 100644
--- a/drivers/ufs/host/ufs-mediatek.c
+++ b/drivers/ufs/host/ufs-mediatek.c
@@ -1613,6 +1613,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);
@@ -1635,6 +1636,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,
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ