All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: James Clark <james.clark@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org, robh@kernel.org,
	broonie@kernel.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: Re: [PATCH 2/5] arm64/sysreg: Enforce whole line match for closing blocks
Date: Wed, 15 Jan 2025 14:17:15 +0000	[thread overview]
Message-ID: <867c6ww49g.wl-maz@kernel.org> (raw)
In-Reply-To: <20250115134259.1864060-3-james.clark@linaro.org>

On Wed, 15 Jan 2025 13:42:54 +0000,
James Clark <james.clark@linaro.org> 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 <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" {

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.

-- 
Without deviation from the norm, progress is not possible.


  parent reply	other threads:[~2025-01-15 14:18 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 ` [PATCH 2/5] arm64/sysreg: Enforce whole line match for closing blocks James Clark
2025-01-15 13:47   ` Mark Brown
2025-01-15 14:17   ` Marc Zyngier [this message]
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=867c6ww49g.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=anshuman.khandual@arm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.clark@linaro.org \
    --cc=james.morse@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.