Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4493588ybx; Mon, 4 Nov 2019 14:20:07 -0800 (PST) X-Google-Smtp-Source: APXvYqzZ+7pMi936m59AReYDVihIYpHSWQ0CPFtkbtUsWdGu2HXK801gs6+fJj/Si5BqvTh6M8p+ X-Received: by 2002:aa7:d0ce:: with SMTP id u14mr4035199edo.225.1572906007217; Mon, 04 Nov 2019 14:20:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572906007; cv=none; d=google.com; s=arc-20160816; b=ieWhH4ffAgETehxnGyCDAPSF1OTlNii3VdCvMClcYyj8HOaWc9W/kKCO+97CEcynOp nPyg4iYPMGuN7h/gaF4pxf/gbD/bbNFy4ulnp9OZmWzrycFgp0o1/dIORKNmM2MEEvW5 K/7ClVUFkPh7835yv/FfczHKk0fb+RZlBNLtwGRQCxJbX8IFJd7ufQ6HM6o+0Y8KmzVb e8BiGRU73sFJs+aF0uafTHJjzG8o1+tbSswZ8+F8rglrqVZh1/hXistUw6JAFuxi+zmc 2+J7I8iYndxpZHyTCxePv9XKzkqI9DVnNEHH2pNaxyPZc7o70jA2VkgSoK3ie3JIu5jU EXCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=b+CqgTbVdLfagdwALgnD4yfJXt4jYOYgMxPvPdkOZfE=; b=HG9N2G9hxq8xQC7g0/cHTj7WBHNclRlhUF2X6Q1s82re5VZY05OuGOs2sC2TdD9+rn tvo2YncaNm3rQ11o+++d2z69Bbea+tvn8s+kPO/o2xqZnUrZ/076pXUbXr+o6EBtUYXQ DG4+UD5StVqO4DIHL3h/JPt+EUKI1Uj62N1bLM48h6r/WEElXk+gSarTBx/lIdKvps+H GgZ50qWRNCntXZihK6HhzqaMGxnpl3suGBTqvNwZItqN6482Mjf2Y4zDGOTzWyY8LJFY 1z501lzxNh5TybTclKNYpUQ7B4eqi8+ekjZlgdNUWK4pyey75vIUKVmDwiLwY0GCnwum G18g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WiU2jPtH; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si9344358ede.119.2019.11.04.14.19.44; Mon, 04 Nov 2019 14:20:07 -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; dkim=pass header.i=@kernel.org header.s=default header.b=WiU2jPtH; 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 S2389611AbfKDWTS (ORCPT + 99 others); Mon, 4 Nov 2019 17:19:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:59224 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388981AbfKDWBM (ORCPT ); Mon, 4 Nov 2019 17:01:12 -0500 Received: from localhost (6.204-14-84.ripe.coltfrance.com [84.14.204.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0517520650; Mon, 4 Nov 2019 22:01:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572904871; bh=9bqpOQ/HTpFfl9Zq2N2vZhaiabTgyqLrkdRiLClf/oc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WiU2jPtHFryGb3TFTpWck2z+wG9SxUM4faQ7AG30G3p52emMeIVaUI8iRnN2SpCXw MV47sep0PUggRgXfcq2Qe3maAD4y6y9o+/HwbuDJy5kBDR0EFy61dKpwH7HrjhYUib LT4SGDApReGTr4DF0YLj6WboeSKIpsEjc23LYfL0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Bogendoerfer , Paul Burton , Ralf Baechle , James Hogan , linux-mips@vger.kernel.org, Sasha Levin Subject: [PATCH 4.19 083/149] MIPS: include: Mark __cmpxchg as __always_inline Date: Mon, 4 Nov 2019 22:44:36 +0100 Message-Id: <20191104212142.397201328@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212126.090054740@linuxfoundation.org> References: <20191104212126.090054740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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