From patchwork Fri Dec 16 10:56:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101397 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1334087qgi; Fri, 16 Dec 2016 02:59:27 -0800 (PST) X-Received: by 10.107.31.73 with SMTP id f70mr2375191iof.232.1481885966993; Fri, 16 Dec 2016 02:59:26 -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.26; Fri, 16 Dec 2016 02:59:26 -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 S933947AbcLPK6p (ORCPT + 25 others); Fri, 16 Dec 2016 05:58:45 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:63093 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760757AbcLPK5G (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 0M5P83-1cXKCz0xnL-00zX8k; 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 10/13] asm-generic: mark cmpxchg as __always_inline for gcc-4.3 Date: Fri, 16 Dec 2016 11:56:31 +0100 Message-Id: <20161216105634.235457-11-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:0wthnYjJcfwJjt8em8pjW6mWCb+05G1x+UJ4FEpgV4RKl12sKEo CrZbNSTtYEV7+gj17W35EmFLItwUGjyBUH5mmEgyiJMlk/TXwFBEbB1gfV9CYQvG1PImrFv WzHpVOPZBaRA6vHz+H4deSFu0YXqSLprGvQMO5CtAQiSd8KTyScX7KUk6MVJMlMZuRRqie5 FF3NuG2pmtjvRX/U3Vaow== X-UI-Out-Filterresults: notjunk:1; V01:K0:AN3QBy7lSfQ=:O1tqGlVP/hmlMRCacKc0qR cs1WXeKGbPoxzjeeP4mOcA5+1QuBN6nGnbR6LSq8R2Gh3/MwdXF6gL8CGCTsCwXARRD6yu35F uzvnJcVnM4Pob86QKXgQWmOosDpOEuqay8pJzCRCzBnG4kN3kBW9B6vXoWzGpjNVALuShyzhn kKKBJGBFjK/adBL4WnZSPgGF3GFnTsXrla8jymA9jH/P1eOILrhV2WFykQ6TSs5lZNLze3wwa Y7xPDE8HTwNwCMl9zkYrlERb1qn7UNguDMDLim8LY3NzL+hbmPj6+9pq1K/pZ5iqZv7z8lkJP W1u8vnJ2yQhOpWZxLuM08O+oO2kQ/Le8pAysT++CoV2hcRQmvnFnCI3uQZZcGgTNRfSFsclGP VCZdEZnzTClu9e/dec68EckHta3cJBnCd5nKMfJgX0LaLJnFaUATbmqvZjkzijkNqUt0kk27p +THbMGHuRXCYpffHTLcs4FmddpIWfiMZlFU/u/R7cWXJ6QYctCU/mBdHVCsoB9f70Mf1BoQHb 5uwWOTTKl+pR5DasPNT99VQEFRNVtBcqFZ4zi0ahhwDLKBn/pC1tDxh4sGsajR4nAgD1wwCCs VrotN5vUm5OXIIuFhcW2bZJ5LBG9HEj6XiTOpceDBf3g3tG3h7Ck2zI7sx7dTKVd+GdqijVmP 2mp0gAYrKN51u0NWbavL7Xvc94jMpQ2cZls3Syd/j4KulwSWrDIrznR7xkzjljrC1aH0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With CONFIG_OPTIMIZE_INLINING and older compilers, we can get a link error such as kernel/task_work.o: In function `__cmpxchg_local_generic': task_work.c:(.text+0x14c): undefined reference to `wrong_size_cmpxchg' kernel/locking/rtmutex.o: In function `__cmpxchg_local_generic': rtmutex.c:(.text+0x5ec): undefined reference to `wrong_size_cmpxchg' kernel/trace/ring_buffer.o: In function `__cmpxchg_local_generic': Marking the functions in question as __always_inline avoids that possibility. Signed-off-by: Arnd Bergmann --- include/asm-generic/cmpxchg-local.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.9.0 diff --git a/include/asm-generic/cmpxchg-local.h b/include/asm-generic/cmpxchg-local.h index 70bef78912b7..e82d7032b1b8 100644 --- a/include/asm-generic/cmpxchg-local.h +++ b/include/asm-generic/cmpxchg-local.h @@ -11,7 +11,8 @@ extern unsigned long wrong_size_cmpxchg(volatile void *ptr) * Generic version of __cmpxchg_local (disables interrupts). Takes an unsigned * long parameter, supporting various types of architectures. */ -static inline unsigned long __cmpxchg_local_generic(volatile void *ptr, +static __always_inline unsigned long +__cmpxchg_local_generic(volatile void *ptr, unsigned long old, unsigned long new, int size) { unsigned long flags, prev; @@ -50,8 +51,8 @@ static inline unsigned long __cmpxchg_local_generic(volatile void *ptr, /* * Generic version of __cmpxchg64_local. Takes an u64 parameter. */ -static inline u64 __cmpxchg64_local_generic(volatile void *ptr, - u64 old, u64 new) +static __always_inline u64 +__cmpxchg64_local_generic(volatile void *ptr, u64 old, u64 new) { u64 prev; unsigned long flags;