From patchwork Fri Dec 1 16:03:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elliott Mitchell X-Patchwork-Id: 1871817 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=F77NRcp9; 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 4SkmLX05rpz1ySd for ; Tue, 5 Dec 2023 14:32:20 +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=rSk2D5gHe7s9JYDrSUI6/6saKHWmaCibnH1NTVGwCfI=; b=F77NRcp9pgmFH0 S+jzEgbZu1Iw7g+xfngWtjUfywkLCf2uQS/VHyZMZ+EWyMFMp/qB4mBpjVmH7VmnEnzRn+8g/DzkA GoEHMd3e9LXBMY+LhavQlc/wgUmYOL4owNHhi6vrxnYh5YA3QP2I5nibwC+q5j5w/uX4KEJo3FG5U 8hggTYi+wYhn4V9X+S05jobCQ4DhjbyPZIFjRByi6oJLTdnHPoSW56sQBvp/Th0iH9XbY9O6zt7n3 9mFl+js2AmcKv1bTQaT3BzDf4/rKk1z2OpsVWS22xa5hk0tBVzze8aJboJk//y7RRAjFcEAzRDpDQ tLfLoQZWhULntSznwXzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rAM8l-0067wk-0c; Tue, 05 Dec 2023 03:30:31 +0000 Received: from mailhost.m5p.com ([74.104.188.4]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rAM8h-0067vb-01 for openwrt-devel@lists.openwrt.org; Tue, 05 Dec 2023 03:30:28 +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 3B53UJpQ001543 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 4 Dec 2023 22:30:25 -0500 (EST) (envelope-from ehem@m5p.com) Received: (from ehem@localhost) by m5p.com (8.17.1/8.15.2/Submit) id 3B53UJSm001542; Mon, 4 Dec 2023 19:30:19 -0800 (PST) (envelope-from ehem) Message-Id: <227760cf0bc5e553da607c851628a38e2147ce6a.1701746457.git.ehem+openwrt@m5p.com> In-Reply-To: References: From: Elliott Mitchell Date: Fri, 1 Dec 2023 08:03:20 -0800 Subject: [PATCH 4/5] scripts/kconfig.pl: consistently call parse_expr() with 2 args To: openwrt-devel@lists.openwrt.org, nbd@nbd.name X-Spam-Status: No, score=0.0 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=unavailable autolearn_force=no version=4.0.0 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_193027_244136_48330720 X-CRM114-Status: UNSURE ( 7.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) 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: The inconsistent calling had already been noticed. Now the trap has been spotted, so clean this up. Signed-off-by: Elliott Mitchell --- scripts/kconfig.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -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 The inconsistent calling had already been noticed. Now the trap has been spotted, so clean this up. Signed-off-by: Elliott Mitchell --- scripts/kconfig.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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]);