Skip to content

Commit 8803f0a

Browse files
nathanchancegregkh
authored andcommitted
MIPS: tlbex: Explicitly cast _PAGE_NO_EXEC to a boolean
[ Upstream commit c59ae0a ] clang warns: arch/mips/mm/tlbex.c:634:19: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand] if (cpu_has_rixi && _PAGE_NO_EXEC) { ^ ~~~~~~~~~~~~~ arch/mips/mm/tlbex.c:634:19: note: use '&' for a bitwise operation if (cpu_has_rixi && _PAGE_NO_EXEC) { ^~ & arch/mips/mm/tlbex.c:634:19: note: remove constant to silence this warning if (cpu_has_rixi && _PAGE_NO_EXEC) { ~^~~~~~~~~~~~~~~~ 1 error generated. Explicitly cast this value to a boolean so that clang understands we intend for this to be a non-zero value. Fixes: 00bf1c6 ("MIPS: tlbex: Avoid placing software PTE bits in Entry* PFN fields") Link: ClangBuiltLinux/linux#609 Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Paul Burton <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: James Hogan <[email protected]> Cc: Nick Desaulniers <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent ff0cdd0 commit 8803f0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/mips/mm/tlbex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ static __maybe_unused void build_convert_pte_to_entrylo(u32 **p,
631631
return;
632632
}
633633

634-
if (cpu_has_rixi && _PAGE_NO_EXEC) {
634+
if (cpu_has_rixi && !!_PAGE_NO_EXEC) {
635635
if (fill_includes_sw_bits) {
636636
UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL));
637637
} else {

0 commit comments

Comments
 (0)