From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8160F13DB9F for ; Wed, 15 Jan 2025 15:48:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736956115; cv=none; b=Tb485kMfT40V4m2zs6ytjiOXJ62JcM/fVvoq2JKx1LhmwKkw0DJyHgdHNBhcd3Fy/I4sDwAzb19pKTMO4Aa7S6SqWFurJQGMWNUZ4q1q6884TIAS8RqFjHy6QV/szAMfQlRpOkiA1KFkHvRXraYUeqG5V6WgtJcPb7m/QqlJMtk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736956115; c=relaxed/simple; bh=cJCp75xZjcos2ZkTIUY9UErjsMqEecEy6X0cHYDA+oM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TLAohq+5r23Aa48jWOB3cDekWIEcv41a6YnIPpl+TgYzL7vi/HKId/TSchEKsKW/tM6CL0JO9MiBbHAXXbvw4Puq55iDrcpedw5fNfyqPWB4mZq3wgEVY+uiLOV64wNDuYxnQN6FFazslqhCIKdgl2F0er9OInQhiCcpAtactYQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dV+kpx1o; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dV+kpx1o" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4364a37a1d7so70934425e9.3 for ; Wed, 15 Jan 2025 07:48:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736956112; x=1737560912; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=O+TEw22AVontHHqXfjSfeIvZxVbWvvoY4JYvVvO5hBk=; b=dV+kpx1o+yGZ1bb4nPR3xcovgtdOmXsuEkBYfk8+ivAOhWtE01xHtOUPr9d3CYRu6o wsKt+19quVxuGAMGIGchNXk0JU+VFyTSdsDHCCS6GAvGKK8JK57bg1tBeSPAw4LHortY 0sumYoSaB/wYCj31dgoLxJtBDBa1zGlrrCBoGIXZX6663FQ/rUhkdm4opBdoA7zCm2fK qqgDerNBh19vdcDFeqM9zGwEKsXU8tuFXpyWyV7YMDEDnyMcjnEDaGORXmIUmY19ssOo fDkR3QopSo3ODXjPZXMpXMRlYzpMNjtk91putKdI1wRyhOyxlnrpH1H6HTewJuzHCS72 iHmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736956112; x=1737560912; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=O+TEw22AVontHHqXfjSfeIvZxVbWvvoY4JYvVvO5hBk=; b=BdZdD3qF2i5QpRaqYLBypij+OZ0pc4/W3se+89D3lnpUhe4PjIQWeMHeIBj5nRwdbM E6S2CmNyntM3BU6dIFmY73bR1vqSMDyLm0SYLjPh6y88wYD6nAiFPdiYpuHHkEyF4Tx1 5REwxIApzoTugi2/dn39KNywZ72L4lOe03A1q+O9F6CHFNrazBukxAKZx/OBQQ1QKncR Zp0H5RrPB91J3QEHfQqp88ekaahx/yniZfD9i6LOeWcbE23aPniRafeQfSvJX4cMFfjU VQefaTPMTl6mYX/WOnLanbNpCZ9jEzIZiD/KqEELaMX5co+DGqZ1vy7HibtEMArbgYRe E9gg== X-Forwarded-Encrypted: i=1; AJvYcCUw4U7anM0TaRxHUGMW3vekwCxjU4iNtSssw6PKBfO/V0ykq6Ed59HyvBADGvs2LzMWxU63EqHi0oVN5ik=@vger.kernel.org X-Gm-Message-State: AOJu0YwkKclS3rLaPbhzpSK2syVW7e9By8v1QVVuaqWq8l5SHR8pENcH AJzzyNPIWqeohDPnM237QGZWV8Akym/cWHDBT4l3zFF+tfzWjK5I+C+y30Ihy2s= X-Gm-Gg: ASbGncu62dZlsLn+w/WMHCuAp1pYxvAnRzmH8ekMHct/V4rOpr1/bBApYTUGywf/R8x oLdvsGktyvMxLap2cHcaOHjCq6anJkxY5vqREm2heLjPFPeGiEzFgaa+Xp04eahkokAFWTrZdiR tDb8pAX3XOgsELWlzkFA8hzgMeVmkQ/mCxl3TSYcq3g6b/MyloenyHwkmA0oQYBKwGd39Zl6zH3 XDfIwqVLxWgS+ads75QxFkKnHy1fx1iHu3RjpBYk3qujST6KwQVzolA7n9e0NVP0Q== X-Google-Smtp-Source: AGHT+IGjzi93xDbrH8PhQpZEWfFM4hz29cUNgLumlFwyXrcez1K1tWDWXeUmRwGwyfJJfyxns3HR9A== X-Received: by 2002:a5d:64c9:0:b0:385:f0dc:c9f4 with SMTP id ffacd0b85a97d-38a873066fcmr22815280f8f.20.1736956111746; Wed, 15 Jan 2025 07:48:31 -0800 (PST) Received: from [192.168.68.163] ([145.224.90.10]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38be66b01c7sm2649024f8f.22.2025.01.15.07.48.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jan 2025 07:48:31 -0800 (PST) Message-ID: <65eb308e-6851-47b2-8fa8-31b093a0d25e@linaro.org> Date: Wed, 15 Jan 2025 15:48:30 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/5] arm64/sysreg: Enforce whole line match for closing blocks To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, robh@kernel.org, broonie@kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Oliver Upton , Anshuman Khandual , James Morse , linux-kernel@vger.kernel.org References: <20250115134259.1864060-1-james.clark@linaro.org> <20250115134259.1864060-3-james.clark@linaro.org> <867c6ww49g.wl-maz@kernel.org> Content-Language: en-US From: James Clark In-Reply-To: <867c6ww49g.wl-maz@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 15/01/2025 2:17 pm, Marc Zyngier wrote: > On Wed, 15 Jan 2025 13:42:54 +0000, > James Clark wrote: >> >> Match on the whole line to prevent matching on prefixes like "Endsysreg" >> vs "EndsysregFields". This could potentially make the script go wrong >> in weird ways so make it fall through to the fatal unhandled statement >> catcher if it doesn't fully match the current block. >> >> Signed-off-by: James Clark >> --- >> arch/arm64/tools/gen-sysreg.awk | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/arch/arm64/tools/gen-sysreg.awk b/arch/arm64/tools/gen-sysreg.awk >> index 1a2afc9fdd42..7c7412adf90e 100755 >> --- a/arch/arm64/tools/gen-sysreg.awk >> +++ b/arch/arm64/tools/gen-sysreg.awk >> @@ -127,7 +127,7 @@ END { >> next >> } >> >> -/^EndSysregFields/ && block_current() == "SysregFields" { >> +/^EndSysregFields$/ && block_current() == "SysregFields" { > > The problem with this sort of things is that it will now fail with > trailing spaces, which is both counter-intuitive and pretty hard to > spot. > > Why don't you simply match the field number, like you do in patch 3? > > M. > The intention was to ensure that the end tokens were the only thing on the line (including whitespace). But yeah it is slightly inconsistent compared to start tokens because as you mention "$1 ==" allows both leading and trailing whitespace. I'll change it to "$1 ==" for end tokens as well and then add expect_fields(1) which catches unexpected trailing stuff but has a better warning. James