From the surrounding similar calls, the intention seems obvious: this
seems intended to check for a prefix.

However, I do not understand this code, so take my reading with a grain
of salt.

Fixes: a048a07d7f453 ("powerpc/64s: Add support for a store forwarding barrier 
at kernel entry/exit")
Signed-off-by: Alejandro Colomar <[email protected]>
---

I found this while looking into replacing this code with calls to
strprefix().

 arch/powerpc/kernel/security.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index 600596cb4ffb..37999555bfe6 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -273,7 +273,7 @@ enum stf_barrier_type stf_barrier_type_get(void)
 /* This is the generic flag used by other architectures */
 static int __init handle_ssbd(char *p)
 {
-       if (!p || strncmp(p, "auto", 5) == 0 || strncmp(p, "on", 2) == 0 ) {
+       if (!p || strncmp(p, "auto", 4) == 0 || strncmp(p, "on", 2) == 0 ) {
                /* Until firmware tells us, we have the barrier with auto */
                return 0;
        } else if (strncmp(p, "off", 3) == 0) {
-- 
2.55.0

Attachment: signature.asc
Description: PGP signature

Reply via email to