From patchwork Thu Nov 30 23:23:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elliott Mitchell X-Patchwork-Id: 1871815 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=F5+rpQsj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SkmJq1dCbz1ySd for ; Tue, 5 Dec 2023 14:30:51 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:To:Subject:Date:From: References:In-Reply-To:Message-Id:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YuoGIlFxVNhjjXa72+NA2J1ACe+BzInun6CV7JByriM=; b=F5+rpQsjv5R+Fg LZHKdLIxVLgJ4LBG4Ghj0npDkls1PmTDw24HP1R1M1Jj/e2lKp5Xz/yj0kSxDjz7W34q15pyyZsmy yEqogFjxQnedjLhS8z3haxhkqJBZnIIcBcj+AYQVafZ7gGBKCRPyZDBsmrd2a43sYWmhQ4p6hp898 f3wO/S8J1sbKEmnByx2rvghWFIdYKhvVMU5LxptDmP0rbm+PofaxruNbr9ruqtNXVDW26Xk2Zj+1h tUff+XLnb0OfIEFSUroeJKvVfTcm3SYF5r7qkJzGiG9OcqGNEnOiGFaevEvBacKh6KbLHbo8FKU+z K0b8MLUbOEi58p3V15YA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rAM74-0067R5-0A; Tue, 05 Dec 2023 03:28:46 +0000 Received: from mailhost.m5p.com ([74.104.188.4]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rAM71-0067Qb-0p for openwrt-devel@lists.openwrt.org; Tue, 05 Dec 2023 03:28:44 +0000 Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7]) by mailhost.m5p.com (8.17.1/8.15.2) with ESMTPS id 3B53SZZV001510 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 4 Dec 2023 22:28:41 -0500 (EST) (envelope-from ehem@m5p.com) Received: (from ehem@localhost) by m5p.com (8.17.1/8.15.2/Submit) id 3B53SZlG001509; Mon, 4 Dec 2023 19:28:35 -0800 (PST) (envelope-from ehem) Message-Id: <1167e7b408ffb248710b64502435f53bbd5b11f9.1701746457.git.ehem+openwrt@m5p.com> In-Reply-To: References: From: Elliott Mitchell Date: Thu, 30 Nov 2023 15:23:02 -0800 Subject: [PATCH 2/5] scripts/kconfig.pl: modify config_and()/config_sub() to match other ops To: openwrt-devel@lists.openwrt.org, nbd@nbd.name X-Spam-Status: No, score=2.1 required=10.0 tests=DATE_IN_PAST_96_XX, KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on mattapan.m5p.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231204_192843_483117_2A1A6D5C X-CRM114-Status: UNSURE ( 5.77 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Having all operator-handling functions match the same prototype has advantages. Signed-off-by: Elliott Mitchell --- scripts/kconfig.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) Content analysis details: (2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Having all operator-handling functions match the same prototype has advantages. Signed-off-by: Elliott Mitchell --- scripts/kconfig.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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); }