diff mbox series

[4/5] scripts/kconfig.pl: consistently call parse_expr() with 2 args

Message ID 227760cf0bc5e553da607c851628a38e2147ce6a.1701746457.git.ehem+openwrt@m5p.com
State New
Headers show
Series Scripting tweaks | expand

Commit Message

Elliott Mitchell Dec. 1, 2023, 4:03 p.m. UTC
The inconsistent calling had already been noticed.  Now the trap
has been spotted, so clean this up.

Signed-off-by: Elliott Mitchell <ehem+openwrt@m5p.com>
---
 scripts/kconfig.pl | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/scripts/kconfig.pl b/scripts/kconfig.pl
index 5a53e2154b..5f0741ee5c 100755
--- a/scripts/kconfig.pl
+++ b/scripts/kconfig.pl
@@ -125,9 +125,9 @@  sub dump_config($) {
 	}
 }
 
-sub parse_expr {
-	my $pos = shift;
-	my $mod_plus = shift;
+sub parse_expr($$);
+sub parse_expr($$) {
+	my ($pos, $mod_plus) = @_;
 	my $arg = $arg[$$pos++];
 
 	my %ops = (
@@ -142,7 +142,7 @@  sub parse_expr {
 	die "Parse error" if (!$arg);
 
 	if (exists($ops{$arg})) {
-		my $arg1 = parse_expr($pos);
+		my $arg1 = parse_expr($pos, 0);
 		my $arg2 = parse_expr($pos, ($arg eq 'm+') ? 1 : 0);
 		return &{$ops{$arg}->[0]}($arg1, $arg2, $ops{$arg}->[1]);
 	} else {
@@ -163,5 +163,5 @@  while (@ARGV > 0 and $ARGV[0] =~ /^-\w+$/) {
 @arg = @ARGV;
 
 my $pos = 0;
-dump_config(parse_expr(\$pos));
+dump_config(parse_expr(\$pos, 0));
 die "Parse error" if ($arg[$pos]);