From: Geert Uytterhoeven Date: Wed, 8 Jan 2025 17:22:00 +0000 (+0100) Subject: m68k: libgcc: Fix lvalue abuse in umul_ppmm() X-Git-Tag: v6.14-rc1~199^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb2e0fb1e6aa9f737d6e0cbcf6494c51180e6d6d;p=thirdparty%2Fkernel%2Fstable.git m68k: libgcc: Fix lvalue abuse in umul_ppmm() lib/muldi3.c:53:28: warning: asm output is not an lvalue lib/muldi3.c:53:28: warning: asm output is not an lvalue lib/muldi3.c:53:28: error: not addressable lib/muldi3.c:53:28: warning: generating address of non-lvalue (11) lib/muldi3.c:53:28: warning: generating address of non-lvalue (11) Fix the lvalue warnings by replacing the casts on the output operands by intermediate variables of the right type. Fix the "not addressable" error by replacing the cast on the second input operand by an intermediate variable, too. Treat the other input operand the same for consistency. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202501030516.uZrwnuQQ-lkp@intel.com/ Suggested-by: Linus Torvalds Signed-off-by: Geert Uytterhoeven Acked-by: Greg Ungerer Link: https://lore.kernel.org/c408cfb85bfde8929dcaa4ebea29ade4e1452d8e.1736356696.git.geert@linux-m68k.org --- diff --git a/arch/m68k/include/asm/libgcc.h b/arch/m68k/include/asm/libgcc.h index 1cce6d130d805..27e17195bd7be 100644 --- a/arch/m68k/include/asm/libgcc.h +++ b/arch/m68k/include/asm/libgcc.h @@ -10,11 +10,18 @@ * will fallback to using the C-coded version of umul_ppmm(). */ #define umul_ppmm(w1, w0, u, v) \ - __asm__ ("mulu%.l %3,%1:%0" \ - : "=d" ((unsigned long)(w0)), \ - "=d" ((unsigned long)(w1)) \ - : "%0" ((unsigned long)(u)), \ - "dmi" ((unsigned long)(v))) + do { \ + unsigned long __u = (u), __v = (v); \ + unsigned long __w0, __w1; \ + \ + __asm__ ("mulu%.l %3,%1:%0" \ + : "=d" (__w0), \ + "=d" (__w1) \ + : "%0" (__u), \ + "dmi" (__v)); \ + \ + (w0) = __w0; (w1) = __w1; \ + } while (0) #endif /* !CONFIG_CPU_HAS_NO_MULDIV64 */ #endif /* __ASM_M68K_LIBGCC_H */