From patchwork Mon Nov 4 21:44:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 11226591 X-Patchwork-Delegate: paulburton@kernel.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49E28139A for ; Mon, 4 Nov 2019 22:07:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 27E9A2084D for ; Mon, 4 Nov 2019 22:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572905239; bh=K0t/5gdRAUZIWMHMVHKYMsEkOxWj+ixEwMT6gmbfnko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BTTpqV93KXgODteUzXUjuR0K7pIieH77AfM5OAYXRpPgKdcoACfAuAg0WyJXJy1R6 icVp4SF67wfeW/RvaIlYNYdrGBmxfjCttglpAQZVN8mzT6GpugWOoGNlqDwtbJhv7W SBRl6+exiuUjjg4iFZzl0nJmDp8jg5Rs94h+K7GU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389203AbfKDWHR (ORCPT ); Mon, 4 Nov 2019 17:07:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:39598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390095AbfKDWHM (ORCPT ); Mon, 4 Nov 2019 17:07: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 69307217F5; Mon, 4 Nov 2019 22:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572905232; bh=K0t/5gdRAUZIWMHMVHKYMsEkOxWj+ixEwMT6gmbfnko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jJvieSJoMHJaAHC8Wq58coPp9OCN+HLHyOGf9hVdUG8oC3uQYgwzJ7TtZr4GUrPcA T5fQhkW7i8f2s4SKJHHEdcFup2VM1irn8lk4xnU9HnYbc4e1NdqqshpPOHe/fj3LSC gi68wH+FHbZA/xBKLHtYqymbMaWX5e2cr5S1Pxn8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Bogendoerfer , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Paul Burton , Ralf Baechle , James Hogan , linux-mips@vger.kernel.org, Sasha Levin Subject: [PATCH 5.3 074/163] MIPS: include: Mark __xchg as __always_inline Date: Mon, 4 Nov 2019 22:44:24 +0100 Message-Id: <20191104212145.432944823@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212140.046021995@linuxfoundation.org> References: <20191104212140.046021995@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org From: Thomas Bogendoerfer [ Upstream commit 46f1619500d022501a4f0389f9f4c349ab46bb86 ] Commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly") allows compiler to uninline functions marked as 'inline'. In cace of __xchg this would cause to reference function __xchg_called_with_bad_pointer, which is an error case for catching bugs and will not happen for correct code, if __xchg is inlined. Signed-off-by: Thomas Bogendoerfer Reviewed-by: Philippe Mathieu-Daudé 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h index 319522fa3a45e..2b61052e10c94 100644 --- a/arch/mips/include/asm/cmpxchg.h +++ b/arch/mips/include/asm/cmpxchg.h @@ -77,8 +77,8 @@ extern unsigned long __xchg_called_with_bad_pointer(void) extern unsigned long __xchg_small(volatile void *ptr, unsigned long val, unsigned int size); -static inline unsigned long __xchg(volatile void *ptr, unsigned long x, - int size) +static __always_inline +unsigned long __xchg(volatile void *ptr, unsigned long x, int size) { switch (size) { case 1: