From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (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 E1E09271464 for ; Wed, 7 Jan 2026 16:14:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767802464; cv=none; b=r7WGwTs2+HnE0gyp/Io+LWacDmi7EgO6zpHWEuyLDVI+srl7WJCsww4BX5HggCeLR6Wd1CPt11tNchG9X5VM3kw2IDWAaVFivhehzzksg1VRNPfPO9a46W9jUkmafajIldHBQfpoGWZaqM6TTuUMa7FQfA0+b31mfbuEEKdZgHU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767802464; c=relaxed/simple; bh=LdWHcolCrHxpHVadV8iCe5wJ6t01NEAX/ncvOB+5z9k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iCWp1OuV7sASC0kf5e5eroryzr8B4HTQhk3IpnSADSD2Cj/7lLfeuS1ol7FXFKvEhyVYl6RNI5kMgqTsl5vJgcker66fmijpv1qCiv9+HbnuzJqlefmZ9C4A6RH1hNXgQ2XM9zKL7p7eIJV1OSRCW9FZMeHviJrzt+41ACm5dhM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EZ5z0lzS; arc=none smtp.client-ip=209.85.222.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EZ5z0lzS" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-8b2148ca40eso306133285a.1 for ; Wed, 07 Jan 2026 08:14:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767802444; x=1768407244; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=qZr81RrhDU/EmN47aRYnauj1Iguo4qhRxtPs1Zlz7rQ=; b=EZ5z0lzSsJ4b5ziVqHucn/bD88vzKVMJQOPFT4zJihzU2gi7VTzPX3FjmLt+CZ44le Y+qYRpUK2uJSUlTpRKY3pJK64Ipzh7hw9FVjreMOuSJ685tQ6tSsX10zpoCkAzmKwMX6 Nz84SJ0lNgboOS0QJrskGz8QM7sd1C3d5G5Yb4lz/gaZNYcIxtD5W2XsiEAlJry6VNMW 4oqQIOTudrQw9XRaU5zpSX9GWrkAa0DtbmUOZKsSKWq65ozfjECta/rr56r6iIiQug2A 0dLdOVXjCsbfs74yG7/M/o0aSjdeYwMMSQYcxmSb8LL1S1ni9WVkyDjSy+TBRZltO/SD 5v6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767802444; x=1768407244; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qZr81RrhDU/EmN47aRYnauj1Iguo4qhRxtPs1Zlz7rQ=; b=WIf07CzhXV7sNLcQdnyvmeygoP/RnfJ2GllVJgNZoz22LMEDswIjktOTcWf851zEkh EUEc8cgPmhqwiIZPs2+UznVZIQUDPnCF3Zf+YneJ005tkY0QsTKmjgt8RUc+mobM2ecE BkY51cQWmdJbBWX6DrQ5Hxyo2jo+h9fyRJQpU25DP3z+qaualhksuOQIOZQDmo3NwF2y WMWTX/6d/A/WenRo1pTVewyWLDuGask5Aac6aBZW5bIBJcJgWWFvL0nxV7zTQvzJsUD/ /fFmJRIOk8Zjyf0n+Mj7RCzpqg1DnFUHcA3RLHBOWFJgHidqSNWx7rsHWkTQWLenMxXh vRcg== X-Forwarded-Encrypted: i=1; AJvYcCXyew0I5WI6GGGVe6vXjxTBpzb5/+E6qTKP+sMawhkNqVv4CNmNyq+4ouCDeEXF2uouN2zPyFA3W75dXq4=@vger.kernel.org X-Gm-Message-State: AOJu0YzQSgKEEsl+4VoVD24wmfm4ZRYRdqDDW5MEMOYGtK8o+J1zG16v QaAmlGiriHURWORUuACOtjuUZMuRkysvEbCqcGoeu6d9TiwPvmUJl2TaObH0HIMc X-Gm-Gg: AY/fxX50ueLNzOGV8E3vaTru6BDl1KHG9omB7gur0SGRqG3Mx9f65wqJxoOXHFXWXBt 9Bcu9dpstYYkkMBACrzxxHUZEZT5dvNTWR7KuZ2CCU3BsHbAlx9fXX1/MTAy3StuEABoRO/UHnx Vs5UnQt9Iv5V6dVoX3eYLAbynefSy2BZobTrqNT3Crro/OQcetwMIHIQ1EQ1/DX1HieA1xg120e 9tOP8KtZTpzmgLx9/itQr8GQh2U//L0nqDm6Qrjw50gTOaObvlpGQHIOaSCdlnGTLoHJY2iP8j+ EGsBevIlewG1z+m9vPdAg5y0DqfVg7eLqC+tZLVy0Zfc4/SlawqlmD+vnr++dWP8iXE/3XkL+W2 JFvH/LgAu0tmzSjfzyvE85oov6GbOkYsDMntyBvaa9Stu5jxKmH4vaKBA6RckgTAjf5iwPm6rvp X/qhE1U559UOOorA2KNsrP3HwHEUF1xzikJZANHyPBnraILSeBu6StrqT8JiUMy3vBUIJ6Qye+Z YNkidBVAZygwms= X-Google-Smtp-Source: AGHT+IE4reJRN3+W2D6hKzt1hGCqifi4pTDYQZH2Y2C9sX1Cq7RkI2HE70OwnNRsWLelNxZART6OuA== X-Received: by 2002:ad4:4eaa:0:b0:88f:e9f0:77b9 with SMTP id 6a1803df08f44-890842b2851mr34841636d6.58.1767796678362; Wed, 07 Jan 2026 06:37:58 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4ffa8e61a33sm29950971cf.29.2026.01.07.06.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jan 2026 06:37:57 -0800 (PST) Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfauth.phl.internal (Postfix) with ESMTP id 8FBD3F40068; Wed, 7 Jan 2026 09:37:57 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Wed, 07 Jan 2026 09:37:57 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddutdeffeefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpefhtedvgfdtueekvdekieetieetjeeihedvteehuddujedvkedtkeefgedvvdeh tdenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgv rhhsohhnrghlihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfh gvnhhgpeepghhmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthho pedugedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghlihgtvghrhihhlhesgh hoohhglhgvrdgtohhmpdhrtghpthhtohepohhjvggurgeskhgvrhhnvghlrdhorhhgpdhr tghpthhtohepghgrrhihsehgrghrhihguhhordhnvghtpdhrtghpthhtohepsghjohhrnh efpghghhesphhrohhtohhnmhgrihhlrdgtohhmpdhrtghpthhtoheplhhoshhsihhnsehk vghrnhgvlhdrohhrghdprhgtphhtthhopegrrdhhihhnuggsohhrgheskhgvrhhnvghlrd horhhgpdhrtghpthhtohepthhmghhrohhsshesuhhmihgthhdrvgguuhdprhgtphhtthho pegurghkrheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepfihilhhlsehkvghrnhgvlh drohhrgh X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Jan 2026 09:37:56 -0500 (EST) Date: Wed, 7 Jan 2026 22:37:52 +0800 From: Boqun Feng To: Alice Ryhl Cc: Miguel Ojeda , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Will Deacon , Peter Zijlstra , Mark Rutland , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rust: move #define __rust_helper out of atomic.c Message-ID: References: <20260107-move-rust_helper-define-v1-1-4109d58ef275@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260107-move-rust_helper-define-v1-1-4109d58ef275@google.com> On Wed, Jan 07, 2026 at 02:14:13PM +0000, Alice Ryhl wrote: > We were lucky that atomic.c is the first file in helpers.c so that we > may use the define from it in the follow-up headers [1], but this is > fragile. Thus, move it to helpers.c. > I reword a bit to make it clear that we need this changes for inline helpers: In order to support inline helpers [1], we need to have __rust_helper defined for all helper files. Current we are lucky that atomic.c is the first file in helpers.c, but this is fragile. Thus, move it to helpers.c. Let me know if you have futher suggestion. > Link: https://lore.kernel.org/r/20260105-define-rust-helper-v2-0-51da5f454a67@google.com [1] > Signed-off-by: Alice Ryhl > --- > When I send the next version of [PATCH 0/4] Inline helpers into Rust > without full LTO, it will be based on top of this patch. Regardless of > the timelines for the other series, I think it would be good to merge > this patch soon. > --- > rust/helpers/atomic.c | 5 ----- > rust/helpers/helpers.c | 2 ++ > scripts/atomic/gen-rust-atomic-helpers.sh | 5 ----- > 3 files changed, 2 insertions(+), 10 deletions(-) > > diff --git a/rust/helpers/atomic.c b/rust/helpers/atomic.c > index cf06b7ef9a1c559e8d7bdfc2bcd2aeb8951c29d1..a48605628ed73ac32aae2e6280481407a670e88f 100644 > --- a/rust/helpers/atomic.c > +++ b/rust/helpers/atomic.c > @@ -11,11 +11,6 @@ > > #include > > -// TODO: Remove this after INLINE_HELPERS support is added. > -#ifndef __rust_helper > -#define __rust_helper > -#endif > - > __rust_helper int > rust_helper_atomic_read(const atomic_t *v) > { > diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c > index 79c72762ad9c4b473971e6210c9577860d2e2b08..a86fab743d1dc951373e5ff05278c6c7872ef491 100644 > --- a/rust/helpers/helpers.c > +++ b/rust/helpers/helpers.c > @@ -7,6 +7,8 @@ > * Sorted alphabetically. > */ > > +#define __rust_helper > + > #include "atomic.c" > #include "auxiliary.c" > #include "barrier.c" > diff --git a/scripts/atomic/gen-rust-atomic-helpers.sh b/scripts/atomic/gen-rust-atomic-helpers.sh > index 45b1e100ed7c63108ee6cb07e48a17668f860d47..a3732153af29f415e397e17cab6e75cb5d7efafc 100755 > --- a/scripts/atomic/gen-rust-atomic-helpers.sh > +++ b/scripts/atomic/gen-rust-atomic-helpers.sh whenever we changed scripts/atomic/* we need to rerun scripts/atomic/gen-atomics.sh to calculate a new hash value of the generated files, so we are missing this: diff --git a/rust/helpers/atomic.c b/rust/helpers/atomic.c index a48605628ed7..4b24eceef5fc 100644 --- a/rust/helpers/atomic.c +++ b/rust/helpers/atomic.c @@ -1032,4 +1032,4 @@ rust_helper_atomic64_dec_if_positive(atomic64_t *v) } #endif /* _RUST_ATOMIC_API_H */ -// 615a0e0c98b5973a47fe4fa65e92935051ca00ed +// e4edb6174dd42a265284958f00a7cea7ddb464b1 I queued with this change for the rust-sync PR of 7.0, thanks! Regards, Boqun > @@ -47,11 +47,6 @@ cat << EOF > > #include > > -// TODO: Remove this after INLINE_HELPERS support is added. > -#ifndef __rust_helper > -#define __rust_helper > -#endif > - > EOF > > grep '^[a-z]' "$1" | while read name meta args; do > > --- > base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8 > change-id: 20260107-move-rust_helper-define-63edcfb2bff3 > > Best regards, > -- > Alice Ryhl >