All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] riscv: sifive: fu540: redundant initialization
@ 2020-08-03 21:09 Heinrich Schuchardt
  2020-08-04  1:45 ` Bin Meng
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Heinrich Schuchardt @ 2020-08-03 21:09 UTC (permalink / raw)
  To: u-boot

We should not initialize a variable if the value is overwritten before
being read.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 arch/riscv/cpu/fu540/cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/cpu/fu540/cache.c b/arch/riscv/cpu/fu540/cache.c
index 9ee364b509..54de14238c 100644
--- a/arch/riscv/cpu/fu540/cache.c
+++ b/arch/riscv/cpu/fu540/cache.c
@@ -22,7 +22,7 @@ DECLARE_GLOBAL_DATA_PTR;
 int cache_enable_ways(void)
 {
 	const void *blob = gd->fdt_blob;
-	int node = (-FDT_ERR_NOTFOUND);
+	int node;
 	fdt_addr_t base;
 	u32 config;
 	u32 ways;
--
2.27.0

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

* [PATCH 1/1] riscv: sifive: fu540: redundant initialization
  2020-08-03 21:09 [PATCH 1/1] riscv: sifive: fu540: redundant initialization Heinrich Schuchardt
@ 2020-08-04  1:45 ` Bin Meng
  2020-08-04  5:50 ` Pragnesh Patel
       [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FA4730291@ATCPCS16.andestech.com>
  2 siblings, 0 replies; 4+ messages in thread
From: Bin Meng @ 2020-08-04  1:45 UTC (permalink / raw)
  To: u-boot

On Tue, Aug 4, 2020 at 5:10 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> We should not initialize a variable if the value is overwritten before
> being read.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  arch/riscv/cpu/fu540/cache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bin.meng@windriver.com>

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

* [PATCH 1/1] riscv: sifive: fu540: redundant initialization
  2020-08-03 21:09 [PATCH 1/1] riscv: sifive: fu540: redundant initialization Heinrich Schuchardt
  2020-08-04  1:45 ` Bin Meng
@ 2020-08-04  5:50 ` Pragnesh Patel
       [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FA4730291@ATCPCS16.andestech.com>
  2 siblings, 0 replies; 4+ messages in thread
From: Pragnesh Patel @ 2020-08-04  5:50 UTC (permalink / raw)
  To: u-boot

>-----Original Message-----
>From: Heinrich Schuchardt <xypron.glpk@gmx.de>
>Sent: 04 August 2020 02:40
>To: Rick Chen <rick@andestech.com>
>Cc: Pragnesh Patel <pragnesh.patel@sifive.com>; Bin Meng
><bmeng.cn@gmail.com>; u-boot at lists.denx.de; Heinrich Schuchardt
><xypron.glpk@gmx.de>
>Subject: [PATCH 1/1] riscv: sifive: fu540: redundant initialization
>
>[External Email] Do not click links or attachments unless you recognize the
>sender and know the content is safe
>
>We should not initialize a variable if the value is overwritten before being read.
>
>Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>---
> arch/riscv/cpu/fu540/cache.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Tested-by: Pragnesh Patel <pragnesh.patel@sifive.com>

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

* [PATCH 1/1] riscv: sifive: fu540: redundant initialization
       [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FA4730291@ATCPCS16.andestech.com>
@ 2020-08-04  8:46   ` Rick Chen
  0 siblings, 0 replies; 4+ messages in thread
From: Rick Chen @ 2020-08-04  8:46 UTC (permalink / raw)
  To: u-boot

> From: Heinrich Schuchardt [mailto:xypron.glpk at gmx.de]
> Sent: Tuesday, August 04, 2020 5:10 AM
> To: Rick Jian-Zhi Chen(???)
> Cc: Pragnesh Patel; Bin Meng; u-boot at lists.denx.de; Heinrich Schuchardt
> Subject: [PATCH 1/1] riscv: sifive: fu540: redundant initialization
>
> We should not initialize a variable if the value is overwritten before being read.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  arch/riscv/cpu/fu540/cache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Rick Chen <rick@andestech.com>

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

end of thread, other threads:[~2020-08-04  8:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-03 21:09 [PATCH 1/1] riscv: sifive: fu540: redundant initialization Heinrich Schuchardt
2020-08-04  1:45 ` Bin Meng
2020-08-04  5:50 ` Pragnesh Patel
     [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FA4730291@ATCPCS16.andestech.com>
2020-08-04  8:46   ` Rick Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.