Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933137AbbBIQpY (ORCPT ); Mon, 9 Feb 2015 11:45:24 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:20302 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755776AbbBIQpX (ORCPT ); Mon, 9 Feb 2015 11:45:23 -0500 From: Daniel Sanders CC: Daniel Sanders , Toma Tabacu , Ralf Baechle , Markos Chandras , Leonid Yegoshin , "Maciej W. Rozycki" , , Subject: [PATCH v3 3/5] MIPS: LLVMLinux: Fix an 'inline asm input/output type mismatch' error. Date: Mon, 9 Feb 2015 16:44:58 +0000 Message-ID: <1423500298-21368-1-git-send-email-daniel.sanders@imgtec.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1423481632-27903-1-git-send-email-daniel.sanders@imgtec.com> References: <1423481632-27903-1-git-send-email-daniel.sanders@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.14.104] To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2342 Lines: 64 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: Daniel Sanders Signed-off-by: Toma Tabacu Suggested-by: Maciej W. Rozycki Cc: Ralf Baechle Cc: Markos Chandras Cc: Leonid Yegoshin Cc: Maciej W. Rozycki Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org --- Rewrote the patch following Maciej's suggestion where he observed that the assembly was somewhat strange and suggested correcting the constraints and using a local of matching type. Fixed a silly whitespace mistake that was introduced in v2. arch/mips/include/asm/checksum.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h index 3418c51..ebad4f4 100644 --- a/arch/mips/include/asm/checksum.h +++ b/arch/mips/include/asm/checksum.h @@ -228,6 +228,8 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, __u32 len, unsigned short proto, __wsum sum) { + __wsum tmp; + __asm__( " .set push # csum_ipv6_magic\n" " .set noreorder \n" @@ -280,9 +282,9 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, " addu %0, $1 # Add final carry\n" " .set pop" - : "=r" (sum), "=r" (proto) + : "=&r" (sum), "=&r" (tmp) : "r" (saddr), "r" (daddr), - "0" (htonl(len)), "1" (htonl(proto)), "r" (sum)); + "0" (htonl(len)), "r" (htonl(proto)), "r" (sum)); return csum_fold(sum); } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/