diff mbox series

[2/2] arm64/sysreg: fix odd line spacing

Message ID 20220513174118.266966-3-mark.rutland@arm.com (mailing list archive)
State New, archived
Headers show
Series arm64/sysreg: minor cleanusp for sysreg header generation | expand

Commit Message

Mark Rutland May 13, 2022, 5:41 p.m. UTC
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 mbox series

Patch

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