Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: sdhci-of-arasan: Remove uninitialized ret variables

Clang warns:

drivers/mmc/host/sdhci-of-arasan.c:784:9: warning: variable 'ret' is
uninitialized when used here [-Wuninitialized]
return ret;
^~~
drivers/mmc/host/sdhci-of-arasan.c:738:9: note: initialize the variable
'ret' to silence this warning
int ret;
^
= 0
drivers/mmc/host/sdhci-of-arasan.c:860:9: warning: variable 'ret' is
uninitialized when used here [-Wuninitialized]
return ret;
^~~
drivers/mmc/host/sdhci-of-arasan.c:810:9: note: initialize the variable
'ret' to silence this warning
int ret;
^
= 0
2 warnings generated.

This looks like a copy paste error. Neither function has handling that
needs ret so just remove it and return 0 directly.

Link: https://github.com/ClangBuiltLinux/linux/issues/996
Reported-by: kernelci.org bot <bot@kernelci.org>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20200416182402.16858-1-natechancellor@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Nathan Chancellor and committed by
Ulf Hansson
098c408b bcf89cb8

+2 -4
+2 -4
drivers/mmc/host/sdhci-of-arasan.c
··· 735 735 container_of(clk_data, struct sdhci_arasan_data, clk_data); 736 736 struct sdhci_host *host = sdhci_arasan->host; 737 737 u8 tap_delay, tap_max = 0; 738 - int ret; 739 738 740 739 /* 741 740 * This is applicable for SDHCI_SPEC_300 and above ··· 780 781 sdhci_writel(host, regval, SDHCI_ARASAN_OTAPDLY_REGISTER); 781 782 } 782 783 783 - return ret; 784 + return 0; 784 785 } 785 786 786 787 static const struct clk_ops versal_sdcardclk_ops = { ··· 806 807 container_of(clk_data, struct sdhci_arasan_data, clk_data); 807 808 struct sdhci_host *host = sdhci_arasan->host; 808 809 u8 tap_delay, tap_max = 0; 809 - int ret; 810 810 811 811 /* 812 812 * This is applicable for SDHCI_SPEC_300 and above ··· 855 857 sdhci_writel(host, regval, SDHCI_ARASAN_ITAPDLY_REGISTER); 856 858 } 857 859 858 - return ret; 860 + return 0; 859 861 } 860 862 861 863 static const struct clk_ops versal_sampleclk_ops = {