From: Josh Law Date: Sun, 1 Mar 2026 15:21:42 +0000 (+0000) Subject: lib: glob: replace bitwise OR with logical operation on boolean X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=33a3dd9bfd410044225aa9f812102055d0e21d59;p=thirdparty%2Fkernel%2Fstable.git lib: glob: replace bitwise OR with logical operation on boolean Using bitwise OR (|=) on a boolean variable is valid C, but replacing it with a direct logical assignment makes the intent clearer and appeases strict static analysis tools. Link: https://lkml.kernel.org/r/20260301152143.2572137-2-objecting@objecting.org Signed-off-by: Josh Law Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton --- diff --git a/lib/glob.c b/lib/glob.c index 44a8d5e4e99b..877bdd0884a6 100644 --- a/lib/glob.c +++ b/lib/glob.c @@ -96,7 +96,8 @@ bool __pure glob_match(char const *pat, char const *str) class += 2; /* Any special action if a > b? */ } - match |= (a <= c && c <= b); + if (a <= c && c <= b) + match = true; } while ((a = *class++) != ']'); if (match == inverted)