Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Sascha Bischoff and committed by
Catalin Marinas
0aab5772 b0a3f0e8

+3 -3
+3 -3
arch/arm64/tools/gen-sysreg.awk
··· 133 133 134 134 $1 == "EndSysregFields" && block_current() == "SysregFields" { 135 135 expect_fields(1) 136 - if (next_bit > 0) 136 + if (next_bit >= 0) 137 137 fatal("Unspecified bits in " reg) 138 138 139 139 define(reg "_RES0", "(" res0 ")") ··· 188 188 189 189 $1 == "EndSysreg" && block_current() == "Sysreg" { 190 190 expect_fields(1) 191 - if (next_bit > 0) 191 + if (next_bit >= 0) 192 192 fatal("Unspecified bits in " reg) 193 193 194 194 if (res0 != null) ··· 225 225 print "/* For " reg " fields see " $2 " */" 226 226 print "" 227 227 228 - next_bit = 0 228 + next_bit = -1 229 229 res0 = null 230 230 res1 = null 231 231 unkn = null