From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B758CA9EA9 for ; Fri, 18 Oct 2019 22:15:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 24E7E21852 for ; Fri, 18 Oct 2019 22:15:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571436934; bh=9bqpOQ/HTpFfl9Zq2N2vZhaiabTgyqLrkdRiLClf/oc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=pSxp2s0Puuxe/BS/CXODhO+ewi6VblNlo41XpZqi7YW7Fwxepylno0uzCOqDIaSNI Fij47x50zDS4rr8lRi7lVUYJ4rvLdMmRb0x3xGhNg7wGqWPnyprvy1LcDB/ZnJXClP PIifu6WXPTAqMmXgdzvBsSwlNEHD4ll7IE6MjprM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728492AbfJRWP3 (ORCPT ); Fri, 18 Oct 2019 18:15:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:41608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388347AbfJRWI6 (ORCPT ); Fri, 18 Oct 2019 18:08:58 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3E70B22468; Fri, 18 Oct 2019 22:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571436537; bh=9bqpOQ/HTpFfl9Zq2N2vZhaiabTgyqLrkdRiLClf/oc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kj2C7mI1dWS1H+VI+rSu921AWU/4LrWza/EKTrBNwx8JLQFi8S8Eq4lm4f0gjJcDi aAKjNIvHPqSip5avh8mnmUNmgXmp2ziFoPJ8X8327SzAMRoXYhtOgv/Uo2UUhlF3y8 sXDQ3QHDZEUhXZ3kxneyTu4lK5KqFj3YYb8OMx0w= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Thomas Bogendoerfer , Paul Burton , Ralf Baechle , James Hogan , linux-mips@vger.kernel.org, Sasha Levin , linux-mips@linux-mips.org Subject: [PATCH AUTOSEL 4.14 40/56] MIPS: include: Mark __cmpxchg as __always_inline Date: Fri, 18 Oct 2019 18:07:37 -0400 Message-Id: <20191018220753.10002-40-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191018220753.10002-1-sashal@kernel.org> References: <20191018220753.10002-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org From: Thomas Bogendoerfer [ Upstream commit 88356d09904bc606182c625575237269aeece22e ] Commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly") allows compiler to uninline functions marked as 'inline'. In cace of cmpxchg this would cause to reference function __cmpxchg_called_with_bad_pointer, which is a error case for catching bugs and will not happen for correct code, if __cmpxchg is inlined. Signed-off-by: Thomas Bogendoerfer [paul.burton@mips.com: s/__cmpxchd/__cmpxchg in subject] Signed-off-by: Paul Burton Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Sasha Levin --- arch/mips/include/asm/cmpxchg.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h index 89e9fb7976fe6..895f91b9e89c3 100644 --- a/arch/mips/include/asm/cmpxchg.h +++ b/arch/mips/include/asm/cmpxchg.h @@ -146,8 +146,9 @@ static inline unsigned long __xchg(volatile void *ptr, unsigned long x, extern unsigned long __cmpxchg_small(volatile void *ptr, unsigned long old, unsigned long new, unsigned int size); -static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, - unsigned long new, unsigned int size) +static __always_inline +unsigned long __cmpxchg(volatile void *ptr, unsigned long old, + unsigned long new, unsigned int size) { switch (size) { case 1: -- 2.20.1