From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (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 EFD22344034 for ; Sun, 11 Jan 2026 12:03:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768133015; cv=none; b=FUpUITm+JH4qga9fl4ujHV5Du6hyGVFVnEFnwRvGMW9PI5WGIQbssJ+gnfCyCpiMh/A6sTI8cqtcMEW/o3PgDCPM9d7W9OeA31k2NrZiDCP+lZFQm+aCX539zLTwQZYI/5QY1eqmih4g1lwHiDm60uzLudUJsXL2pFYSjPnt2FQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768133015; c=relaxed/simple; bh=gCbR3GFtX7U/M5ncjDF9ACLc9ETQz4PEL09PH8zUK2U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eQ02ClWdWoRlkr7OTsVWOo+tJgOUceZdUmWapUY1+JAB7bL+BD9Fou1mZHblspnVWzktwMPD5TrqjLttUZBm7WOPgluDLvCs4qI6X0OqiGDl1i/SQV3G+o1938JydJCIs3D1VI9IAjQAmXV/bEVI4701UUmMHE0pKU2WpgkIKNg= 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=NUbfw5Ib; arc=none smtp.client-ip=209.85.160.177 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="NUbfw5Ib" Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-4ed9c19248bso53230671cf.1 for ; Sun, 11 Jan 2026 04:03:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768133013; x=1768737813; 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=g99DEBLQaLBX/pyNsC2hBNpYdw8rRcB79zbmvUgRaxI=; b=NUbfw5Ib1zglKMCSPYNw4c5+KSvFN5+HGXNJ1KBQ4PcJNmLF9Vi8BPYylhhsezLBLs yeMUJSokfZwa1MM6jUGeyTZA9RrADyKM6BCAkGf7Y34AzaTdRJLG2MLCyOWdCbu/jeji OPEFwkk4lavfLuPZ20vpZpSrj5XqIu4WZJO4QLLvAFiLn1Zp+AOvReD8se2jFvHRWIln OMzQIMKuhdJSNX/0+h7cGJvrDXGW+kd/JNucvkLQZkQS+3qkv/7I9PeiUs16A1gCwQoi FcR5Bqzx7uYXz/W2Qe5Wd/WPkh1jJr+PnUtQ0gKVEFw53WzLz0Bq5pkw8FI1QjaCl5hE relA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768133013; x=1768737813; 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=g99DEBLQaLBX/pyNsC2hBNpYdw8rRcB79zbmvUgRaxI=; b=F+02c4ISw7h1i9pEKX+gtkh5EKL53ufye9cWb1+EWKFf4hNP0sYS2hmCzTcim8t3y6 bab1PhCG19a6wYGEzxbYOKsPQGcbeT3++XgKTXza9tG3ZSwMDwOvYAeUP+YiknfK71hs I7aTRIike8xxc6IWeqBcZIsd77kYA34I3Mt+gWJD66dSUk+xjsQ+fxssFZBqBfAKYLn3 mTN+apMSsKTRKwPr4NouJmpc2z3MnG9XDAx1MK4ItoODVnUKhzDyaLwpRXp9nfoo8Ytk mSHgY8PGLt/ArORpmU59sFSQbnjYzT/irM7freSaobf2RE3vHqHCX6Xjk3/46aGLs29F w/bQ== X-Forwarded-Encrypted: i=1; AJvYcCXhW1Q5hQjvuKWp0qhZlT/WJHS08GHsNpi0us/JgD8vyAyNJ8rWUdnHJuaan/tt6XbQ6IRHT7K24B7xPl4=@vger.kernel.org X-Gm-Message-State: AOJu0Yy1AtFBjwIr0230/ioBGGft+vnFwQwO5U0z3DOk+WcrRFLq/AG4 nxIMjFGX0XybNhSLX/l8q2fXuNXPQIsL4g1xFdLDW+IqV2mLx/Qld5yS X-Gm-Gg: AY/fxX4k6JSFXwrEUWPbPNNcw6xXPI+tAZM1AALwe+MDYFS1rbHMSHDumdSMNtIlWRL a3gghCCH7ocsftZNXgXGkeToZyRpniYonalAQ2DQ9tdosaspiuhrXDeLyIaG+gRyZ4eOiJLCkuS YS44D5eZsI24X4YAPRtqz4RYiiqVvcg5qjjIBNQ6AYplUn4VGKM/nU7yfaJZYq/SDsC6vAffv9c s4VKkrhZqNB89EsCJUTT9VO/hYDuauneHWP0HVcxVCte2iAWctYAYTndu9NDVHGEtus1RfnP8GE ttBO3yiJNH/FCrUGMMvYfq62rgpRCZgsJuZaUZpMcBNL2+WktaSaEkZZjI9D/BbrQAO45fbksbh R5vtlRZziIG8e1xk9pZoD2qhfM2NakmndVkf9Y6QZlhOmdkQOGD6P4mT9H6DuUA72boumADHOIs xUPo2mBPfLXQYFCx7DMUA3LL+1Gouw0b26YnM09nSZl8jZxtIOIP9fEdRCHgYuCusbQgLyCqd22 DcVN36nezF6LA7Lm26w9pTnXQ== X-Google-Smtp-Source: AGHT+IENmmCoSHNLUi9LhJHOEfhYsdVuZs7pKTYg3a610T5MZ0xFd0ga/mDpUfrsri7jyu6u7QfYGw== X-Received: by 2002:ac8:584c:0:b0:4ff:b18a:104b with SMTP id d75a77b69052e-4ffb4958e3cmr206452491cf.23.1768133012890; Sun, 11 Jan 2026 04:03:32 -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-4ffb813ffb8sm84359251cf.20.2026.01.11.04.03.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Jan 2026 04:03:32 -0800 (PST) Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfauth.phl.internal (Postfix) with ESMTP id EE1B4F40068; Sun, 11 Jan 2026 07:03:31 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Sun, 11 Jan 2026 07:03:31 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduudeghedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpedvveekvddtffelffelfedvudefffeuheejgeeivedufffgledvgeduveffueeh leenucffohhmrghinhepmhhsghhiugdrlhhinhhknecuvehluhhsthgvrhfuihiivgepfe enucfrrghrrghmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgv rhhsohhnrghlihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfh gvnhhgpeepghhmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthho pedugedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepphgvthgvrhiisehinhhfrh gruggvrggurdhorhhgpdhrtghpthhtohepmhhinhhgoheskhgvrhhnvghlrdhorhhgpdhr tghpthhtoheprhhushhtqdhfohhrqdhlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorh hgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdho rhhgpdhrtghpthhtohepfihilhhlsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehmrg hrkhdrrhhuthhlrghnugesrghrmhdrtghomhdprhgtphhtthhopehtghhlgieslhhinhhu thhrohhnihigrdguvgdprhgtphhtthhopehojhgvuggrsehkvghrnhgvlhdrohhrghdprh gtphhtthhopehgrghrhiesghgrrhihghhuohdrnhgvth X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 11 Jan 2026 07:03:31 -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 30/36] rust: refcount: Add __rust_helper to helpers Date: Sun, 11 Jan 2026 20:02:03 +0800 Message-ID: <20260111120209.6133-28-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 This is needed to inline these helpers into Rust code. Reviewed-by: Boqun Feng Reviewed-by: Gary Guo Signed-off-by: Alice Ryhl Signed-off-by: Boqun Feng Link: https://patch.msgid.link/20260105-define-rust-helper-v2-17-51da5f454a67@google.com --- rust/helpers/refcount.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rust/helpers/refcount.c b/rust/helpers/refcount.c index d175898ad7b8..36334a674ee4 100644 --- a/rust/helpers/refcount.c +++ b/rust/helpers/refcount.c @@ -2,27 +2,27 @@ #include -refcount_t rust_helper_REFCOUNT_INIT(int n) +__rust_helper refcount_t rust_helper_REFCOUNT_INIT(int n) { return (refcount_t)REFCOUNT_INIT(n); } -void rust_helper_refcount_set(refcount_t *r, int n) +__rust_helper void rust_helper_refcount_set(refcount_t *r, int n) { refcount_set(r, n); } -void rust_helper_refcount_inc(refcount_t *r) +__rust_helper void rust_helper_refcount_inc(refcount_t *r) { refcount_inc(r); } -void rust_helper_refcount_dec(refcount_t *r) +__rust_helper void rust_helper_refcount_dec(refcount_t *r) { refcount_dec(r); } -bool rust_helper_refcount_dec_and_test(refcount_t *r) +__rust_helper bool rust_helper_refcount_dec_and_test(refcount_t *r) { return refcount_dec_and_test(r); } -- 2.51.0