From patchwork Sun Dec 17 07:12:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Mailhol X-Patchwork-Id: 179963 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp583961dyi; Sat, 16 Dec 2023 23:14:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWWx8AJYz44y6YxemuUSmncfWd//Th8YOU8paMM6M2DSL/OAt38HitSwM7f4hqsiNMNqxf X-Received: by 2002:a92:cda4:0:b0:35f:addc:b2cd with SMTP id g4-20020a92cda4000000b0035faddcb2cdmr311381ild.61.1702797259062; Sat, 16 Dec 2023 23:14:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702797259; cv=none; d=google.com; s=arc-20160816; b=Bk835o0qTHvqQHo9hZbiPLfwOb3BPlST9pfnXNae9w3KP8hckGZMBY8o8lqzqi1cTS IU23Q7iQNrTNLBL8iXnqV8L08Uv82gbSI7zf4I0MCsEWWYI6xaoUA3wHAFA6OdF1sfIE /F0OYxrktvi3+/khuUZoVGrSnwUJY1gt1B/njrRWY3jOT/Dd5+W7gaCEtMSnQJSNoHeF 07e/SKLqtCfGvCCLFqGm+HFX4mmoPN/fQkGc0gPpTRLqvti0JmDGQxyY8pL2S2ZTJWCb vlXZq3+ldX3a6bPX/w/iIYutVAmY9opev0BGN5ujW9K8HGFBwLXfbn0qmsUUuckqfU+b KPmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:sender:dkim-signature; bh=ZV393vzARRuX2pwqmw5hE6OeimRr0obKDvqio21m2gk=; fh=O+LHMXuc4QZ+LwJ18sh+OSxw9k9Vm9ydCfTOjonl8SY=; b=pHxzIyRldInH+u0R+xX2adhGdjpA6t8B2vrmwRRUXMAUHJndLLP0T3vsK5RNsY/Taf uIAveYB/dY+wrCfzH7M1zzh38OJcYwDkLAlKV5xTu5WCM+7SCqu+/P1NylcIeH25aML+ 1Kva8NCWLW1VooGWm7ddxuawLnIyyUcqhpECnAm/lUgM0zua5ecBl6pk0b7Z/EA9mIBg Lz7IZfjt7Nkx2MI+GfvpFD2uEhZdx1QGOyjbhKx7uiXPB78X7lfevryP4uN6IIrzI5ep Ii55jX/FP7rgi3+Jg0N7DQUizkTyU/RgP8tG3dmzjKlVYaEL77Qn0aPIKI9hd4PR0N1n Ip/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aroyU7BJ; spf=pass (google.com: domain of linux-kernel+bounces-2492-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2492-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k10-20020a170902694a00b001cfd622b80dsi15775357plt.541.2023.12.16.23.14.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 23:14:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2492-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aroyU7BJ; spf=pass (google.com: domain of linux-kernel+bounces-2492-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2492-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 128DB283DB2 for ; Sun, 17 Dec 2023 07:14:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A4EB6FDD; Sun, 17 Dec 2023 07:13:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aroyU7BJ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6695D63AA; Sun, 17 Dec 2023 07:13:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3b844357f7cso1696781b6e.1; Sat, 16 Dec 2023 23:13:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702797210; x=1703402010; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=ZV393vzARRuX2pwqmw5hE6OeimRr0obKDvqio21m2gk=; b=aroyU7BJ9ZlRKHGgR74IRmjfYNtOpZUSPvCmssf5fHitT+f9GRoOtub54UyCsuS/bh zR/kVGnGFK+29Pm7Jk9oJlBNvn3R2rCe4Y+gYt+w/c0U/tNHtDi7kkblkVATZN8kZPDb rGivcnP3RWvjOl66y3A4N5EBuVqNQQ9EJixBTm+WKh7BiJEdn++fVF7x18DR3Zsf3dD8 EMmGdBBE1ibhlFbcjdSPujg0cLEWGlkPEpsXlL/gZKZI3UoZ9NW4uA5T0M7jMPkchsQb OwaW6m4SCFODGAuuHfnSZjxIeoE8EZTu584Y4/Pg/mqwjlBlvwsh/StOXyRcPf76xQaJ n4eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702797210; x=1703402010; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ZV393vzARRuX2pwqmw5hE6OeimRr0obKDvqio21m2gk=; b=EeoBEIA9XdeZqJkn5K5nwyB0m64T9iYHnWpfE2jKZRBNViC4laeJdD/vzP4m77/EjT ImEimEqRCkAZ4GYxwZvOOUrb4gmDp+E0n63uVLce93lmyXEngrKT3n9G2oVEuPl3qT2n uuC1vaOuik8jOl3LqJDkx70IwxtM+gXfVqLv4pnNsTJaoMxpgoMjBf2LnzWNHji9r5Za UEND++N28AYZ4l+v4QzuxEG126ewRKxKjgIebTn4N8v6n6sNWRAWhTLxuyhmBRpReJUY xMVWmCB8zwpoXdvK44q3mBsGQsjqQHPbgCa4IdnuZdWCeCxW/rHV1Hduos/FxzYuQ5Mc LxNA== X-Gm-Message-State: AOJu0YzIqnZq2SVZY93zEXG0uhPVJ1UWLL0XawxhxWfljmG9ZZ0se4QF BgHz5ZHAf92VBTTkA7U8Cmg= X-Received: by 2002:a05:6808:2125:b0:3b8:b063:6b96 with SMTP id r37-20020a056808212500b003b8b0636b96mr19083767oiw.69.1702797210271; Sat, 16 Dec 2023 23:13:30 -0800 (PST) Received: from XH22050090-L.ad.ts.tri-ad.global ([103.175.111.222]) by smtp.gmail.com with ESMTPSA id b17-20020a056a000cd100b0068ffb8da107sm15740231pfv.212.2023.12.16.23.13.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 23:13:29 -0800 (PST) Sender: Vincent Mailhol From: Vincent Mailhol To: Andrew Morton , linux-kernel@vger.kernel.org, Yury Norov Cc: Nick Desaulniers , Douglas Anderson , Kees Cook , Petr Mladek , Randy Dunlap , Zhaoyang Huang , Geert Uytterhoeven , Marco Elver , Brian Cain , Geert Uytterhoeven , Matthew Wilcox , "Paul E . McKenney" , linux-hexagon@vger.kernel.org, linux-m68k@lists.linux-m68k.org, Vincent Mailhol Subject: [PATCH v3 3/5] hexagon/bitops: force inlining of all bitops functions Date: Sun, 17 Dec 2023 16:12:48 +0900 Message-Id: <20231217071250.892867-4-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231217071250.892867-1-mailhol.vincent@wanadoo.fr> References: <20221111081316.30373-1-mailhol.vincent@wanadoo.fr> <20231217071250.892867-1-mailhol.vincent@wanadoo.fr> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785512338547009267 X-GMAIL-MSGID: 1785512338547009267 The inline keyword actually does not guarantee that the compiler will inline a functions. Whenever the goal is to actually inline a function, __always_inline should always be preferred instead. Reference: commit 8dd5032d9c54 ("x86/asm/bitops: Force inlining of test_and_set_bit and friends") Link: https://git.kernel.org/torvalds/c/8dd5032d9c54 Signed-off-by: Vincent Mailhol --- arch/hexagon/include/asm/bitops.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/hexagon/include/asm/bitops.h b/arch/hexagon/include/asm/bitops.h index 160d8f37fa1a..950d4acc2edc 100644 --- a/arch/hexagon/include/asm/bitops.h +++ b/arch/hexagon/include/asm/bitops.h @@ -28,7 +28,7 @@ * @nr: bit number to clear * @addr: pointer to memory */ -static inline int test_and_clear_bit(int nr, volatile void *addr) +static __always_inline int test_and_clear_bit(int nr, volatile void *addr) { int oldval; @@ -52,7 +52,7 @@ static inline int test_and_clear_bit(int nr, volatile void *addr) * @nr: bit number to set * @addr: pointer to memory */ -static inline int test_and_set_bit(int nr, volatile void *addr) +static __always_inline int test_and_set_bit(int nr, volatile void *addr) { int oldval; @@ -78,7 +78,7 @@ static inline int test_and_set_bit(int nr, volatile void *addr) * @nr: bit number to set * @addr: pointer to memory */ -static inline int test_and_change_bit(int nr, volatile void *addr) +static __always_inline int test_and_change_bit(int nr, volatile void *addr) { int oldval; @@ -103,17 +103,17 @@ static inline int test_and_change_bit(int nr, volatile void *addr) * Rewrite later to save a cycle or two. */ -static inline void clear_bit(int nr, volatile void *addr) +static __always_inline void clear_bit(int nr, volatile void *addr) { test_and_clear_bit(nr, addr); } -static inline void set_bit(int nr, volatile void *addr) +static __always_inline void set_bit(int nr, volatile void *addr) { test_and_set_bit(nr, addr); } -static inline void change_bit(int nr, volatile void *addr) +static __always_inline void change_bit(int nr, volatile void *addr) { test_and_change_bit(nr, addr); } @@ -200,7 +200,7 @@ arch_test_bit_acquire(unsigned long nr, const volatile unsigned long *addr) * * Undefined if no zero exists, so code should check against ~0UL first. */ -static inline long ffz(int x) +static __always_inline long ffz(int x) { int r; @@ -217,7 +217,7 @@ static inline long ffz(int x) * This is defined the same way as ffs. * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. */ -static inline int fls(unsigned int x) +static __always_inline int fls(unsigned int x) { int r; @@ -238,7 +238,7 @@ static inline int fls(unsigned int x) * the libc and compiler builtin ffs routines, therefore * differs in spirit from the above ffz (man ffs). */ -static inline int ffs(int x) +static __always_inline int ffs(int x) { int r; @@ -260,7 +260,7 @@ static inline int ffs(int x) * bits_per_long assumed to be 32 * numbering starts at 0 I think (instead of 1 like ffs) */ -static inline unsigned long __ffs(unsigned long word) +static __always_inline unsigned long __ffs(unsigned long word) { int num; @@ -278,7 +278,7 @@ static inline unsigned long __ffs(unsigned long word) * Undefined if no set bit exists, so code should check against 0 first. * bits_per_long assumed to be 32 */ -static inline unsigned long __fls(unsigned long word) +static __always_inline unsigned long __fls(unsigned long word) { int num;