android_kernel_motorola_sm6375/arch
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
..
alpha init: Remove check_bugs() leftovers 2023-08-08 19:56:34 +02:00
arc ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard 2023-07-27 08:37:18 +02:00
arm ARM: cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:56:33 +02:00
arm64 arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro 2023-08-11 11:53:54 +02:00
c6x dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
csky dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
h8300
hexagon dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
ia64 ia64/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:56:34 +02:00
m68k m68k/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:56:34 +02:00
microblaze dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
mips mips/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:56:34 +02:00
nds32 dma-mapping: drop the dev argument to arch_sync_dma_for_* 2023-04-05 11:16:43 +02:00
nios2 nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-21 15:44:10 +02:00
openrisc openrisc: Properly store r31 to pt_regs on unhandled exceptions 2023-05-17 11:35:53 +02:00
parisc init: Remove check_bugs() leftovers 2023-08-08 19:56:34 +02:00
powerpc word-at-a-time: use the same return type for has_zero regardless of endianness 2023-08-11 11:53:54 +02:00
riscv riscv: Bump COMMAND_LINE_SIZE value to 1024 2023-04-05 11:16:39 +02:00
s390 KVM: s390: vsie: fix the length of APCB bitmap 2023-07-27 08:37:22 +02:00
sh sh/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:56:34 +02:00
sparc sparc/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:56:34 +02:00
um um/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:56:34 +02:00
unicore32
x86 x86: fix backwards merge of GDS/SRSO bit 2023-08-08 19:56:37 +02:00
xtensa init: Remove check_bugs() leftovers 2023-08-08 19:56:34 +02:00
.gitignore
Kconfig init: Provide arch_cpu_finalize_init() 2023-08-08 19:56:33 +02:00