diff mbox series

[1/1] riscv: remove redundant logical constraint.

Message ID 20200803213342.33224-1-xypron.glpk@gmx.de
State Accepted, archived
Commit 023dba13668756e54ac4522543d91840f8f34db5
Headers show
Series [1/1] riscv: remove redundant logical constraint. | expand

Commit Message

Heinrich Schuchardt Aug. 3, 2020, 9:33 p.m. UTC
After

    if (ret) return ret;

we know that ret is zero. Don't check it again.

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

--
2.27.0

Comments

Bin Meng Aug. 4, 2020, 1:47 a.m. UTC | #1
On Tue, Aug 4, 2020 at 5:33 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>

Please remove the ending period in the commit title

> After
>
>     if (ret) return ret;
>
> we know that ret is zero. Don't check it again.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  arch/riscv/lib/andes_plic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/lib/andes_plic.c b/arch/riscv/lib/andes_plic.c
> index 5cf29df670..c2a8fe4d9e 100644
> --- a/arch/riscv/lib/andes_plic.c
> +++ b/arch/riscv/lib/andes_plic.c
> @@ -52,7 +52,7 @@ static int init_plic(void)
>         if (ret)
>                 return ret;
>
> -       if (ret == 0 && dev) {
> +       if (dev) {
>                 ofnode_for_each_subnode(node, dev_ofnode(dev->parent)) {
>                         const char *device_type;

Reviewed-by: Bin Meng <bin.meng@windriver.com>
Rick Chen Aug. 4, 2020, 8:53 a.m. UTC | #2
> From: Heinrich Schuchardt [mailto:xypron.glpk@gmx.de]
> Sent: Tuesday, August 04, 2020 5:34 AM
> To: Rick Jian-Zhi Chen(陳建志)
> Cc: Anatolij Gustschin; Bin Meng; Sean Anderson; Simon Glass; Lukas Auer; u-boot@lists.denx.de; Heinrich Schuchardt
> Subject: [PATCH 1/1] riscv: remove redundant logical constraint.
>
> After
>
>     if (ret) return ret;
>
> we know that ret is zero. Don't check it again.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  arch/riscv/lib/andes_plic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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

Patch

diff --git a/arch/riscv/lib/andes_plic.c b/arch/riscv/lib/andes_plic.c
index 5cf29df670..c2a8fe4d9e 100644
--- a/arch/riscv/lib/andes_plic.c
+++ b/arch/riscv/lib/andes_plic.c
@@ -52,7 +52,7 @@  static int init_plic(void)
 	if (ret)
 		return ret;

-	if (ret == 0 && dev) {
+	if (dev) {
 		ofnode_for_each_subnode(node, dev_ofnode(dev->parent)) {
 			const char *device_type;