Commit 20c82d93 authored by Daniel Sanders's avatar Daniel Sanders Committed by Ralf Baechle

MIPS: LLVMLinux: Fix an 'inline asm input/output type mismatch' error.

Replace incorrect matching constraint that caused the error with an alternative
that still has the required constraints on the inline assembly.

This is the error message reported by clang:
arch/mips/include/asm/checksum.h:285:27: error: unsupported inline asm: input with type '__be32' (aka 'unsigned int') matching output with type 'unsigned short'
          "0" (htonl(len)), "1" (htonl(proto)), "r" (sum));
                                 ^~~~~~~~~~~~

The changed code can be compiled successfully by both gcc and clang.
Signed-off-by: default avatarDaniel Sanders <daniel.sanders@imgtec.com>
Signed-off-by: default avatarToma Tabacu <toma.tabacu@imgtec.com>
Suggested-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/9313/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent e6baf0e0
...@@ -218,6 +218,8 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, ...@@ -218,6 +218,8 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
__u32 len, unsigned short proto, __u32 len, unsigned short proto,
__wsum sum) __wsum sum)
{ {
__wsum tmp;
__asm__( __asm__(
" .set push # csum_ipv6_magic\n" " .set push # csum_ipv6_magic\n"
" .set noreorder \n" " .set noreorder \n"
...@@ -270,9 +272,9 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, ...@@ -270,9 +272,9 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
" addu %0, $1 # Add final carry\n" " addu %0, $1 # Add final carry\n"
" .set pop" " .set pop"
: "=r" (sum), "=r" (proto) : "=&r" (sum), "=&r" (tmp)
: "r" (saddr), "r" (daddr), : "r" (saddr), "r" (daddr),
"0" (htonl(len)), "1" (htonl(proto)), "r" (sum)); "0" (htonl(len)), "r" (htonl(proto)), "r" (sum));
return csum_fold(sum); return csum_fold(sum);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment