Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753808AbdFMWjj (ORCPT ); Tue, 13 Jun 2017 18:39:39 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:33234 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752456AbdFMWji (ORCPT ); Tue, 13 Jun 2017 18:39:38 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 13 Jun 2017 15:39:37 -0700 From: Sodagudi Prasad To: catalin.marinas@arm.com, will.deacon@arm.com, mingo@kernel.org, peterz@infradead.org, mark.rutland@arm.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Using __always_inline attribute Message-ID: <2a762f1f3b355e71c5bca6a6e00bffe0@codeaurora.org> User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1550 Lines: 49 Hi All, With a variant of a CLANG(based on 4.0) following errors observed on Linux 4.12-rc5 tag. net/built-in.o: In function `__xchg_mb': arch/arm64/include/asm/cmpxchg.h:99: \ undefined reference to `__compiletime_assert_99' arch/arm64/include/asm/cmpxchg.h:99: \ undefined reference to `__compiletime_assert_99 Clang does not seems to be marking this macro as inline and causing above compilation issue due to BUILD_BUG(). We added __always_inline attribute to this macro as shown below, so that clang forces this macro to be always inline. Based on definition of __xchg##sfx, it should always be inline. Can we force this macro to be __always_inline ? diff --git a/arch/arm64/include/asm/cmpxchg.h b/arch/arm64/include/asm/cmpxchg.h index ae852ad..ce57cec 100644 --- a/arch/arm64/include/asm/cmpxchg.h +++ b/arch/arm64/include/asm/cmpxchg.h @@ -73,7 +73,7 @@ #undef __XCHG_CASE #define __XCHG_GEN(sfx) \ -static inline unsigned long __xchg##sfx(unsigned long x, \ +static __always_inline unsigned long __xchg##sfx(unsigned long x, \ volatile void *ptr, \ int size) \ { \ -Thanks, Prasad -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, Linux Foundation Collaborative Project