aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bitmap.c
diff options
context:
space:
mode:
authorNathan Chancellor <[email protected]>2022-08-02 17:59:36 +0000
committerThomas Bogendoerfer <[email protected]>2022-08-04 13:57:32 +0000
commit74de14fe05dd6b151d73cb0c73c8ec874cbdcde6 (patch)
tree445f14c8994f7ad09baeb8f893af333ef617d9c5 /tools/lib/bitmap.c
parentRevert "MIPS: octeon: Remove vestiges of CONFIG_CAVIUM_RESERVE32" (diff)
downloadkernel-74de14fe05dd6b151d73cb0c73c8ec874cbdcde6.tar.gz
kernel-74de14fe05dd6b151d73cb0c73c8ec874cbdcde6.zip
MIPS: tlbex: Explicitly compare _PAGE_NO_EXEC against 0
When CONFIG_XPA is enabled, Clang warns: arch/mips/mm/tlbex.c:629:24: error: converting the result of '<<' to a boolean; did you mean '(1 << _PAGE_NO_EXEC_SHIFT) != 0'? [-Werror,-Wint-in-bool-context] if (cpu_has_rixi && !!_PAGE_NO_EXEC) { ^ arch/mips/include/asm/pgtable-bits.h:174:28: note: expanded from macro '_PAGE_NO_EXEC' # define _PAGE_NO_EXEC (1 << _PAGE_NO_EXEC_SHIFT) ^ arch/mips/mm/tlbex.c:2568:24: error: converting the result of '<<' to a boolean; did you mean '(1 << _PAGE_NO_EXEC_SHIFT) != 0'? [-Werror,-Wint-in-bool-context] if (!cpu_has_rixi || !_PAGE_NO_EXEC) { ^ arch/mips/include/asm/pgtable-bits.h:174:28: note: expanded from macro '_PAGE_NO_EXEC' # define _PAGE_NO_EXEC (1 << _PAGE_NO_EXEC_SHIFT) ^ 2 errors generated. _PAGE_NO_EXEC can be '0' or '1 << _PAGE_NO_EXEC_SHIFT' depending on the build and runtime configuration, which is what the negation operators are trying to convey. To silence the warning, explicitly compare against 0 so the result of the '<<' operator is not implicitly converted to a boolean. According to its documentation, GCC enables -Wint-in-bool-context with -Wall but this warning is not visible when building the same configuration with GCC. It appears GCC only warns when compiling C++, not C, although the documentation makes no note of this: https://godbolt.org/z/x39q3brxf Reported-by: Sudip Mukherjee (Codethink) <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
Diffstat (limited to 'tools/lib/bitmap.c')
0 files changed, 0 insertions, 0 deletions