diff mbox series

[2/5] scripts/kconfig.pl: modify config_and()/config_sub() to match other ops

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

Commit Message

Elliott Mitchell Nov. 30, 2023, 11:23 p.m. UTC
Having all operator-handling functions match the same prototype has
advantages.

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

Patch

diff --git a/scripts/kconfig.pl b/scripts/kconfig.pl
index f7b3814cdd..dd286479b3 100755
--- a/scripts/kconfig.pl
+++ b/scripts/kconfig.pl
@@ -43,8 +43,8 @@  sub load_config($$) {
 }
 
 
-sub config_and($$) {
-	my ($cfg1, $cfg2) = @_;
+sub config_and($$$) {
+	my ($cfg1, $cfg2, $mod_plus_discarded) = @_;
 	my %config;
 
 	foreach my $config (keys %$cfg1) {
@@ -89,8 +89,8 @@  sub config_diff($$$) {
 	return \%config
 }
 
-sub config_sub($$) {
-	my ($cfg1, $cfg2) = @_;
+sub config_sub($$$) {
+	my ($cfg1, $cfg2, $mod_plus_discarded) = @_;
 	my %config = %{$cfg1};
 	my @keys = map {
 		my $expr = $_;
@@ -135,7 +135,7 @@  sub parse_expr {
 	if ($arg eq '&') {
 		my $arg1 = parse_expr($pos);
 		my $arg2 = parse_expr($pos);
-		return config_and($arg1, $arg2);
+		return config_and($arg1, $arg2, undef);
 	} elsif ($arg =~ /^\+/) {
 		my $arg1 = parse_expr($pos);
 		my $arg2 = parse_expr($pos);
@@ -155,7 +155,7 @@  sub parse_expr {
 	} elsif ($arg eq '-') {
 		my $arg1 = parse_expr($pos);
 		my $arg2 = parse_expr($pos);
-		return config_sub($arg1, $arg2);
+		return config_sub($arg1, $arg2, undef);
 	} else {
 		return load_config($arg, $mod_plus);
 	}