[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250313215622.GA8101@willie-the-truck>
Date: Thu, 13 Mar 2025 21:56:23 +0000
From: Will Deacon <will@...nel.org>
To: James Clark <james.clark@...aro.org>
Cc: linux-arm-kernel@...ts.infradead.org, robh@...nel.org,
broonie@...nel.org, maz@...nel.org,
Catalin Marinas <catalin.marinas@....com>,
Mark Rutland <mark.rutland@....com>,
Oliver Upton <oliver.upton@...ux.dev>,
Anshuman Khandual <anshuman.khandual@....com>,
James Morse <james.morse@....com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/4] arm64/sysreg: Enforce whole word match for
open/close tokens
On Wed, Jan 15, 2025 at 04:25:56PM +0000, James Clark wrote:
> Opening and closing tokens can also match on words with common 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.
>
> Closing ones also get expect_fields(1) to ensure nothing other than
> whitespace follows.
>
> Signed-off-by: James Clark <james.clark@...aro.org>
> ---
> arch/arm64/tools/gen-sysreg.awk | 31 +++++++++++++++++--------------
> 1 file changed, 17 insertions(+), 14 deletions(-)
>
> diff --git a/arch/arm64/tools/gen-sysreg.awk b/arch/arm64/tools/gen-sysreg.awk
> index 1a2afc9fdd42..f2a1732cb1f6 100755
> --- a/arch/arm64/tools/gen-sysreg.awk
> +++ b/arch/arm64/tools/gen-sysreg.awk
> @@ -111,7 +111,7 @@ END {
> /^$/ { next }
> /^[\t ]*#/ { next }
>
> -/^SysregFields/ && block_current() == "Root" {
> +$1 == "SysregFields" && block_current() == "Root" {
Stylistic nit, but could you just do:
/^SysregFields$/ && block_current() == "Root" {
instead? That way the diff is smaller (well, same number of lines) and
you avoid the ugly $1.
But I'm not an Orc, so who knows...
Will
Powered by blists - more mailing lists