android_kernel_motorola_sm6375/arch/powerpc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
[email protected] d2fb096926 word-at-a-time: use the same return type for has_zero regardless of endianness
[ Upstream commit 79e8328e5acbe691bbde029a52c89d70dcbc22f3 ]

Compiling big-endian targets with Clang produces the diagnostic:

  fs/namei.c:2173:13: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
	} while (!(has_zero(a, &adata, &constants) | has_zero(b, &bdata, &constants)));
	          ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                               ||
  fs/namei.c:2173:13: note: cast one or both operands to int to silence this warning

It appears that when has_zero was introduced, two definitions were
produced with different signatures (in particular different return
types).

Looking at the usage in hash_name() in fs/namei.c, I suspect that
has_zero() is meant to be invoked twice per while loop iteration; using
logical-or would not update `bdata` when `a` did not have zeros.  So I
think it's preferred to always return an unsigned long rather than a
bool than update the while loop in hash_name() to use a logical-or
rather than bitwise-or.

[ Also changed powerpc version to do the same  - Linus ]

Link: https://github.com/ClangBuiltLinux/linux/issues/1832
Link: https://lore.kernel.org/lkml/[email protected]/
Fixes: 36126f8f2e ("word-at-a-time: make the interfaces truly generic")
Debugged-by: Nathan Chancellor <[email protected]>
Signed-off-by: Nick Desaulniers <[email protected]>
Acked-by: Heiko Carstens <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2023-08-11 11:53:54 +02:00
..
boot powerpc: dts: t208x: Disable 10G on MAC1 and MAC2 2023-02-25 11:53:26 +01:00
configs Remove DECnet support from kernel 2023-06-21 15:44:10 +02:00
crypto
include word-at-a-time: use the same return type for has_zero regardless of endianness 2023-08-11 11:53:54 +02:00
kernel powerpc/rtas: use memmove for potentially overlapping buffer copy 2023-05-17 11:35:50 +02:00
kvm treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
lib
math-emu powerpc/math_emu/efp: Include module.h 2022-10-26 13:22:44 +02:00
mm powerpc/mm/dax: Fix the condition when checking if altmap vmemap can cross-boundary 2023-07-27 08:37:17 +02:00
net
oprofile
perf powerpc/imc-pmu: Revert nest_init_lock to being a mutex 2023-02-22 12:50:29 +01:00
platforms treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
purgatory powerpc/purgatory: remove PGO flags 2023-06-21 15:44:10 +02:00
sysdev powerpc/sysdev/tsi108: fix resource printk format warnings 2023-05-17 11:35:50 +02:00
tools
xmon
Kbuild
Kconfig
Kconfig.debug powerpc: allow PPC_EARLY_DEBUG_CPM only when SERIAL_CPM=y 2023-07-27 08:37:23 +02:00
Makefile powerpc: Fail build if using recordmcount with binutils v2.37 2023-07-27 08:37:34 +02:00
Makefile.postlink