* [PATCH -next] scsi: ufs: ufs-mediatek: Fix build error and type unmatch
@ 2022-06-19 11:54 Ren Zhijie
2022-06-19 14:11 ` Stanley Chu
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ren Zhijie @ 2022-06-19 11:54 UTC (permalink / raw)
To: stanley.chu, jejb, martin.petersen, matthias.bgg, powen.kao
Cc: linux-scsi, linux-mediatek, linux-kernel, linux-arm-kernel, Ren Zhijie
If CONFIG_PM_SLEEP 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_vreg_fix_vcc’:
drivers/ufs/host/ufs-mediatek.c:688:46: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]
snprintf(vcc_name, MAX_VCC_NAME, "vcc-opt%u", res.a1);
~^ ~~~~~~
%lu
drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_system_suspend’:
drivers/ufs/host/ufs-mediatek.c:1371:8: error: implicit declaration of function ‘ufshcd_system_suspend’; did you mean ‘ufs_mtk_system_suspend’? [-Werror=implicit-function-declaration]
ret = ufshcd_system_suspend(dev);
^~~~~~~~~~~~~~~~~~~~~
ufs_mtk_system_suspend
drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_system_resume’:
drivers/ufs/host/ufs-mediatek.c:1386:9: error: implicit declaration of function ‘ufshcd_system_resume’; did you mean ‘ufs_mtk_system_resume’? [-Werror=implicit-function-declaration]
return ufshcd_system_resume(dev);
^~~~~~~~~~~~~~~~~~~~
ufs_mtk_system_resume
cc1: some warnings being treated as errors
The declaration of func "ufshcd_system_suspend()" is depended on CONFIG_PM_SLEEP, so the function wrapper "ufs_mtk_system_suspend()" should warpped by CONFIG_PM_SLEEP too.
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 3fd23b8dfb54("scsi: ufs: ufs-mediatek: Fix the timing of configuring device regulators")
Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>
---
drivers/ufs/host/ufs-mediatek.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
index bfe04a4d1dce..4f1b30bf0c27 100644
--- a/drivers/ufs/host/ufs-mediatek.c
+++ b/drivers/ufs/host/ufs-mediatek.c
@@ -685,7 +685,7 @@ static int ufs_mtk_vreg_fix_vcc(struct ufs_hba *hba)
if (of_property_read_bool(np, "mediatek,ufs-vcc-by-num")) {
ufs_mtk_get_vcc_num(res);
if (res.a1 > UFS_VCC_NONE && res.a1 < UFS_VCC_MAX)
- snprintf(vcc_name, MAX_VCC_NAME, "vcc-opt%u", res.a1);
+ snprintf(vcc_name, MAX_VCC_NAME, "vcc-opt%lu", res.a1);
else
return -ENODEV;
} else if (of_property_read_bool(np, "mediatek,ufs-vcc-by-ver")) {
@@ -1363,6 +1363,7 @@ static int ufs_mtk_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_PM_SLEEP
int ufs_mtk_system_suspend(struct device *dev)
{
struct ufs_hba *hba = dev_get_drvdata(dev);
@@ -1385,6 +1386,7 @@ int ufs_mtk_system_resume(struct device *dev)
return ufshcd_system_resume(dev);
}
+#endif
int ufs_mtk_runtime_suspend(struct device *dev)
{
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next] scsi: ufs: ufs-mediatek: Fix build error and type unmatch
2022-06-19 11:54 [PATCH -next] scsi: ufs: ufs-mediatek: Fix build error and type unmatch Ren Zhijie
@ 2022-06-19 14:11 ` Stanley Chu
2022-06-22 1:01 ` Martin K. Petersen
2022-06-28 3:24 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Stanley Chu @ 2022-06-19 14:11 UTC (permalink / raw)
To: Ren Zhijie, jejb, martin.petersen, matthias.bgg, powen.kao
Cc: linux-scsi, linux-mediatek, linux-kernel, linux-arm-kernel
On Sun, 2022-06-19 at 19:54 +0800, Ren Zhijie wrote:
> If CONFIG_PM_SLEEP 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_vreg_fix_vcc’:
> drivers/ufs/host/ufs-mediatek.c:688:46: warning: format ‘%u’ expects
> argument of type ‘unsigned int’, but argument 4 has type ‘long
> unsigned int’ [-Wformat=]
> snprintf(vcc_name, MAX_VCC_NAME, "vcc-opt%u", res.a1);
> ~^ ~~~~~~
> %lu
> drivers/ufs/host/ufs-mediatek.c: In function
> ‘ufs_mtk_system_suspend’:
> drivers/ufs/host/ufs-mediatek.c:1371:8: error: implicit declaration
> of function ‘ufshcd_system_suspend’; did you mean
> ‘ufs_mtk_system_suspend’? [-Werror=implicit-function-declaration]
> ret = ufshcd_system_suspend(dev);
> ^~~~~~~~~~~~~~~~~~~~~
> ufs_mtk_system_suspend
> drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_system_resume’:
> drivers/ufs/host/ufs-mediatek.c:1386:9: error: implicit declaration
> of function ‘ufshcd_system_resume’; did you mean
> ‘ufs_mtk_system_resume’? [-Werror=implicit-function-declaration]
> return ufshcd_system_resume(dev);
> ^~~~~~~~~~~~~~~~~~~~
> ufs_mtk_system_resume
> cc1: some warnings being treated as errors
>
> The declaration of func "ufshcd_system_suspend()" is depended on
> CONFIG_PM_SLEEP, so the function wrapper "ufs_mtk_system_suspend()"
> should warpped by CONFIG_PM_SLEEP too.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: 3fd23b8dfb54("scsi: ufs: ufs-mediatek: Fix the timing of
> configuring device regulators")
> Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>
Thanks for the fix!
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] scsi: ufs: ufs-mediatek: Fix build error and type unmatch
2022-06-19 11:54 [PATCH -next] scsi: ufs: ufs-mediatek: Fix build error and type unmatch Ren Zhijie
2022-06-19 14:11 ` Stanley Chu
@ 2022-06-22 1:01 ` Martin K. Petersen
2022-06-28 3:24 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2022-06-22 1:01 UTC (permalink / raw)
To: Ren Zhijie
Cc: stanley.chu, jejb, martin.petersen, matthias.bgg, powen.kao,
linux-scsi, linux-mediatek, linux-kernel, linux-arm-kernel
Ren,
> If CONFIG_PM_SLEEP is not set.
>
> make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-, will be failed, like this:
Applied to 5.20/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] scsi: ufs: ufs-mediatek: Fix build error and type unmatch
2022-06-19 11:54 [PATCH -next] scsi: ufs: ufs-mediatek: Fix build error and type unmatch Ren Zhijie
2022-06-19 14:11 ` Stanley Chu
2022-06-22 1:01 ` Martin K. Petersen
@ 2022-06-28 3:24 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2022-06-28 3:24 UTC (permalink / raw)
To: matthias.bgg, stanley.chu, jejb, powen.kao, Ren Zhijie
Cc: Martin K . Petersen, linux-arm-kernel, linux-kernel,
linux-mediatek, linux-scsi
On Sun, 19 Jun 2022 19:54:32 +0800, Ren Zhijie wrote:
> If CONFIG_PM_SLEEP 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_vreg_fix_vcc’:
> drivers/ufs/host/ufs-mediatek.c:688:46: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]
> snprintf(vcc_name, MAX_VCC_NAME, "vcc-opt%u", res.a1);
> ~^ ~~~~~~
> %lu
> drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_system_suspend’:
> drivers/ufs/host/ufs-mediatek.c:1371:8: error: implicit declaration of function ‘ufshcd_system_suspend’; did you mean ‘ufs_mtk_system_suspend’? [-Werror=implicit-function-declaration]
> ret = ufshcd_system_suspend(dev);
> ^~~~~~~~~~~~~~~~~~~~~
> ufs_mtk_system_suspend
> drivers/ufs/host/ufs-mediatek.c: In function ‘ufs_mtk_system_resume’:
> drivers/ufs/host/ufs-mediatek.c:1386:9: error: implicit declaration of function ‘ufshcd_system_resume’; did you mean ‘ufs_mtk_system_resume’? [-Werror=implicit-function-declaration]
> return ufshcd_system_resume(dev);
> ^~~~~~~~~~~~~~~~~~~~
> ufs_mtk_system_resume
> cc1: some warnings being treated as errors
>
> [...]
Applied to 5.20/scsi-queue, thanks!
[1/1] scsi: ufs: ufs-mediatek: Fix build error and type unmatch
https://git.kernel.org/mkp/scsi/c/f54912b228a8
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-06-28 3:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-19 11:54 [PATCH -next] scsi: ufs: ufs-mediatek: Fix build error and type unmatch Ren Zhijie
2022-06-19 14:11 ` Stanley Chu
2022-06-22 1:01 ` Martin K. Petersen
2022-06-28 3:24 ` 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).