From patchwork Fri Dec 16 10:56:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101396 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1334093qgi; Fri, 16 Dec 2016 02:59:27 -0800 (PST) X-Received: by 10.36.203.2 with SMTP id u2mr2197851itg.47.1481885967723; Fri, 16 Dec 2016 02:59:27 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69si5541315iop.162.2016.12.16.02.59.27; Fri, 16 Dec 2016 02:59:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934302AbcLPK6x (ORCPT + 25 others); Fri, 16 Dec 2016 05:58:53 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:57473 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760751AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0MPGgy-1cDSTJ3g6C-004PPZ; Fri, 16 Dec 2016 11:56:50 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 09/13] ARM: mark cmpxchg and xchg __always_inline for gcc-4.3 Date: Fri, 16 Dec 2016 11:56:30 +0100 Message-Id: <20161216105634.235457-10-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:tleukSp46N3kqsbnVUMqr7xF4fk22v8EfBuU9mpZSBHKRF0dMLd nTSCp0b4HFVaaSlkuIn0ITGxB43Y969cEbFEbP08+OGJWFvtv6WATa2+PPSBJRp7YgexbOC FuzA6BokGpI3z/FyNLKr6fiJY5mU06wluA9dIYSGOwR9VWBIqWZNp+wB3qFShTZANIZ1AKI 2SwY7LytdVaG5xNDck0gw== X-UI-Out-Filterresults: notjunk:1; V01:K0:Nzc0IAt8xWw=:HyRCeDJiMwGmY6EMpRP6vU RnrT463rf3IdvNPWxZJhGfgbGGXpwsiGZaNmZeZYds++3eOWj1Bxouk1tlsWJBfYbnfBQKLQv daln9y2AnKvvhSu+FvvJqiHSVjjoenZ3WR75xzhLiFWpMA1ochj3zKr18EcS8mIWZ63rcRQVU 2T8Of4L8EolGyGMQAf/lkkeF4IN84yiCXuDtGU2X80K4yqva2LebFtMp6XyKJKB/BEZaQMtrO Cila1CjX43smsBgR7r81wy3a3LCXGP8LTaZ24Hel0xZsEHz4RRMj3Dbh2F4Fp0cXfcE4Q5ZAF 4wa/E7Y2LgmvBwQ6roxIfsmEWcjdqdHOG4Sku2sB5obUn3uZ8mGIyn7JHyfiVpuYYpOAe+b4F 67CrF2ae5YLzHiINhZWmrgAqQSPMv9aR3gOL2dsS/1QqctoisWgBciq9wbkjONpRNc30NIxfX lHtkMzfTfUaiLH2UnvTzMkQ/d/hGzS+tjNi7wvsAT9S/QLgGxuwo9PjNyz/chhEpe0lOXXphy 6IdDcJPN94+PV7owGCHkurCznVEVtcoyvVrgQC4emUDTJZms5rGfbBduFiug39L+mjvoAWKx1 gQXrYvDZDlT66jHds+oi3YumMzexIu/GKqQTDYLJp7dP88tx6zZnnmfRVX9S02LTTZQdRqsTb 53UFZrnFXZKUiiQXIrOPZJCJWJmtBUe5z00vXfTtaEcqBtijFO0/kPqkq7lPNBwUg0Ww= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With older compiler versions like gcc-4.3 and CONFIG_OPTIMIZE_INLINING, I run into link errors: kernel/task_work.o: In function `__cmpxchg': task_work.c:(.text+0x8c): undefined reference to `__bad_cmpxchg' kernel/kthread.o: In function `__xchg': kthread.c:(.text+0x7bc): undefined reference to `__bad_xchg' This marks the functions in question as __always_inline to force inlining. Signed-off-by: Arnd Bergmann --- arch/arm/include/asm/cmpxchg.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.9.0 diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h index 12215515ba02..218ba0ae90cd 100644 --- a/arch/arm/include/asm/cmpxchg.h +++ b/arch/arm/include/asm/cmpxchg.h @@ -24,7 +24,8 @@ #define swp_is_buggy #endif -static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size) +static __always_inline unsigned long +__xchg(unsigned long x, volatile void *ptr, int size) { extern void __bad_xchg(volatile void *, int); unsigned long ret; @@ -152,8 +153,8 @@ extern void __bad_cmpxchg(volatile void *ptr, int size); * cmpxchg only support 32-bits operands on ARMv6. */ -static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, - unsigned long new, int size) +static __always_inline unsigned long +__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) { unsigned long oldval, res; @@ -213,9 +214,8 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, sizeof(*(ptr))); \ }) -static inline unsigned long __cmpxchg_local(volatile void *ptr, - unsigned long old, - unsigned long new, int size) +static __always_inline unsigned long +__cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new, int size) { unsigned long ret;