arm64: idreg-override: Avoid parameq() and parameqn()
authorArd Biesheuvel <ardb@kernel.org>
Wed, 29 Nov 2023 11:16:12 +0000 (12:16 +0100)
committerWill Deacon <will@kernel.org>
Tue, 12 Dec 2023 11:13:52 +0000 (11:13 +0000)
commitdc3f5aae06381b43bc9d0d416bd15ee1682940e9
treeff680f9abec32564dc916d99b3a597e997cbd5c1
parent01fd29092a35833ef87bd13c0a025e726550d646
arm64: idreg-override: Avoid parameq() and parameqn()

The only way parameq() and parameqn() deviate from the ordinary string
and memory routines is that they ignore the difference between dashes
and underscores.

Since we copy each command line argument into a buffer before passing it
to parameq() and parameqn() numerous times, let's just convert all
dashes to underscores just once, and update the alias array accordingly.

This also helps reduce the dependency on kernel APIs that are no longer
available once we move this code into the early mini C runtime.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20231129111555.3594833-59-ardb@google.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/idreg-override.c