linux/include
Dmitry Torokhov 1ab33c0314 asm-generic: make sparse happy with odd-sized put_unaligned_*()
__put_unaligned_be24() and friends use implicit casts to convert
larger-sized data to bytes, which trips sparse truncation warnings when
the argument is a constant:

    CC [M]  drivers/input/touchscreen/hynitron_cstxxx.o
    CHECK   drivers/input/touchscreen/hynitron_cstxxx.c
  drivers/input/touchscreen/hynitron_cstxxx.c: note: in included file (through arch/x86/include/generated/asm/unaligned.h):
  include/asm-generic/unaligned.h:119:16: warning: cast truncates bits from constant value (aa01a0 becomes a0)
  include/asm-generic/unaligned.h:120:20: warning: cast truncates bits from constant value (aa01 becomes 1)
  include/asm-generic/unaligned.h:119:16: warning: cast truncates bits from constant value (ab00d0 becomes d0)
  include/asm-generic/unaligned.h:120:20: warning: cast truncates bits from constant value (ab00 becomes 0)

To avoid this let's mask off upper bits explicitly, the resulting code
should be exactly the same, but it will keep sparse happy.

Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Closes: https://lore.kernel.org/oe-kbuild-all/202401070147.gqwVulOn-lkp@intel.com/
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-01-08 09:48:35 -08:00
..
acpi
asm-generic asm-generic: make sparse happy with odd-sized put_unaligned_*() 2024-01-08 09:48:35 -08:00
clocksource
crypto
drm Merge tag 'drm-misc-fixes-2023-12-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes 2023-12-08 12:16:11 +10:00
dt-bindings
keys
kunit
kvm
linux Including fixes from wireless and netfilter. 2024-01-04 16:34:50 -08:00
math-emu
media
memory
misc
net net/tcp: Only produce AO/MD5 logs if there are any keys 2024-01-04 09:07:04 -08:00
pcmcia
ras
rdma RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz 2023-12-04 20:02:41 -04:00
rv
scsi
soc
sound
target
trace 9p: prevent read overrun in protocol dump tracepoint 2023-12-05 21:18:44 +09:00
uapi fuse: Rename DIRECT_IO_RELAX to DIRECT_IO_ALLOW_MMAP 2023-12-04 10:14:39 +01:00
ufs
vdso
video
xen