From: Will Deacon <will@kernel.org>
To: James Clark <james.clark@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org, robh@kernel.org,
broonie@kernel.org, maz@kernel.org,
Catalin Marinas <catalin.marinas@arm.com>,
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 v2 3/4] arm64/sysreg: Sort sysreg by encoding
Date: Thu, 13 Mar 2025 21:58:41 +0000 [thread overview]
Message-ID: <20250313215840.GC8101@willie-the-truck> (raw)
In-Reply-To: <20250115162600.2153226-4-james.clark@linaro.org>
On Wed, Jan 15, 2025 at 04:25:57PM +0000, James Clark wrote:
> It's mostly been sorted by sysreg encoding, but not 100%. Sort it so
> new entries can be added without wondering where to put them.
>
> The following python script was used to sort, keeping the top level
> SysregFields and comments next to their current Sysreg entries by
> splitting on "EndSysreg":
>
> # cat arch/arm64/tools/sysreg | python3 sort.py > sorted-sysreg
> import sys, re
> def key(block):
> reg = r"\w+\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)"
> match = re.search(reg, block)
> sort_val = ''.join(f"{int(n):02d}" for n in match.groups())
> return (sort_val, block)
> sysreg = sys.stdin.read().split("\nEndSysreg\n")[:-1]
> sysreg = sorted(sysreg, key=key)
> print("\nEndSysreg\n".join(sysreg) + "\nEndSysreg")
>
> Tested by diffing sorted outputs:
>
> $ diff <(sort arch/arm64/include/generated/asm/sysreg-defs.h) \
> <(sort before-sysreg-defs.h) -s
>
> Files /dev/fd/63 and /dev/fd/62 are identical
>
> Signed-off-by: James Clark <james.clark@linaro.org>
> ---
> arch/arm64/tools/sysreg | 1006 +++++++++++++++++++--------------------
> 1 file changed, 503 insertions(+), 503 deletions(-)
This looks like unnecessary pain for backporting...
What do we gain from sorting this?
Will
next prev parent reply other threads:[~2025-03-13 22:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-15 16:25 [PATCH v2 0/4] arm64/sysreg: Sort sysreg by encoding James Clark
2025-01-15 16:25 ` [PATCH v2 1/4] arm64/sysreg: Fix unbalanced closing block James Clark
2025-02-04 4:21 ` Anshuman Khandual
2025-03-13 21:56 ` Will Deacon
2025-03-14 12:02 ` Mark Rutland
2025-01-15 16:25 ` [PATCH v2 2/4] arm64/sysreg: Enforce whole word match for open/close tokens James Clark
2025-03-13 21:56 ` Will Deacon
2025-03-14 7:40 ` Marc Zyngier
2025-03-14 11:31 ` Will Deacon
2025-03-14 12:01 ` Mark Rutland
2025-01-15 16:25 ` [PATCH v2 3/4] arm64/sysreg: Sort sysreg by encoding James Clark
2025-03-13 21:58 ` Will Deacon [this message]
2025-03-17 11:11 ` James Clark
2025-01-15 16:25 ` [PATCH v2 4/4] arm64/sysreg: Enforce sorting James Clark
2025-02-03 10:40 ` [PATCH v2 0/4] arm64/sysreg: Sort sysreg by encoding James Clark
2025-03-14 18:43 ` (subset) " Catalin Marinas
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=20250313215840.GC8101@willie-the-truck \
--to=will@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=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=robh@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