diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2019-08-19 17:05:44 +0200 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2019-08-29 15:34:57 +0200 |
commit | b29cd7c4c482d895f4b13ef1dfe85550529f38c9 (patch) | |
tree | fe204bd6f06e46441594d62f4a845d61b4ccf449 /arch | |
parent | s390/pci: avoid using strncmp with hardcoded length (diff) | |
download | linux-b29cd7c4c482d895f4b13ef1dfe85550529f38c9.tar.xz linux-b29cd7c4c482d895f4b13ef1dfe85550529f38c9.zip |
s390/module: avoid using strncmp with hardcoded length
Reuse str_has_prefix instead of strncmp with hardcoded length to
make the intent of a comparison more obvious.
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/kernel/module.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c index 31889db609e9..ba8f19bb438b 100644 --- a/arch/s390/kernel/module.c +++ b/arch/s390/kernel/module.c @@ -472,11 +472,11 @@ int module_finalize(const Elf_Ehdr *hdr, apply_alternatives(aseg, aseg + s->sh_size); if (IS_ENABLED(CONFIG_EXPOLINE) && - (!strncmp(".s390_indirect", secname, 14))) + (str_has_prefix(secname, ".s390_indirect"))) nospec_revert(aseg, aseg + s->sh_size); if (IS_ENABLED(CONFIG_EXPOLINE) && - (!strncmp(".s390_return", secname, 12))) + (str_has_prefix(secname, ".s390_return"))) nospec_revert(aseg, aseg + s->sh_size); } |