android_kernel_xiaomi_sm8350/include/asm-generic
ndesaulniers@google.com 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/20230801-bitwise-v1-1-799bec468dc4@google.com/
Fixes: 36126f8f2e ("word-at-a-time: make the interfaces truly generic")
Debugged-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-11 11:53:54 +02:00
..
bitops
vdso
4level-fixup.h
5level-fixup.h
asm-offsets.h
asm-prototypes.h
atomic64.h
atomic-instrumented.h
atomic-long.h
atomic.h
audit_change_attr.h
audit_dir_write.h
audit_read.h
audit_signal.h
audit_write.h
barrier.h
bitops-instrumented.h
bitops.h
bitsperlong.h
bug.h
cache.h
cacheflush.h
checksum.h
cmpxchg-local.h
cmpxchg.h
compat.h
current.h
delay.h
device.h
div64.h
dma-contiguous.h
dma-mapping.h
dma.h
early_ioremap.h
emergency-restart.h
error-injection.h
exec.h
export.h
extable.h
fb.h
fixmap.h
flat.h
ftrace.h
futex.h
getorder.h
gpio.h
hardirq.h
hugetlb.h
hw_irq.h
ide_iops.h
int-ll64.h
io.h asm-generic/io.h: suppress endianness warnings for readq() and writeq() 2023-05-17 11:35:32 +02:00
ioctl.h
iomap.h
irq_regs.h
irq_work.h
irq.h
irqflags.h
Kbuild
kdebug.h
kmap_types.h
kprobes.h
kvm_para.h
linkage.h
local64.h
local.h
mcs_spinlock.h
memory_model.h
mm_hooks.h
mm-arch-hooks.h
mmiowb_types.h
mmiowb.h
mmu_context.h
mmu.h
module.h
mshyperv.h
msi.h
page.h
param.h
parport.h
pci_iomap.h
pci.h
percpu.h
pgalloc.h
pgtable-nop4d-hack.h
pgtable-nop4d.h
pgtable-nopmd.h
pgtable-nopud.h
pgtable.h
preempt.h
qrwlock_types.h
qrwlock.h
qspinlock_types.h
qspinlock.h
resource.h
seccomp.h
sections.h
serial.h
set_memory.h
shmparam.h
signal.h
simd.h
spinlock.h
statfs.h
string.h
switch_to.h
syscall.h
syscalls.h
termios-base.h
termios.h
timex.h
tlb.h mm/khugepaged: fix GUP-fast interaction by sending IPI 2022-12-14 11:30:42 +01:00
tlbflush.h
topology.h
trace_clock.h
uaccess.h
unaligned.h
user.h
vga.h
vmlinux.lds.h arch: fix broken BuildID for arm64 and riscv 2023-03-17 08:32:53 +01:00
vtime.h
word-at-a-time.h word-at-a-time: use the same return type for has_zero regardless of endianness 2023-08-11 11:53:54 +02:00
xor.h