diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2023-11-29 14:16:13 +0300 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2023-12-12 14:13:52 +0300 |
commit | bcf1eed3f8a0b83824b41da82d226cf36320be76 (patch) | |
tree | 72d2c6baadbac374618a6bef83e70e7ac9e1a958 /arch/arm64/kernel/idreg-override.c | |
parent | dc3f5aae06381b43bc9d0d416bd15ee1682940e9 (diff) | |
download | linux-bcf1eed3f8a0b83824b41da82d226cf36320be76.tar.xz |
arm64: idreg-override: avoid strlen() to check for empty strings
strlen() is a costly way to decide whether a string is empty, as in that
case, the first character will be NUL so we can check for that directly.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20231129111555.3594833-60-ardb@google.com
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/kernel/idreg-override.c')
-rw-r--r-- | arch/arm64/kernel/idreg-override.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c index 1eca93446345..8b22ca523186 100644 --- a/arch/arm64/kernel/idreg-override.c +++ b/arch/arm64/kernel/idreg-override.c @@ -232,7 +232,7 @@ static void __init match_options(const char *cmdline) override = prel64_pointer(reg->override); - for (f = 0; strlen(reg->fields[f].name); f++) { + for (f = 0; reg->fields[f].name[0] != '\0'; f++) { u64 shift = reg->fields[f].shift; u64 width = reg->fields[f].width ?: 4; u64 mask = GENMASK_ULL(shift + width - 1, shift); |