[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240611175536.3518179-2-masahiroy@kernel.org>
Date: Wed, 12 Jun 2024 02:55:10 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: linux-kbuild@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Masahiro Yamada <masahiroy@...nel.org>
Subject: [PATCH 01/16] kconfig: remove unneeded code in expr_compare_type()
The condition (t2 == 0) never becomes true because the zero value
(i.e., E_NONE) is only used as a dummy type for prevtoken. It can
be passed to t1, but not to t2.
The caller of this function only checks expr_compare_type() > 0.
Therefore, the distinction between 0 and -1 is unnecessary.
Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
---
scripts/kconfig/expr.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index fcc190b67b6f..31737b2cb8e2 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -1096,11 +1096,8 @@ static int expr_compare_type(enum expr_type t1, enum expr_type t2)
case E_OR:
if (t2 == E_LIST)
return 1;
- case E_LIST:
- if (t2 == 0)
- return 1;
default:
- return -1;
+ break;
}
return 0;
}
--
2.43.0
Powered by blists - more mailing lists