linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 -next] scsi: ufs: fix build warning without CONFIG_PM
@ 2021-06-17  3:13 YueHaibing
  2021-06-23  2:08 ` Martin K. Petersen
  2021-06-29  4:10 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2021-06-17  3:13 UTC (permalink / raw)
  To: alim.akhtar, avri.altman, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, YueHaibing

drivers/scsi/ufs/ufshcd.c:9770:12: warning: ‘ufshcd_rpmb_resume’ defined but not used [-Wunused-function]
 static int ufshcd_rpmb_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~
drivers/scsi/ufs/ufshcd.c:9037:12: warning: ‘ufshcd_wl_runtime_resume’ defined but not used [-Wunused-function]
 static int ufshcd_wl_runtime_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ufs/ufshcd.c:9017:12: warning: ‘ufshcd_wl_runtime_suspend’ defined but not used [-Wunused-function]
 static int ufshcd_wl_runtime_suspend(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~~~~

Move it into #ifdef block to fix this.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: Fix build error while CONFIG_PM_SLEEP is n

 drivers/scsi/ufs/ufshcd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index b87ff68aa9aa..708b3b62fc4d 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -8926,6 +8926,7 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
 	return ret;
 }
 
+#ifdef CONFIG_PM
 static int __ufshcd_wl_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
 {
 	int ret;
@@ -9052,6 +9053,7 @@ static int ufshcd_wl_runtime_resume(struct device *dev)
 
 	return ret;
 }
+#endif
 
 #ifdef CONFIG_PM_SLEEP
 static int ufshcd_wl_suspend(struct device *dev)
@@ -9766,6 +9768,7 @@ static inline int ufshcd_clear_rpmb_uac(struct ufs_hba *hba)
 	return ret;
 }
 
+#ifdef CONFIG_PM
 static int ufshcd_rpmb_resume(struct device *dev)
 {
 	struct ufs_hba *hba = wlun_dev_to_hba(dev);
@@ -9774,6 +9777,7 @@ static int ufshcd_rpmb_resume(struct device *dev)
 		ufshcd_clear_rpmb_uac(hba);
 	return 0;
 }
+#endif
 
 static const struct dev_pm_ops ufs_rpmb_pm_ops = {
 	SET_RUNTIME_PM_OPS(NULL, ufshcd_rpmb_resume, NULL)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 -next] scsi: ufs: fix build warning without CONFIG_PM
  2021-06-17  3:13 [PATCH v2 -next] scsi: ufs: fix build warning without CONFIG_PM YueHaibing
@ 2021-06-23  2:08 ` Martin K. Petersen
  2021-06-29  4:10 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-06-23  2:08 UTC (permalink / raw)
  To: YueHaibing
  Cc: alim.akhtar, avri.altman, jejb, martin.petersen, linux-scsi,
	linux-kernel


YueHaibing,

> drivers/scsi/ufs/ufshcd.c:9770:12: warning: ‘ufshcd_rpmb_resume’ defined but not used [-Wunused-function]
>  static int ufshcd_rpmb_resume(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~
> drivers/scsi/ufs/ufshcd.c:9037:12: warning: ‘ufshcd_wl_runtime_resume’ defined but not used [-Wunused-function]
>  static int ufshcd_wl_runtime_resume(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~~~~~~~
> drivers/scsi/ufs/ufshcd.c:9017:12: warning: ‘ufshcd_wl_runtime_suspend’ defined but not used [-Wunused-function]
>  static int ufshcd_wl_runtime_suspend(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~~~~~~~~

Applied to 5.14/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 -next] scsi: ufs: fix build warning without CONFIG_PM
  2021-06-17  3:13 [PATCH v2 -next] scsi: ufs: fix build warning without CONFIG_PM YueHaibing
  2021-06-23  2:08 ` Martin K. Petersen
@ 2021-06-29  4:10 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-06-29  4:10 UTC (permalink / raw)
  To: YueHaibing, jejb, avri.altman, alim.akhtar
  Cc: Martin K . Petersen, linux-scsi, linux-kernel

On Thu, 17 Jun 2021 11:13:26 +0800, YueHaibing wrote:

> drivers/scsi/ufs/ufshcd.c:9770:12: warning: ‘ufshcd_rpmb_resume’ defined but not used [-Wunused-function]
>  static int ufshcd_rpmb_resume(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~
> drivers/scsi/ufs/ufshcd.c:9037:12: warning: ‘ufshcd_wl_runtime_resume’ defined but not used [-Wunused-function]
>  static int ufshcd_wl_runtime_resume(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~~~~~~~
> drivers/scsi/ufs/ufshcd.c:9017:12: warning: ‘ufshcd_wl_runtime_suspend’ defined but not used [-Wunused-function]
>  static int ufshcd_wl_runtime_suspend(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~~~~~~~~
> 
> [...]

Applied to 5.14/scsi-queue, thanks!

[1/1] scsi: ufs: fix build warning without CONFIG_PM
      https://git.kernel.org/mkp/scsi/c/75d645a61cf9

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-29  4:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17  3:13 [PATCH v2 -next] scsi: ufs: fix build warning without CONFIG_PM YueHaibing
2021-06-23  2:08 ` Martin K. Petersen
2021-06-29  4:10 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).