linux/drivers/scsi/ufs
Nathan Chancellor 1943edacef scsi: ufs-mediatek: Avoid using ret uninitialized in ufs_mtk_setup_clocks
When building with -Wsometimes-uninitialized, Clang warns:

drivers/scsi/ufs/ufs-mediatek.c:112:7: warning: variable 'ret' is used
uninitialized whenever 'if' condition is false
[-Wsometimes-uninitialized]
                if (on)
                    ^~
drivers/scsi/ufs/ufs-mediatek.c:120:9: note: uninitialized use occurs
here
        return ret;
               ^~~
drivers/scsi/ufs/ufs-mediatek.c:112:3: note: remove the 'if' if its
condition is always true
                if (on)
                ^~~~~~~
drivers/scsi/ufs/ufs-mediatek.c:108:7: warning: variable 'ret' is used
uninitialized whenever 'if' condition is false
[-Wsometimes-uninitialized]
                if (!on)
                    ^~~
drivers/scsi/ufs/ufs-mediatek.c:120:9: note: uninitialized use occurs
here
        return ret;
               ^~~
drivers/scsi/ufs/ufs-mediatek.c:108:3: note: remove the 'if' if its
condition is always true
                if (!on)
                ^~~~~~~~
drivers/scsi/ufs/ufs-mediatek.c:96:9: note: initialize the variable
'ret' to silence this warning
        int ret;
               ^
                = 0
2 warnings generated.

Remove the default case and initialize ret to -EINVAL to properly fix
this warning.

Fixes: ddd90623ce ("scsi: ufs-mediatek: Add UFS support for Mediatek SoC chips")
Link: https://github.com/ClangBuiltLinux/linux/issues/426
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-03-20 20:09:27 -04:00
..
cdns-pltfrm.c scsi: ufs: Fix platform_no_drv_owner.cocci warnings 2018-12-12 21:37:56 -05:00
Kconfig scsi: ufs-mediatek: Add UFS support for Mediatek SoC chips 2019-03-19 16:56:21 -04:00
Makefile scsi: ufs-mediatek: Add UFS support for Mediatek SoC chips 2019-03-19 16:56:21 -04:00
tc-dwc-g210-pci.c scsi: ufs: Fix kernel-doc errors and warnings 2018-03-01 21:00:23 -05:00
tc-dwc-g210-pltfrm.c scsi: ufs: Fix kernel-doc errors and warnings 2018-03-01 21:00:23 -05:00
tc-dwc-g210.c
tc-dwc-g210.h
ufs_bsg.c scsi: ufs-bsg: Allow reading descriptors 2019-02-27 09:00:02 -05:00
ufs_bsg.h scsi: ufs: Add a bsg endpoint that supports UPIUs 2018-10-10 23:09:46 -04:00
ufs_quirks.h scsi: ufs: Remove unused device quirks 2019-02-27 08:54:57 -05:00
ufs-hisi.c scsi: ufs-hisi: Re-factor ufshcd_get_pwr_dev_param 2019-03-19 16:56:21 -04:00
ufs-hisi.h scsi: ufs: Add HI3670 SoC UFS driver support 2019-02-19 18:58:34 -05:00
ufs-mediatek.c scsi: ufs-mediatek: Avoid using ret uninitialized in ufs_mtk_setup_clocks 2019-03-20 20:09:27 -04:00
ufs-mediatek.h scsi: ufs-mediatek: Add UFS support for Mediatek SoC chips 2019-03-19 16:56:21 -04:00
ufs-qcom.c scsi: ufs-qcom: Re-factor ufshcd_get_pwr_dev_param 2019-03-19 16:56:21 -04:00
ufs-qcom.h scsi/ufs: qcom: Remove ufs_qcom_phy_*() calls from host 2018-09-26 13:09:37 +05:30
ufs-sysfs.c scsi: ufs: Add support for Auto-Hibernate Idle Timer 2018-03-21 21:21:25 -04:00
ufs-sysfs.h scsi: ufs: sysfs: attributes 2018-02-15 18:35:05 -05:00
ufs.h SCSI misc on 20190306 2019-03-09 16:53:47 -08:00
ufshcd-dwc.c scsi: ufs: fix a typo in comment 2019-02-12 22:03:11 -05:00
ufshcd-dwc.h
ufshcd-pci.c scsi: ufs: Fix kernel-doc errors and warnings 2018-03-01 21:00:23 -05:00
ufshcd-pltfrm.c scsi: ufs: Introduce ufshcd_get_pwr_dev_param 2019-03-19 16:56:20 -04:00
ufshcd-pltfrm.h scsi: ufs: Introduce ufshcd_get_pwr_dev_param 2019-03-19 16:56:20 -04:00
ufshcd.c SCSI misc on 20190306 2019-03-09 16:53:47 -08:00
ufshcd.h scsi: ufs: hisi: fix ufs_hba_variant_ops passing 2019-03-06 19:26:45 -05:00
ufshci-dwc.h
ufshci.h scsi: ufs: cleanup struct utp_task_req_desc 2018-10-10 23:09:46 -04:00
unipro.h