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 6AC0533FE18 for ; Sun, 11 Jan 2026 12:03:47 +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=1768133028; cv=none; b=lmLs8PAJPMAyqFGpHG8Eeye1hovyczT+/HwtcDR8/2kk/FqYlcwtDJHnKUjeEeaLSS91jzSxsEXL3YvFjxW2iWjo7nmbFuGE59uJIcdNVZ1E1tnD79++dgRWsOZ8zBGNg5XWVUtFCvqinbM5JXLWS51mgCIrqonw6F+Mls0r9Dw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768133028; c=relaxed/simple; bh=KWloXRtQLNvHaenk+9nT+QJ1E+y9N6vtSljpdpys/qw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aztQObMU85o6Yj8Fkc82iWzTKwssHy5k5FHYutYHnRzCfYp3379naKWW1bjZzQifq09qTpYNYzfgCEd4ZJw3XzpFtvJ95xcaCxhWG2RjemIGP0t8GJyXmrmZimk4skR5bAABcXns3vE57+MhSY2bkDb44d4IGZ6HXQPgFQRSpNI= 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=JmS19TFK; 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="JmS19TFK" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-8c0d16bb24dso528364785a.0 for ; Sun, 11 Jan 2026 04:03:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768133026; x=1768737826; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=iqF221O8Qg25DHPunym8pmY9vcvzvVtocNw0jeFKViE=; b=JmS19TFKVFhLqpvdf3AjaQbiSe4C30eZ1PhZMfwqIcmWNLwy9ifwhMQY/oA4yBWcuz XK36h9qzjQH93RuoBJcOJwOn68r0E5EyYfqRWHov/bGRShqy1TizxBXZ4E2ztgIpFUxp uSK2v7yY5U2ZWVQLWcX5rTI0lplIJj+7UaVpJWgNk4xLAlmtqqxllCNFtuPl2d+jjhOW Da0XqVkZWxmbDo8IEQm/n8epq4Yv9tiKfWs9a1Z5AXgiHPL+aefM0mrU1e1IHpzAW5LM mMH8xJCmlCj32RxLvraQpbN26ZKy+srzNOiKrpPFQpHqoe1lQbpt3xNu3d0C7OHGYDa3 FtWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768133026; x=1768737826; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iqF221O8Qg25DHPunym8pmY9vcvzvVtocNw0jeFKViE=; b=EXYYIxTUKIsXIa0wTwKIeOJq3TFkq9rLt7tH2ysGqMY5vDWpZ+qD1IG2St72cVAoAi VAMxV6wemT1nRMT69lsEy3Jrfy2qozdBibGG8CAc6zpxasLqr92IPuGHdyhpRlcgrxNe VfLXpL0yOQ4a1+erSw+6lqhTq4LXZPB7jf7GWLYrrb8VO1vQLSwb0yn3MtOrzO5Mv418 l9f5uLrzMwhM10sHmH3ZR9paJQUxHTv0J8t27MHJNd3PlGy6rIrFsjEvj3hVt7ybxERL /jjXR9VM1/J3LHgycpHVa/PqU66HkgZ7GxwkawzjkNKhq2WCQBdiJHVIJ5kJGvNFZfQN XEpQ== X-Forwarded-Encrypted: i=1; AJvYcCUzqvOA7To19/B2+8q+BzwHpo0B2sQdhPfaQIRRW0/ZU+BhxtzBWzsCaWf4dnWzXOQXNDdHv5pKBURizCY=@vger.kernel.org X-Gm-Message-State: AOJu0YwYx65yMWmo9obb0ixLwFElxieqshADgP8JXMeE6vjjvQaKSrdE MpBsJRPcemRafNZBOgMbuFtI97d46jcZ7QSFSsTlomKbIMGJ7g77CZ8G X-Gm-Gg: AY/fxX5AdK7i5Oo9x9pnVj79SHZkNh04rz00Vnkizj0EDJRkY30i8wNZxGoU8muyLij eKQD+pmNjmrpy++bcme2zlyIjnuw7rVFqOKFssrWv8PHO7BdlRiC24lpraiU+cl1ib1zK26jBun /2BUxedyqNNVrm6GVRz9UlNe+EeYYn7ixznTWGpgUb7wqPXUVVT+HXF/Q+eBODY0cWD9aKcG2xP vE11v4t7+24VM5o0ABs4umXxLcSAX7QpdpO+DoyOckleXlgFR1dmpulj7K83c7wdYGFYNmNH1Y+ Y2IY1hK6n8au6D2wJ+x81myReGsJ6qkrF7GRbLljD7HDJ5269BseRgssHAibeoEFFWtFT4a16Uh XoOCt3TyDpbzbMbE2QQNfblOOzCDnNZmW1cLL0rwn1We80Kl9aNJAVn+fsZYAjzIx10hj838m9e xSv0AhQSFYo0wSCa3z3X4IjkKgyR26WYcC1HsB20O12lPulX42YJSwD6IaT2/5XyDFhBu42UIQM ftLFohBls6Ma4M= X-Google-Smtp-Source: AGHT+IFQxRpZkiMkdcRpuw877nXY8RoCkBiLg4ILp9QKyU6WiSaHoY+2ljgWv6qBuukW27cNUP20LQ== X-Received: by 2002:a05:620a:2681:b0:89e:b8af:f72d with SMTP id af79cd13be357-8c3893dc9femr1923855785a.57.1768133026220; Sun, 11 Jan 2026 04:03:46 -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 af79cd13be357-8c37f4b9c9esm1263902685a.18.2026.01.11.04.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Jan 2026 04:03:45 -0800 (PST) Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfauth.phl.internal (Postfix) with ESMTP id 46E8FF40068; Sun, 11 Jan 2026 07:03:45 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Sun, 11 Jan 2026 07:03:45 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduudeghedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpefggfeuvdehiefftdefiedtvdejgeekkeejvefgjeeikeefteefjeekudeiveev hfenucffohhmrghinhepkhgvrhhnvghlrdhorhhgpdhmshhgihgurdhlihhnkhenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsohhquhhnodhm vghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedqudejjeekhe ehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmhgvrdhnrghm vgdpnhgspghrtghpthhtohepudegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhope hpvghtvghriiesihhnfhhrrgguvggrugdrohhrghdprhgtphhtthhopehmihhnghhosehk vghrnhgvlhdrohhrghdprhgtphhtthhopehruhhsthdqfhhorhdqlhhinhhugiesvhhgvg hrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhg vghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopeifihhllheskhgvrhhnvghlrdhorh hgpdhrtghpthhtohepmhgrrhhkrdhruhhtlhgrnhgusegrrhhmrdgtohhmpdhrtghpthht ohepthhglhigsehlihhnuhhtrhhonhhigidruggvpdhrtghpthhtohepohhjvggurgeskh gvrhhnvghlrdhorhhgpdhrtghpthhtohepghgrrhihsehgrghrhihguhhordhnvght X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 11 Jan 2026 07:03:44 -0500 (EST) From: Boqun Feng To: "Peter Zijlstra" , "Ingo Molnar" Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, "Will Deacon" , "Mark Rutland" , "Thomas Gleixner" , "Miguel Ojeda" , "Gary Guo" , "Alice Ryhl" , "Andreas Hindborg" , "Benno Lossin" , "Danilo Krummrich" , Boqun Feng Subject: [PATCH 35/36] rust: helpers: Move #define __rust_helper out of atomic.c Date: Sun, 11 Jan 2026 20:02:08 +0800 Message-ID: <20260111120209.6133-33-boqun.feng@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260111120209.6133-1-boqun.feng@gmail.com> References: <20260111115808.5702-1-boqun.feng@gmail.com> <20260111120209.6133-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Alice Ryhl 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. [boqun: Reword the commit message and apply file hash changes] Link: https://lore.kernel.org/r/20260105-define-rust-helper-v2-0-51da5f454a67@google.com [1] Signed-off-by: Alice Ryhl Signed-off-by: Boqun Feng Link: https://patch.msgid.link/20260107-move-rust_helper-define-v1-1-4109d58ef275@google.com --- rust/helpers/atomic.c | 7 +------ rust/helpers/helpers.c | 2 ++ scripts/atomic/gen-rust-atomic-helpers.sh | 5 ----- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/rust/helpers/atomic.c b/rust/helpers/atomic.c index cf06b7ef9a1c..4b24eceef5fc 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) { @@ -1037,4 +1032,4 @@ rust_helper_atomic64_dec_if_positive(atomic64_t *v) } #endif /* _RUST_ATOMIC_API_H */ -// 615a0e0c98b5973a47fe4fa65e92935051ca00ed +// e4edb6174dd42a265284958f00a7cea7ddb464b1 diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 15d75578f459..a3c42e51f00a 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -7,6 +7,8 @@ * Sorted alphabetically. */ +#define __rust_helper + #include "atomic.c" #include "atomic_ext.c" #include "auxiliary.c" diff --git a/scripts/atomic/gen-rust-atomic-helpers.sh b/scripts/atomic/gen-rust-atomic-helpers.sh index 45b1e100ed7c..a3732153af29 100755 --- a/scripts/atomic/gen-rust-atomic-helpers.sh +++ b/scripts/atomic/gen-rust-atomic-helpers.sh @@ -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 -- 2.51.0