# git rev-parse -q --verify fca7526b7d8910c6125cb1ebc3e78ccd5f50ec52^{commit} fca7526b7d8910c6125cb1ebc3e78ccd5f50ec52 already have revision, skipping fetch # git checkout -q -f -B kisskb fca7526b7d8910c6125cb1ebc3e78ccd5f50ec52 # git clean -qxdf # < git log -1 # commit fca7526b7d8910c6125cb1ebc3e78ccd5f50ec52 # Author: Linus Torvalds # Date: Tue Feb 20 12:16:47 2024 -0800 # # drm/tests/drm_buddy: fix build failure on 32-bit targets # # Guenter Roeck reports that commit a64056bb5a32 ("drm/tests/drm_buddy: # add alloc_contiguous test") causes build failures on 32-bit targets: # # "This patch breaks the build on all 32-bit systems since it introduces # an unhandled direct 64-bit divide operation. # # ERROR: modpost: "__umoddi3" [drivers/gpu/drm/tests/drm_buddy_test.ko] undefined! # ERROR: modpost: "__moddi3" [drivers/gpu/drm/tests/drm_buddy_test.ko] undefined!" # # and the uses of 'u64' are all entirely pointless. Yes, the arguments to # drm_buddy_init() and drm_buddy_alloc_blocks() are in fact of type 'u64', # but none of the values here are remotely relevant, and the compiler will # happily just do the type expansion. # # Of course, in a perfect world the compiler would also have just noticed # that all the values in question are tiny, and range analysis would have # shown that doing a 64-bit divide is pointless, but that is admittedly # expecting a fair amount of the compiler. # # IOW, we shouldn't write code that the compiler then has to notice is # unnecessarily complicated just to avoid extra work. We do have fairly # high expectations of compilers, but kernel code should be reasonable to # begin with. # # It turns out that there are also other issues with this code: the KUnit # assertion messages have incorrect types in the format strings, but # that's a widely spread issue caused by the KUnit infrastructure not # having enabled format string verification. We'll get that sorted out # separately. # # Reported-by: Guenter Roeck # Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous test") # Link: https://lore.kernel.org/all/538327ff-8d34-41d5-a9ae-1a334744f5ae@roeck-us.net/ # Cc: Matthew Auld # Cc: Arunpravin Paneer Selvam # Cc: Christian König # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-8.5.0-nolibc/m68k-linux/bin/m68k-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.5.0-nolibc/m68k-linux/bin/m68k-linux-ld --version # < git log --format=%s --max-count=1 fca7526b7d8910c6125cb1ebc3e78ccd5f50ec52 # make -s -j 160 ARCH=m68k O=/kisskb/build/linus_sun3_defconfig_m68k-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.5.0-nolibc/m68k-linux/bin/m68k-linux- sun3_defconfig # < make -s -j 160 ARCH=m68k O=/kisskb/build/linus_sun3_defconfig_m68k-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.5.0-nolibc/m68k-linux/bin/m68k-linux- help # make -s -j 160 ARCH=m68k O=/kisskb/build/linus_sun3_defconfig_m68k-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.5.0-nolibc/m68k-linux/bin/m68k-linux- olddefconfig # make -s -j 160 ARCH=m68k O=/kisskb/build/linus_sun3_defconfig_m68k-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.5.0-nolibc/m68k-linux/bin/m68k-linux- In file included from /kisskb/src/include/linux/swab.h:5, from /kisskb/src/include/uapi/linux/byteorder/big_endian.h:14, from /kisskb/src/include/linux/byteorder/big_endian.h:5, from /kisskb/src/arch/m68k/include/uapi/asm/byteorder.h:5, from /kisskb/src/include/asm-generic/bitops/le.h:6, from /kisskb/src/arch/m68k/include/asm/bitops.h:566, from /kisskb/src/include/linux/bitops.h:68, from /kisskb/src/include/linux/kernel.h:23, from /kisskb/src/drivers/net/ethernet/i825xx/sun3_82586.c:32: /kisskb/src/drivers/net/ethernet/i825xx/sun3_82586.c: In function 'sun3_82586_timeout': /kisskb/src/drivers/net/ethernet/i825xx/sun3_82586.c:990:108: warning: array subscript 1 is above array bounds of 'volatile struct transmit_cmd_struct *[1]' [-Warray-bounds] printk("%s: command-stats: %04x %04x\n",dev->name,swab16(p->xmit_cmds[0]->cmd_status),swab16(p->xmit_cmds[1]->cmd_status)); ~~~~~~~~~~~~^~~ /kisskb/src/include/uapi/linux/swab.h:107:12: note: in definition of macro '__swab16' __fswab16(x)) ^ /kisskb/src/include/linux/printk.h:455:26: note: in expansion of macro 'printk_index_wrap' #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~ /kisskb/src/drivers/net/ethernet/i825xx/sun3_82586.c:990:3: note: in expansion of macro 'printk' printk("%s: command-stats: %04x %04x\n",dev->name,swab16(p->xmit_cmds[0]->cmd_status),swab16(p->xmit_cmds[1]->cmd_status)); ^~~~~~ Completed OK # rm -rf /kisskb/build/linus_sun3_defconfig_m68k-gcc8 # Build took: 0:01:53.838622