diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2019-03-20 21:03:40 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-03-21 03:09:27 +0300 |
commit | 1943edacef8966e24fc66d8cbe6347fe8b10ff80 (patch) | |
tree | 4c2875c1ebfef150934b1ec67a2ba8e851ebb4c8 /drivers/target/target_core_configfs.c | |
parent | cbb24e26735f6142ba994b4d44fc2dcd54c3fe1f (diff) | |
download | linux-1943edacef8966e24fc66d8cbe6347fe8b10ff80.tar.xz |
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: ddd90623ce26 ("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>
Diffstat (limited to 'drivers/target/target_core_configfs.c')
0 files changed, 0 insertions, 0 deletions