lib/mpi: Fix building for powerpc with clang
authorNathan Chancellor <natechancellor@gmail.com>
Mon, 13 Apr 2020 19:50:42 +0000 (12:50 -0700)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 24 Apr 2020 03:14:59 +0000 (13:14 +1000)
0day reports over and over on an powerpc randconfig with clang:

lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a
inline asm context requiring an l-value: remove the cast or build with
-fheinous-gnu-extensions

Remove the superfluous casts, which have been done previously for x86
and arm32 in commit dea632cadd12 ("lib/mpi: fix build with clang") and
commit 7b7c1df2883d ("lib/mpi/longlong.h: fix building with 32-bit
x86").

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://github.com/ClangBuiltLinux/linux/issues/991
Link: https://lore.kernel.org/r/20200413195041.24064-1-natechancellor@gmail.com
lib/mpi/longlong.h

index 2dceaca..891e1c3 100644 (file)
@@ -722,22 +722,22 @@ do {                                                                      \
 do { \
        if (__builtin_constant_p(bh) && (bh) == 0) \
                __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \
-               : "=r" ((USItype)(sh)), \
-               "=&r" ((USItype)(sl)) \
+               : "=r" (sh), \
+               "=&r" (sl) \
                : "%r" ((USItype)(ah)), \
                "%r" ((USItype)(al)), \
                "rI" ((USItype)(bl))); \
        else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \
                __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \
-               : "=r" ((USItype)(sh)), \
-               "=&r" ((USItype)(sl)) \
+               : "=r" (sh), \
+               "=&r" (sl) \
                : "%r" ((USItype)(ah)), \
                "%r" ((USItype)(al)), \
                "rI" ((USItype)(bl))); \
        else \
                __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \
-               : "=r" ((USItype)(sh)), \
-               "=&r" ((USItype)(sl)) \
+               : "=r" (sh), \
+               "=&r" (sl) \
                : "%r" ((USItype)(ah)), \
                "r" ((USItype)(bh)), \
                "%r" ((USItype)(al)), \
@@ -747,36 +747,36 @@ do { \
 do { \
        if (__builtin_constant_p(ah) && (ah) == 0) \
                __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \
-               : "=r" ((USItype)(sh)), \
-               "=&r" ((USItype)(sl)) \
+               : "=r" (sh), \
+               "=&r" (sl) \
                : "r" ((USItype)(bh)), \
                "rI" ((USItype)(al)), \
                "r" ((USItype)(bl))); \
        else if (__builtin_constant_p(ah) && (ah) == ~(USItype) 0) \
                __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \
-               : "=r" ((USItype)(sh)), \
-               "=&r" ((USItype)(sl)) \
+               : "=r" (sh), \
+               "=&r" (sl) \
                : "r" ((USItype)(bh)), \
                "rI" ((USItype)(al)), \
                "r" ((USItype)(bl))); \
        else if (__builtin_constant_p(bh) && (bh) == 0) \
                __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \
-               : "=r" ((USItype)(sh)), \
-               "=&r" ((USItype)(sl)) \
+               : "=r" (sh), \
+               "=&r" (sl) \
                : "r" ((USItype)(ah)), \
                "rI" ((USItype)(al)), \
                "r" ((USItype)(bl))); \
        else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \
                __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \
-               : "=r" ((USItype)(sh)), \
-               "=&r" ((USItype)(sl)) \
+               : "=r" (sh), \
+               "=&r" (sl) \
                : "r" ((USItype)(ah)), \
                "rI" ((USItype)(al)), \
                "r" ((USItype)(bl))); \
        else \
                __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \
-               : "=r" ((USItype)(sh)), \
-               "=&r" ((USItype)(sl)) \
+               : "=r" (sh), \
+               "=&r" (sl) \
                : "r" ((USItype)(ah)), \
                "r" ((USItype)(bh)), \
                "rI" ((USItype)(al)), \
@@ -787,7 +787,7 @@ do { \
 do { \
        USItype __m0 = (m0), __m1 = (m1); \
        __asm__ ("mulhwu %0,%1,%2" \
-       : "=r" ((USItype) ph) \
+       : "=r" (ph) \
        : "%r" (__m0), \
        "r" (__m1)); \
        (pl) = __m0 * __m1; \