OSDN Git Service

scsi: ufs: ufs-mediatek: Fix build warnings
authorStanley Chu <stanley.chu@mediatek.com>
Thu, 23 Jun 2022 03:50:45 +0000 (11:50 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 28 Jun 2022 03:17:35 +0000 (23:17 -0400)
Fix build warnings:

1.
../drivers/ufs/host/ufs-mediatek.c:1375:5: error: no previous prototype for function 'ufs_mtk_system_suspend' [-Werror,-Wmissing-prototypes]
int ufs_mtk_system_suspend(struct device *dev)
    ^
../drivers/ufs/host/ufs-mediatek.c:1375:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int ufs_mtk_system_suspend(struct device *dev)
^
static

2.
../drivers/ufs/host/ufs-mediatek.c:702:50: error: format specifies type 'unsigned long' but the argument has type 'int' [-Werror,-Wformat]
                snprintf(vcc_name, MAX_VCC_NAME, "vcc-ufs%lu", ver);
                                                         ~~~   ^~~
                                                         %d

Link: https://lore.kernel.org/r/20220623035052.18802-2-stanley.chu@mediatek.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/host/ufs-mediatek.c

index 4f1b30b..0ec5883 100644 (file)
@@ -1364,7 +1364,7 @@ static int ufs_mtk_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM_SLEEP
-int ufs_mtk_system_suspend(struct device *dev)
+static int ufs_mtk_system_suspend(struct device *dev)
 {
        struct ufs_hba *hba = dev_get_drvdata(dev);
        int ret;
@@ -1378,7 +1378,7 @@ int ufs_mtk_system_suspend(struct device *dev)
        return 0;
 }
 
-int ufs_mtk_system_resume(struct device *dev)
+static int ufs_mtk_system_resume(struct device *dev)
 {
        struct ufs_hba *hba = dev_get_drvdata(dev);
 
@@ -1388,7 +1388,7 @@ int ufs_mtk_system_resume(struct device *dev)
 }
 #endif
 
-int ufs_mtk_runtime_suspend(struct device *dev)
+static int ufs_mtk_runtime_suspend(struct device *dev)
 {
        struct ufs_hba *hba = dev_get_drvdata(dev);
        int ret = 0;
@@ -1402,7 +1402,7 @@ int ufs_mtk_runtime_suspend(struct device *dev)
        return 0;
 }
 
-int ufs_mtk_runtime_resume(struct device *dev)
+static int ufs_mtk_runtime_resume(struct device *dev)
 {
        struct ufs_hba *hba = dev_get_drvdata(dev);