linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] sdhci: arasan: fix uninitialized value being returned as error code
@ 2020-04-17 15:49 Colin King
  2020-04-20  6:08 ` Adrian Hunter
  2020-04-20  7:33 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2020-04-17 15:49 UTC (permalink / raw)
  To: Adrian Hunter, Michal Simek, Ulf Hansson, Manish Narani,
	linux-mmc, linux-arm-kernel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently the error return value in variable ret is not being initialized
and so a successful return path is returning a garbage value. Since ret
is not being used the simple fix is just return 0 on a successful return.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: f73e66a36772 ("sdhci: arasan: Add support for Versal Tap Delays")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/mmc/host/sdhci-of-arasan.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index 16e26c217a77..45603ba515b2 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -735,7 +735,6 @@ static int sdhci_versal_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
 		container_of(clk_data, struct sdhci_arasan_data, clk_data);
 	struct sdhci_host *host = sdhci_arasan->host;
 	u8 tap_delay, tap_max = 0;
-	int ret;
 
 	/*
 	 * This is applicable for SDHCI_SPEC_300 and above
@@ -781,7 +780,7 @@ static int sdhci_versal_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
 		sdhci_writel(host, regval, SDHCI_ARASAN_OTAPDLY_REGISTER);
 	}
 
-	return ret;
+	return 0;
 }
 
 static const struct clk_ops versal_sdcardclk_ops = {
@@ -807,7 +806,6 @@ static int sdhci_versal_sampleclk_set_phase(struct clk_hw *hw, int degrees)
 		container_of(clk_data, struct sdhci_arasan_data, clk_data);
 	struct sdhci_host *host = sdhci_arasan->host;
 	u8 tap_delay, tap_max = 0;
-	int ret;
 
 	/*
 	 * This is applicable for SDHCI_SPEC_300 and above
@@ -857,7 +855,7 @@ static int sdhci_versal_sampleclk_set_phase(struct clk_hw *hw, int degrees)
 		sdhci_writel(host, regval, SDHCI_ARASAN_ITAPDLY_REGISTER);
 	}
 
-	return ret;
+	return 0;
 }
 
 static const struct clk_ops versal_sampleclk_ops = {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] sdhci: arasan: fix uninitialized value being returned as error code
  2020-04-17 15:49 [PATCH][next] sdhci: arasan: fix uninitialized value being returned as error code Colin King
@ 2020-04-20  6:08 ` Adrian Hunter
  2020-04-20  7:33 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Adrian Hunter @ 2020-04-20  6:08 UTC (permalink / raw)
  To: Colin King, Michal Simek, Ulf Hansson, Manish Narani, linux-mmc,
	linux-arm-kernel
  Cc: kernel-janitors, linux-kernel

On 17/04/20 6:49 pm, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the error return value in variable ret is not being initialized
> and so a successful return path is returning a garbage value. Since ret
> is not being used the simple fix is just return 0 on a successful return.
> 
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: f73e66a36772 ("sdhci: arasan: Add support for Versal Tap Delays")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

>  drivers/mmc/host/sdhci-of-arasan.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
> index 16e26c217a77..45603ba515b2 100644
> --- a/drivers/mmc/host/sdhci-of-arasan.c
> +++ b/drivers/mmc/host/sdhci-of-arasan.c
> @@ -735,7 +735,6 @@ static int sdhci_versal_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
>  		container_of(clk_data, struct sdhci_arasan_data, clk_data);
>  	struct sdhci_host *host = sdhci_arasan->host;
>  	u8 tap_delay, tap_max = 0;
> -	int ret;
>  
>  	/*
>  	 * This is applicable for SDHCI_SPEC_300 and above
> @@ -781,7 +780,7 @@ static int sdhci_versal_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
>  		sdhci_writel(host, regval, SDHCI_ARASAN_OTAPDLY_REGISTER);
>  	}
>  
> -	return ret;
> +	return 0;
>  }
>  
>  static const struct clk_ops versal_sdcardclk_ops = {
> @@ -807,7 +806,6 @@ static int sdhci_versal_sampleclk_set_phase(struct clk_hw *hw, int degrees)
>  		container_of(clk_data, struct sdhci_arasan_data, clk_data);
>  	struct sdhci_host *host = sdhci_arasan->host;
>  	u8 tap_delay, tap_max = 0;
> -	int ret;
>  
>  	/*
>  	 * This is applicable for SDHCI_SPEC_300 and above
> @@ -857,7 +855,7 @@ static int sdhci_versal_sampleclk_set_phase(struct clk_hw *hw, int degrees)
>  		sdhci_writel(host, regval, SDHCI_ARASAN_ITAPDLY_REGISTER);
>  	}
>  
> -	return ret;
> +	return 0;
>  }
>  
>  static const struct clk_ops versal_sampleclk_ops = {
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] sdhci: arasan: fix uninitialized value being returned as error code
  2020-04-17 15:49 [PATCH][next] sdhci: arasan: fix uninitialized value being returned as error code Colin King
  2020-04-20  6:08 ` Adrian Hunter
@ 2020-04-20  7:33 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2020-04-20  7:33 UTC (permalink / raw)
  To: Colin King
  Cc: Adrian Hunter, Michal Simek, Manish Narani, linux-mmc, Linux ARM,
	kernel-janitors, Linux Kernel Mailing List

On Fri, 17 Apr 2020 at 17:49, Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently the error return value in variable ret is not being initialized
> and so a successful return path is returning a garbage value. Since ret
> is not being used the simple fix is just return 0 on a successful return.
>
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: f73e66a36772 ("sdhci: arasan: Add support for Versal Tap Delays")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Thanks for the patch, but this time I have already applied [1] an
earlier fix for it.

Kind regards
Uffe

[...]

[1] https://patchwork.kernel.org/patch/11493633/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-20  7:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17 15:49 [PATCH][next] sdhci: arasan: fix uninitialized value being returned as error code Colin King
2020-04-20  6:08 ` Adrian Hunter
2020-04-20  7:33 ` Ulf Hansson

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).