Skip to content

Commit 0aab577

Browse files
Sticklyman1936ctmarinas
authored andcommitted
arm64/sysreg: Fix checks for incomplete sysreg definitions
The checks for incomplete sysreg definitions were checking if the next_bit was greater than 0, which is incorrect and missed occasions where bit 0 hasn't been defined for a sysreg. The reason is that next_bit is -1 when all bits have been processed (LSB - 1). Change the checks to use >= 0, instead. Also, set next_bit in Mapping to -1 instead of 0 to match these new checks. There are no changes to the generated sysreg definitons as part of this change, and conveniently no definitions lack definitions for bit 0. Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com> Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent b0a3f0e commit 0aab577

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

arch/arm64/tools/gen-sysreg.awk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ $1 == "SysregFields" && block_current() == "Root" {
133133

134134
$1 == "EndSysregFields" && block_current() == "SysregFields" {
135135
expect_fields(1)
136-
if (next_bit > 0)
136+
if (next_bit >= 0)
137137
fatal("Unspecified bits in " reg)
138138

139139
define(reg "_RES0", "(" res0 ")")
@@ -188,7 +188,7 @@ $1 == "Sysreg" && block_current() == "Root" {
188188

189189
$1 == "EndSysreg" && block_current() == "Sysreg" {
190190
expect_fields(1)
191-
if (next_bit > 0)
191+
if (next_bit >= 0)
192192
fatal("Unspecified bits in " reg)
193193

194194
if (res0 != null)
@@ -225,7 +225,7 @@ $1 == "EndSysreg" && block_current() == "Sysreg" {
225225
print "/* For " reg " fields see " $2 " */"
226226
print ""
227227

228-
next_bit = 0
228+
next_bit = -1
229229
res0 = null
230230
res1 = null
231231
unkn = null

0 commit comments

Comments
 (0)