mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Clark <james.clark@linaro.org>
To: linux-arm-kernel@lists.infradead.org, robh@kernel.org,
	broonie@kernel.org, maz@kernel.org
Cc: James Clark <james.clark@linaro.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Oliver Upton <oliver.upton@linux.dev>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	James Morse <james.morse@arm.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/5] arm64/sysreg: Enforce whole line match for closing blocks
Date: Wed, 15 Jan 2025 13:42:54 +0000	[thread overview]
Message-ID: <20250115134259.1864060-3-james.clark@linaro.org> (raw)
In-Reply-To: <20250115134259.1864060-1-james.clark@linaro.org>

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 <james.clark@linaro.org>
---
 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" {
 	if (next_bit > 0)
 		fatal("Unspecified bits in " reg)
 
@@ -177,7 +177,7 @@ END {
 	next
 }
 
-/^EndSysreg/ && block_current() == "Sysreg" {
+/^EndSysreg$/ && block_current() == "Sysreg" {
 	if (next_bit > 0)
 		fatal("Unspecified bits in " reg)
 
@@ -310,7 +310,7 @@ END {
 	next
 }
 
-/^EndEnum/ && block_current() == "Enum" {
+/^EndEnum$/ && block_current() == "Enum" {
 
 	field = null
 	msb = null
-- 
2.34.1


  parent reply	other threads:[~2025-01-15 13:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-15 13:42 [PATCH 0/5] arm64/sysreg: Sort sysreg by encoding James Clark
2025-01-15 13:42 ` [PATCH 1/5] arm64/sysreg: Fix unbalanced closing block James Clark
2025-01-15 13:42 ` James Clark [this message]
2025-01-15 13:47   ` [PATCH 2/5] arm64/sysreg: Enforce whole line match for closing blocks Mark Brown
2025-01-15 14:17   ` Marc Zyngier
2025-01-15 15:48     ` James Clark
2025-01-15 13:42 ` [PATCH 3/5] arm64/sysreg: Enforce whole word for opening blocks James Clark
2025-01-15 13:42 ` [PATCH 4/5] arm64/sysreg: Sort sysreg by encoding James Clark
2025-01-15 13:42 ` [PATCH 5/5] arm64/sysreg: Enforce sorting James Clark
2025-01-15 14:12   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250115134259.1864060-3-james.clark@linaro.org \
    --to=james.clark@linaro.org \
    --cc=anshuman.khandual@arm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=robh@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®