* [PATCH 0/2] arm64/sysreg: minor cleanusp for sysreg header generation
@ 2022-05-13 17:41 Mark Rutland
2022-05-13 17:41 ` [PATCH 1/2] arm64/sysreg: improve comment for regs without fields Mark Rutland
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Mark Rutland @ 2022-05-13 17:41 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: broonie, catalin.marinas, mark.rutland, will
These are a couple of fixups for the sysreg header generation, purely to
make the output slightly nicer for humans to read. The patches only
change the contents of a comment and when a newline is output.
This should apply directly atop the arm64 for-next/sysreg-gen branch.
There should be no functional change as a result of these patches.
Thanks,
Mark.
Mark Rutland (2):
arm64/sysreg: improve comment for regs without fields
arm64/sysreg: fix odd line spacing
arch/arm64/tools/gen-sysreg.awk | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] arm64/sysreg: improve comment for regs without fields
2022-05-13 17:41 [PATCH 0/2] arm64/sysreg: minor cleanusp for sysreg header generation Mark Rutland
@ 2022-05-13 17:41 ` Mark Rutland
2022-05-13 17:41 ` [PATCH 2/2] arm64/sysreg: fix odd line spacing Mark Rutland
2022-05-15 10:46 ` [PATCH 0/2] arm64/sysreg: minor cleanusp for sysreg header generation Catalin Marinas
2 siblings, 0 replies; 4+ messages in thread
From: Mark Rutland @ 2022-05-13 17:41 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: broonie, catalin.marinas, mark.rutland, will
Currently for registers without fields we create a comment pointing at
the common definitions, e.g.
| #define REG_TTBR0_EL1 S3_0_C2_C0_0
| #define SYS_TTBR0_EL1 sys_reg(3, 0, 2, 0, 0)
| #define SYS_TTBR0_EL1_Op0 3
| #define SYS_TTBR0_EL1_Op1 0
| #define SYS_TTBR0_EL1_CRn 2
| #define SYS_TTBR0_EL1_CRm 0
| #define SYS_TTBR0_EL1_Op2 0
|
| /* See TTBRx_EL1 */
It would be slightly nicer if the comment said what we should be looking
for, e.g.
| #define REG_TTBR0_EL1 S3_0_C2_C0_0
| #define SYS_TTBR0_EL1 sys_reg(3, 0, 2, 0, 0)
| #define SYS_TTBR0_EL1_Op0 3
| #define SYS_TTBR0_EL1_Op1 0
| #define SYS_TTBR0_EL1_CRn 2
| #define SYS_TTBR0_EL1_CRm 0
| #define SYS_TTBR0_EL1_Op2 0
|
| /* For TTBR0_EL1 fields see TTBRx_EL1 */
Update the comment generation accordingly.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>
---
arch/arm64/tools/gen-sysreg.awk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/tools/gen-sysreg.awk b/arch/arm64/tools/gen-sysreg.awk
index 3ffd77cbb4994..f41feb87d0ca1 100755
--- a/arch/arm64/tools/gen-sysreg.awk
+++ b/arch/arm64/tools/gen-sysreg.awk
@@ -184,7 +184,7 @@ END {
if (next_bit != 63)
fatal("Some fields already defined for " reg)
- print "/* See " $2 " */"
+ print "/* For " reg " fields see " $2 " */"
print ""
next_bit = 0
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] arm64/sysreg: fix odd line spacing
2022-05-13 17:41 [PATCH 0/2] arm64/sysreg: minor cleanusp for sysreg header generation Mark Rutland
2022-05-13 17:41 ` [PATCH 1/2] arm64/sysreg: improve comment for regs without fields Mark Rutland
@ 2022-05-13 17:41 ` Mark Rutland
2022-05-15 10:46 ` [PATCH 0/2] arm64/sysreg: minor cleanusp for sysreg header generation Catalin Marinas
2 siblings, 0 replies; 4+ messages in thread
From: Mark Rutland @ 2022-05-13 17:41 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: broonie, catalin.marinas, mark.rutland, will
Between the header and the definitions, there's no line gap, and in a
couple of places a double line gap for no semantic reason, which makes
the output look a little odd.
Fix this so blocks are consistently separated with a single line gap:
* Add a newline after the "Generated file" comment line, so this is
clearly split from whatever the first definition in the file is.
* At the start of a SysregFields block there's no need for a newline as
we haven't output any sysreg encoding details prior to this.
* At the end of a Sysreg block there's no need for a newline if we
have no RES0 or RES1 fields, as there will be a line gap after the
previous element (e.g. a Fields line).
There should be no functional change as a result of this patch.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.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 f41feb87d0ca1..4aa7ff8ce7076 100755
--- a/arch/arm64/tools/gen-sysreg.awk
+++ b/arch/arm64/tools/gen-sysreg.awk
@@ -77,6 +77,7 @@ BEGIN {
print "#define __ASM_SYSREG_DEFS_H"
print ""
print "/* Generated file - do not edit */"
+ print ""
block = "None"
}
@@ -98,8 +99,6 @@ END {
res0 = "UL(0)"
res1 = "UL(0)"
- print ""
-
next_bit = 63
next
@@ -162,7 +161,8 @@ END {
define(reg "_RES0", "(" res0 ")")
if (res1 != null)
define(reg "_RES1", "(" res1 ")")
- print ""
+ if (res0 != null || res1 != null)
+ print ""
reg = null
op0 = null
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] arm64/sysreg: minor cleanusp for sysreg header generation
2022-05-13 17:41 [PATCH 0/2] arm64/sysreg: minor cleanusp for sysreg header generation Mark Rutland
2022-05-13 17:41 ` [PATCH 1/2] arm64/sysreg: improve comment for regs without fields Mark Rutland
2022-05-13 17:41 ` [PATCH 2/2] arm64/sysreg: fix odd line spacing Mark Rutland
@ 2022-05-15 10:46 ` Catalin Marinas
2 siblings, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2022-05-15 10:46 UTC (permalink / raw)
To: Mark Rutland, linux-arm-kernel; +Cc: Will Deacon, broonie
On Fri, 13 May 2022 18:41:16 +0100, Mark Rutland wrote:
> These are a couple of fixups for the sysreg header generation, purely to
> make the output slightly nicer for humans to read. The patches only
> change the contents of a comment and when a newline is output.
>
> This should apply directly atop the arm64 for-next/sysreg-gen branch.
>
> There should be no functional change as a result of these patches.
>
> [...]
Applied to arm64 (for-next/sysreg-gen), thanks!
[1/2] arm64/sysreg: improve comment for regs without fields
https://git.kernel.org/arm64/c/82bf59002e0f
[2/2] arm64/sysreg: fix odd line spacing
https://git.kernel.org/arm64/c/5005d1dbbb38
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-05-15 10:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 17:41 [PATCH 0/2] arm64/sysreg: minor cleanusp for sysreg header generation Mark Rutland
2022-05-13 17:41 ` [PATCH 1/2] arm64/sysreg: improve comment for regs without fields Mark Rutland
2022-05-13 17:41 ` [PATCH 2/2] arm64/sysreg: fix odd line spacing Mark Rutland
2022-05-15 10:46 ` [PATCH 0/2] arm64/sysreg: minor cleanusp for sysreg header generation Catalin Marinas
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.