[1/1] stm32mp1: rng: remove superfluous assignment
diff mbox series

Message ID 20200216091118.3838-1-xypron.glpk@gmx.de
State Accepted
Delegated to: Patrick Delaunay
Headers show
Series
  • [1/1] stm32mp1: rng: remove superfluous assignment
Related show

Commit Message

Heinrich Schuchardt Feb. 16, 2020, 9:11 a.m. UTC
We should not assign a value that is overwritten before use.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/rng/stm32mp1_rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.25.0

Comments

Sughosh Ganu Feb. 18, 2020, 10:22 a.m. UTC | #1
On Sun, 16 Feb 2020 at 14:41, Heinrich Schuchardt <xypron.glpk@gmx.de>
wrote:

> We should not assign a value that is overwritten before use.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>

Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>


> ---
>  drivers/rng/stm32mp1_rng.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rng/stm32mp1_rng.c b/drivers/rng/stm32mp1_rng.c
> index dab3b995eb..e0f0a66c6e 100644
> --- a/drivers/rng/stm32mp1_rng.c
> +++ b/drivers/rng/stm32mp1_rng.c
> @@ -33,7 +33,7 @@ struct stm32_rng_platdata {
>
>  static int stm32_rng_read(struct udevice *dev, void *data, size_t len)
>  {
> -       int retval = 0, i;
> +       int retval, i;
>         u32 sr, count, reg;
>         size_t increment;
>         struct stm32_rng_platdata *pdata = dev_get_platdata(dev);
> --
> 2.25.0
>
>
Patrick Delaunay Feb. 24, 2020, 5:22 p.m. UTC | #2
Hi,

> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Heinrich Schuchardt
> Sent: dimanche 16 février 2020 10:11
> 
> We should not assign a value that is overwritten before use.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/rng/stm32mp1_rng.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rng/stm32mp1_rng.c b/drivers/rng/stm32mp1_rng.c index
> dab3b995eb..e0f0a66c6e 100644
> --- a/drivers/rng/stm32mp1_rng.c
> +++ b/drivers/rng/stm32mp1_rng.c
> @@ -33,7 +33,7 @@ struct stm32_rng_platdata {
> 
>  static int stm32_rng_read(struct udevice *dev, void *data, size_t len)  {
> -	int retval = 0, i;
> +	int retval, i;
>  	u32 sr, count, reg;
>  	size_t increment;
>  	struct stm32_rng_platdata *pdata = dev_get_platdata(dev);
> --
> 2.25.0

Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>

Regards
Patrick
Patrick Delaunay March 2, 2020, 8:33 a.m. UTC | #3
Hi,

> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Heinrich Schuchardt
> Sent: dimanche 16 février 2020 10:11
> 
> We should not assign a value that is overwritten before use.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---

Applied to u-boot-stm32/master, thanks!

Regards
Patrick

Patch
diff mbox series

diff --git a/drivers/rng/stm32mp1_rng.c b/drivers/rng/stm32mp1_rng.c
index dab3b995eb..e0f0a66c6e 100644
--- a/drivers/rng/stm32mp1_rng.c
+++ b/drivers/rng/stm32mp1_rng.c
@@ -33,7 +33,7 @@  struct stm32_rng_platdata {

 static int stm32_rng_read(struct udevice *dev, void *data, size_t len)
 {
-	int retval = 0, i;
+	int retval, i;
 	u32 sr, count, reg;
 	size_t increment;
 	struct stm32_rng_platdata *pdata = dev_get_platdata(dev);