From patchwork Tue Jan 7 03:50:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 13928172 X-Patchwork-Delegate: bhelgaas@google.com Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79DC61DED4C; Tue, 7 Jan 2025 03:51:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221892; cv=none; b=Hb2D7wFR4+9j5Dr+qWg0aAOv0KTCE9izvL81/V6tdWfg6TKDqw1hQtSZmW5KXWhiMQuLBdfB0rhJsJfuBggzwyCyLiCfagh35dGj9q/gpilm73rLqG/sNk83bewjbqQZ430W6T+kXuJmNmq2w0EAmVDeaP/zd9QLz0hca+hZ8sM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221892; c=relaxed/simple; bh=cN/kxtMdHtq+fuCfVP47ntdOdTLgiFTqooS5PF1Yfs4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=La8+EsVcDdtRS2TwQqDjJsMSAoOPieqoY8ykYr9fwD9kwp8cSU92OzWaBsXDpwdXhjsX9iGDwjGdu2wG/+ckQQ8gJtoFS1Ja2395c1hh9srKBOboveERhAgbX7OWgGQbWy4D0Q4P7omzflyh85vdsC+3T5CE0A9z+2/2LYQZ4VQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me; spf=pass smtp.mailfrom=alistair23.me; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b=oXRZTNoa; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=OnpkWnBt; arc=none smtp.client-ip=202.12.124.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alistair23.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b="oXRZTNoa"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="OnpkWnBt" Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id D84B92540178; Mon, 6 Jan 2025 22:51:25 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Mon, 06 Jan 2025 22:51:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm2; t=1736221885; x=1736308285; bh=jvRKxufKFl4JIrnzcaXwWMzthH8JJCX/ y5SmcUypVC4=; b=oXRZTNoayLPrJimF1RhT3KEqm3YDs4tBscBlFZTM4u8OkInj 9qRWFRZRzgnYGMB+cLv2hn508t8LSQ16aliquH8EHXVeiEVc59WOjfc/ZjA2QwSA iCAaujpvNhprRGFF9y2em1g5AvIZRv6O9rE0RgryxmkW+ohPdTJzNpbYWydXR0Km D4vk5azNBQF+iT5QSXZJUeD/k+YL6MnbTDnYm75l9Lz9h7Ps8lp8q5Io5XcZo3Aw h3GaAmNFuuJI/9zWM04tEOkUSwLyGI0aQYf26oOHhk7Wa1If24Ntfyr/6szhTy+Z DIT0dr4gqchhQMKR9bNGbkgnRoNrN4nP3PXV5Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1736221885; x= 1736308285; bh=jvRKxufKFl4JIrnzcaXwWMzthH8JJCX/y5SmcUypVC4=; b=O npkWnBtCizSUZLeRoTY9klXibUJsuKIQcUv8cfi/SygEOfiCwHvOrPJUkl0XcE8F DOLQIVgq7B5s0ZNBbPFnkaqd4ujgvcOJfCBtfOdjYz0LHCsvJ5zDwy484OsuWMkv c7J8oOozuM10cCSNTOHcpkA6ATyyi5Nw3Bxssmdi5OjJKbsyd+5QErsWFbupoi5O 8cgzuauJYPR7vKp8gODSnORhkE5b+HNRHZBFj/7bbc4Wp89iCeI9+HR+lIutYCXz 965HGhhOqbipabkPMWajojLuby/jB6VhoMtekS4E3Aw1ZfpqSC6kLr8zyVideB2m a1XcLtkZ53XvngosdQ0ow== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeguddgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdej necuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghirhesrg hlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhephfetjeejteeileehvdeh geetgeffueetgfetleelgeehjedvgfefvdeukedtgfdunecuffhomhgrihhnpehgihhthh husgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvgdpnhgspghrtghpthhtoh epvdefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegshhgvlhhgrggrshesghho ohhglhgvrdgtohhmpdhrtghpthhtoheprhhushhtqdhfohhrqdhlihhnuhigsehvghgvrh drkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhukhgrshesfihunhhnvghrrdguvgdp rhgtphhtthhopehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopegrkhhpmh eslhhinhhugidqfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtohepthhmghhrohhs shesuhhmihgthhdrvgguuhdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilh drtghomhdprhgtphhtthhopehojhgvuggrsehkvghrnhgvlhdrohhrghdprhgtphhtthho pehlihhnuhigqdgtgihlsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Jan 2025 22:51:14 -0500 (EST) From: Alistair Francis To: bhelgaas@google.com, rust-for-linux@vger.kernel.org, lukas@wunner.de, gary@garyguo.net, akpm@linux-foundation.org, tmgross@umich.edu, boqun.feng@gmail.com, ojeda@kernel.org, linux-cxl@vger.kernel.org, bjorn3_gh@protonmail.com, a.hindborg@kernel.org, me@kloenk.dev, linux-kernel@vger.kernel.org, aliceryhl@google.com, alistair.francis@wdc.com, linux-pci@vger.kernel.org, benno.lossin@proton.me, alex.gaynor@gmail.com, Jonathan.Cameron@huawei.com Cc: alistair23@gmail.com, wilfred.mallawa@wdc.com, Alistair Francis , Dirk Behme Subject: [PATCH v5 01/11] rust: bindings: Support some inline static functions Date: Tue, 7 Jan 2025 13:50:48 +1000 Message-ID: <20250107035058.818539-2-alistair@alistair23.me> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250107035058.818539-1-alistair@alistair23.me> References: <20250107035058.818539-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The kernel includes a large number of static inline functions that are defined in header files. One example is the crypto_shash_descsize() function which is defined in hash.h as static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm) { return tfm->descsize; } bindgen is currently unable to generate bindings to these functions as they are not publically exposed (they are static after all). The Rust code currently uses rust_helper_* functions, such as rust_helper_alloc_pages() for example to call the static inline functions. But this is a hassle as someone needs to write a C helper function. Instead we can use the bindgen wrap-static-fns feature. The feature is marked as experimental, but has recently been promoted to non-experimental (depending on your version of bindgen). By supporting wrap-static-fns we automatically generate a C file called extern.c that exposes the static inline functions, for example like this ``` unsigned int crypto_shash_descsize__extern(struct crypto_shash *tfm) { return crypto_shash_descsize(tfm); } ``` The nice part is that this is auto-generated. We then also get a bindings_generate_static.rs file with the Rust binding, like this ``` extern "C" { #[link_name = "crypto_shash_descsize__extern"] pub fn crypto_shash_descsize(tfm: *mut crypto_shash) -> core::ffi::c_uint; } ``` So now we can use the static inline functions just like normal functions. There are a bunch of static inline functions that don't work though, because the C compiler fails to build extern.c: * functions with inline asm generate "operand probably does not match constraints" errors (rip_rel_ptr() for example) * functions with bit masks (u32_encode_bits() and friends) result in "call to ‘__bad_mask’ declared with attribute error: bad bitfield mask" errors As well as that any static inline function that calls a function that has been kconfig-ed out will fail to link as the function being called isn't built (mdio45_ethtool_gset_npage for example) Due to these failures we use a allow-list system (where functions must be manually enabled). Link: https://github.com/rust-lang/rust-bindgen/discussions/2405 Signed-off-by: Alistair Francis Tested-by: Dirk Behme --- Documentation/rust/general-information.rst | 10 +++--- rust/.gitignore | 2 ++ rust/Makefile | 37 ++++++++++++++++++++-- rust/bindgen_static_functions | 6 ++++ rust/bindings/lib.rs | 4 +++ rust/exports.c | 1 + 6 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 rust/bindgen_static_functions diff --git a/Documentation/rust/general-information.rst b/Documentation/rust/general-information.rst index 6146b49b6a98..632a60703c96 100644 --- a/Documentation/rust/general-information.rst +++ b/Documentation/rust/general-information.rst @@ -119,10 +119,12 @@ By including a C header from ``include/`` into bindings for the included subsystem. After building, see the ``*_generated.rs`` output files in the ``rust/bindings/`` directory. -For parts of the C header that ``bindgen`` does not auto generate, e.g. C -``inline`` functions or non-trivial macros, it is acceptable to add a small -wrapper function to ``rust/helpers/`` to make it available for the Rust side as -well. +C ``inline`` functions will only be generated if the function name is +specified in ``rust/bindgen_static_functions``. + +For parts of the C header that ``bindgen`` does not auto generate, e.g. +non-trivial macros, it is acceptable to add a small wrapper function +to ``rust/helpers/`` to make it available for the Rust side as well. Abstractions ~~~~~~~~~~~~ diff --git a/rust/.gitignore b/rust/.gitignore index d3829ffab80b..741a18023801 100644 --- a/rust/.gitignore +++ b/rust/.gitignore @@ -1,10 +1,12 @@ # SPDX-License-Identifier: GPL-2.0 bindings_generated.rs +bindings_generated_static.rs bindings_helpers_generated.rs doctests_kernel_generated.rs doctests_kernel_generated_kunit.c uapi_generated.rs exports_*_generated.h +extern.c doc/ test/ diff --git a/rust/Makefile b/rust/Makefile index a40a3936126d..578fec15480f 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -10,14 +10,17 @@ always-$(CONFIG_RUST) += exports_core_generated.h # for Rust only, thus there is no header nor prototypes. obj-$(CONFIG_RUST) += helpers/helpers.o CFLAGS_REMOVE_helpers/helpers.o = -Wmissing-prototypes -Wmissing-declarations +CFLAGS_REMOVE_extern.o = -Wmissing-prototypes -Wmissing-declarations -Wdiscarded-qualifiers always-$(CONFIG_RUST) += libmacros.so no-clean-files += libmacros.so -always-$(CONFIG_RUST) += bindings/bindings_generated.rs bindings/bindings_helpers_generated.rs -obj-$(CONFIG_RUST) += bindings.o kernel.o +always-$(CONFIG_RUST) += bindings/bindings_generated.rs bindings/bindings_helpers_generated.rs \ + bindings/bindings_generated_static.rs +obj-$(CONFIG_RUST) += bindings.o kernel.o extern.o always-$(CONFIG_RUST) += exports_helpers_generated.h \ - exports_bindings_generated.h exports_kernel_generated.h + exports_bindings_generated.h exports_bindings_static_generated.h \ + exports_kernel_generated.h always-$(CONFIG_RUST) += uapi/uapi_generated.rs obj-$(CONFIG_RUST) += uapi.o @@ -301,6 +304,21 @@ quiet_cmd_bindgen = BINDGEN $@ -o $@ -- $(bindgen_c_flags_final) -DMODULE \ $(bindgen_target_cflags) $(bindgen_target_extra) +quiet_cmd_bindgen_static = BINDGEN $@ + cmd_bindgen_static = \ + $(BINDGEN) $< $(bindgen_target_flags) \ + --use-core --with-derive-default --ctypes-prefix core::ffi --no-layout-tests \ + --no-debug '.*' --enable-function-attribute-detection \ + --experimental --wrap-static-fns \ + --wrap-static-fns-path $(src)/extern.c \ + $(bindgen_static_functions) \ + -o $@ -- $(bindgen_c_flags_final) -DMODULE \ + $(bindgen_target_cflags) $(bindgen_target_extra) + +$(src)/extern.c: $(obj)/bindings/bindings_generated_static.rs \ + $(src)/bindings/bindings_helper.h + @sed -i 's|#include ".*|#include "bindings/bindings_helper.h"|g' $@ + $(obj)/bindings/bindings_generated.rs: private bindgen_target_flags = \ $(shell grep -Ev '^#|^$$' $(src)/bindgen_parameters) $(obj)/bindings/bindings_generated.rs: private bindgen_target_extra = ; \ @@ -309,6 +327,15 @@ $(obj)/bindings/bindings_generated.rs: $(src)/bindings/bindings_helper.h \ $(src)/bindgen_parameters FORCE $(call if_changed_dep,bindgen) +$(obj)/bindings/bindings_generated_static.rs: private bindgen_target_flags = \ + $(shell grep -Ev '^#|^$$' $(src)/bindgen_parameters) +$(obj)/bindings/bindings_generated_static.rs: private bindgen_static_functions = \ + $(shell grep -Ev '^#|^$$' $(src)/bindgen_static_functions) +$(obj)/bindings/bindings_generated_static.rs: $(src)/bindings/bindings_helper.h \ + $(src)/bindgen_static_functions \ + $(src)/bindgen_parameters FORCE + $(call if_changed_dep,bindgen_static) + $(obj)/uapi/uapi_generated.rs: private bindgen_target_flags = \ $(shell grep -Ev '^#|^$$' $(src)/bindgen_parameters) $(obj)/uapi/uapi_generated.rs: $(src)/uapi/uapi_helper.h \ @@ -352,6 +379,9 @@ $(obj)/exports_helpers_generated.h: $(obj)/helpers/helpers.o FORCE $(obj)/exports_bindings_generated.h: $(obj)/bindings.o FORCE $(call if_changed,exports) +$(obj)/exports_bindings_static_generated.h: $(obj)/extern.o FORCE + $(call if_changed,exports) + $(obj)/exports_kernel_generated.h: $(obj)/kernel.o FORCE $(call if_changed,exports) @@ -431,6 +461,7 @@ $(obj)/bindings.o: private rustc_target_flags = --extern ffi $(obj)/bindings.o: $(src)/bindings/lib.rs \ $(obj)/ffi.o \ $(obj)/bindings/bindings_generated.rs \ + $(obj)/bindings/bindings_generated_static.rs \ $(obj)/bindings/bindings_helpers_generated.rs FORCE +$(call if_changed_rule,rustc_library) diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions new file mode 100644 index 000000000000..1f24360daeb3 --- /dev/null +++ b/rust/bindgen_static_functions @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 + +# Don't generate structs +--blocklist-type '.*' + +--allowlist-function blk_mq_rq_to_pdu diff --git a/rust/bindings/lib.rs b/rust/bindings/lib.rs index 014af0d1fc70..02f789221025 100644 --- a/rust/bindings/lib.rs +++ b/rust/bindings/lib.rs @@ -39,6 +39,10 @@ mod bindings_raw { env!("OBJTREE"), "/rust/bindings/bindings_generated.rs" )); + include!(concat!( + env!("OBJTREE"), + "/rust/bindings/bindings_generated_static.rs" + )); } // When both a directly exposed symbol and a helper exists for the same function, diff --git a/rust/exports.c b/rust/exports.c index 587f0e776aba..288958d2ebea 100644 --- a/rust/exports.c +++ b/rust/exports.c @@ -18,6 +18,7 @@ #include "exports_core_generated.h" #include "exports_helpers_generated.h" #include "exports_bindings_generated.h" +#include "exports_bindings_static_generated.h" #include "exports_kernel_generated.h" // For modules using `rust/build_error.rs`. From patchwork Tue Jan 7 03:50:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 13928173 X-Patchwork-Delegate: bhelgaas@google.com Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D1481E00BF; Tue, 7 Jan 2025 03:51:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221902; cv=none; b=YK9/CCzPBQpZSq9Y7QeIfmhl8SUVng6MXPLWRZwo2Q51dt9sp4hdKPxEDrckS9NKOjaBQtfk7WOtHDE4YlLSm/y0mmzLlBkUAWSicJru+4yyVv0blzz2Xuib8ny8kxxh9dVrdUjAHNtK0KPTJUlr6GoZrk8pOyjQ9EwnziDzaBQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221902; c=relaxed/simple; bh=IWjQKr7AccmFJmpTxD6S3bb5W3i/qtgfuKMD1zVh5zU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Kok8HTltHcX6LNa58OVP+NGwzJZem8VSvb/zhAGL6iRh2yQ1hz/1gwXV+rXHQ2ZgS6Xb7etM38goWQOtX1RHwVPv45/BKiaGd/Gb3QmBiJskiXkA25h5XePJgu5kGALAaNmrJ++wNyoojM5pNojwoSnNdSoPktTG6dvvR2rasn8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me; spf=pass smtp.mailfrom=alistair23.me; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b=NmDDLTaT; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Tib6GhS0; arc=none smtp.client-ip=202.12.124.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alistair23.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b="NmDDLTaT"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Tib6GhS0" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id 6B16C2540187; Mon, 6 Jan 2025 22:51:36 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Mon, 06 Jan 2025 22:51:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1736221896; x= 1736308296; bh=z+pFKIeLOA8PYLBgwPgZ3mmaxEgfTa5OvRl/6M1DAr8=; b=N mDDLTaTluiTd2okDGRChlHL9dczRxUWgfKdEmsHdk3Abs7Z/wlZOmfKHwZjVF24o emcf+eIXgJ2FgdiXQfdRjejN5/LSz1h5bRRVxP+okeiTg6NyzPnfZRnBLTTQL3UR hjLf6cjva55lJB76KzCg/xWamKUFMnZylgF+HwKDfr3T+JKAikFwFqqGowGi0/b7 DHMZuYMfY1ngzNPu3RwfABks2dXgkU+o15ePF5j0vg5wg0oWAir8gv5Er5kZth// nPsxM0JdW6njkxZfggh1dxJQZS2ZUFqmVXt6oMfUKhOe9EPIM0qPxAVwXvnDNt2U aa8cuvt1mP4dRWtj5qNew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1736221896; x=1736308296; bh=z +pFKIeLOA8PYLBgwPgZ3mmaxEgfTa5OvRl/6M1DAr8=; b=Tib6GhS0+vlHp/r5S g/2r/Y3KKXwPVXAR6qNiifkukRB/D4ttviZe2lqy+WwInr8kPEYc13bPLKs/CJje pLgIcBgUgzouTRoyJnq66OtKAaOnQPpMcRUu0pkta00zpE0bADIHhug5iFOHyJrX K+9osKwdDXTqNJWGO7KXaREGPi/395TZlP7h1J9QnZ8ctfr937F31AVciOnBVmdC zn/BZGqjfObN9q8DD7Yv84KTC0Gh7O+M2rC97gqX0fZOGV69BEHmJVwU/rR6apNL eoafEn1CzWRNPit2Xv3wXSIIxIDrvZvz7R/77zHQCApRIWb1WC50jpXPeTb3cMy9 V6L4w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeguddgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlh hishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeitdefkeetledvleevveeu ueejffeugfeuvdetkeevjeejueetudeftefhgfehheenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhr vdefrdhmvgdpnhgspghrtghpthhtohepvdefpdhmohguvgepshhmthhpohhuthdprhgtph htthhopegshhgvlhhgrggrshesghhoohhglhgvrdgtohhmpdhrtghpthhtoheprhhushht qdhfohhrqdhlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplh hukhgrshesfihunhhnvghrrdguvgdprhgtphhtthhopehgrghrhiesghgrrhihghhuohdr nhgvthdprhgtphhtthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhnrdhorh hgpdhrtghpthhtohepthhmghhrohhsshesuhhmihgthhdrvgguuhdprhgtphhtthhopegs ohhquhhnrdhfvghnghesghhmrghilhdrtghomhdprhgtphhtthhopehojhgvuggrsehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgtgihlsehvghgvrhdrkhgvrhhn vghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Jan 2025 22:51:26 -0500 (EST) From: Alistair Francis To: bhelgaas@google.com, rust-for-linux@vger.kernel.org, lukas@wunner.de, gary@garyguo.net, akpm@linux-foundation.org, tmgross@umich.edu, boqun.feng@gmail.com, ojeda@kernel.org, linux-cxl@vger.kernel.org, bjorn3_gh@protonmail.com, a.hindborg@kernel.org, me@kloenk.dev, linux-kernel@vger.kernel.org, aliceryhl@google.com, alistair.francis@wdc.com, linux-pci@vger.kernel.org, benno.lossin@proton.me, alex.gaynor@gmail.com, Jonathan.Cameron@huawei.com Cc: alistair23@gmail.com, wilfred.mallawa@wdc.com, Alistair Francis , Dirk Behme Subject: [PATCH v5 02/11] rust: helpers: Remove blk helper Date: Tue, 7 Jan 2025 13:50:49 +1000 Message-ID: <20250107035058.818539-3-alistair@alistair23.me> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250107035058.818539-1-alistair@alistair23.me> References: <20250107035058.818539-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now that we support wrap-static-fns we no longer need the custom helper. Signed-off-by: Alistair Francis Tested-by: Dirk Behme --- rust/bindgen_static_functions | 1 + rust/helpers/blk.c | 14 -------------- rust/helpers/helpers.c | 1 - 3 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 rust/helpers/blk.c diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index 1f24360daeb3..42e45ce34221 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -4,3 +4,4 @@ --blocklist-type '.*' --allowlist-function blk_mq_rq_to_pdu +--allowlist-function blk_mq_rq_from_pdu diff --git a/rust/helpers/blk.c b/rust/helpers/blk.c deleted file mode 100644 index cc9f4e6a2d23..000000000000 --- a/rust/helpers/blk.c +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include -#include - -void *rust_helper_blk_mq_rq_to_pdu(struct request *rq) -{ - return blk_mq_rq_to_pdu(rq); -} - -struct request *rust_helper_blk_mq_rq_from_pdu(void *pdu) -{ - return blk_mq_rq_from_pdu(pdu); -} diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index dcf827a61b52..1d31672c147c 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -7,7 +7,6 @@ * Sorted alphabetically. */ -#include "blk.c" #include "bug.c" #include "build_assert.c" #include "build_bug.c" From patchwork Tue Jan 7 03:50:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 13928174 X-Patchwork-Delegate: bhelgaas@google.com Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C2A31E2619; Tue, 7 Jan 2025 03:51:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221913; cv=none; b=YH05/ZVOJS/V4xd6II5WoaeO0dUTtQOOIYOojSY1DIj1mQQM9Lny4GVrye0MXiriv1qZp34yzv8Bv+ZR+beh/2Cdl40/7Jq+5VeyiBMP9EgNIhMbo1eVPH/BCGsEG3d2BROQHAkX1gYCJ29ILZNxUjhe9j8kiTYzx5eWrIO25ik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221913; c=relaxed/simple; bh=rXDAQJOL+Uajjgvw/aj70QxUAQD2PtH3Brp7cxEK63w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XeI00fycM52Ht9SXS8OekVjoBsWS9at5q/H5Wbecm8RdGhbyAz8vsPe6RXwCmZ0vF/G4Q1A5zKrnebgOe+ne6ks2LBE2Q5K/Axk/+3EwHJZHk4q3zdLqsuZR9kF54ECm2tcO7Zot1psfLeBjMg3v8RSWm/rISSLZZXUd6fQW/wQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me; spf=pass smtp.mailfrom=alistair23.me; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b=Vg9kTGUL; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=d1drU+SK; arc=none smtp.client-ip=202.12.124.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alistair23.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b="Vg9kTGUL"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="d1drU+SK" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id 9194E1140128; Mon, 6 Jan 2025 22:51:48 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Mon, 06 Jan 2025 22:51:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1736221908; x= 1736308308; bh=ysTD+sUmXTOF6acsNPFt4Y9Z1gISdYBIgbv6V+9ErgY=; b=V g9kTGULBhwctG9AgIlA5wH2besv0NiT7zzvWA7xCkyQZBIErq4SndCXQgi5aihmQ xvdl1T0mfJCy/ffUs+8JDN/5eyeoauuIAYxtjnih7aQWyQy43p6K4DxOdLXVAsrA lkWcic72XXd0i95S6e4ihWLYw9wKiJt/hhUHpK6YY83Aw9Zg7kE/k0I4FG/M+C1j LYW5ct4d5b/raHEdyHC1y2CIkb7umflrlpFZtaUSrDura0QM5L5KkPb6A5KnvBEv LQNi5NKfRLC8bV2ArxDoTdP0TSmKLX0xQtEfZzvifd6OReOPzaiLAB5Mgq/LUIcu rrtERPgOOvX1djN1ID5Hg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1736221908; x=1736308308; bh=y sTD+sUmXTOF6acsNPFt4Y9Z1gISdYBIgbv6V+9ErgY=; b=d1drU+SKQriVJwwd1 LtujHF8fUYe2mNG88B5f5jnQyKIpEFj3m0XaI5ZTG1G97IcmI6ZWP9/4DKds40J9 TbQVjf+VvqRcgX9/SRqiKA1+vyceRxF8pFqDmHH9X3mYzjDOkOLttsaRsOYIf9MG V575VdkhG0nDZKrNgUpRDeiTwgqddurRxy7kRi8PhRHWLE0jUJuNwzYKNJdqF3ju cDJHvZA06h4RDPpj/0g7p+Zmr5T9xWAiOhCTPimZCtfYxaKpz7CkweovMhlpezqa ZFodFUVo4tSOc0XWSfz0JW8mDW7XexBpNhtqarbvaTr18hKQ1GhbMqQNLwAyWQy7 2x5qg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeguddgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlh hishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeitdefkeetledvleevveeu ueejffeugfeuvdetkeevjeejueetudeftefhgfehheenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhr vdefrdhmvgdpnhgspghrtghpthhtohepvdefpdhmohguvgepshhmthhpohhuthdprhgtph htthhopegshhgvlhhgrggrshesghhoohhglhgvrdgtohhmpdhrtghpthhtoheprhhushht qdhfohhrqdhlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplh hukhgrshesfihunhhnvghrrdguvgdprhgtphhtthhopehgrghrhiesghgrrhihghhuohdr nhgvthdprhgtphhtthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhnrdhorh hgpdhrtghpthhtohepthhmghhrohhsshesuhhmihgthhdrvgguuhdprhgtphhtthhopegs ohhquhhnrdhfvghnghesghhmrghilhdrtghomhdprhgtphhtthhopehojhgvuggrsehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgtgihlsehvghgvrhdrkhgvrhhn vghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Jan 2025 22:51:37 -0500 (EST) From: Alistair Francis To: bhelgaas@google.com, rust-for-linux@vger.kernel.org, lukas@wunner.de, gary@garyguo.net, akpm@linux-foundation.org, tmgross@umich.edu, boqun.feng@gmail.com, ojeda@kernel.org, linux-cxl@vger.kernel.org, bjorn3_gh@protonmail.com, a.hindborg@kernel.org, me@kloenk.dev, linux-kernel@vger.kernel.org, aliceryhl@google.com, alistair.francis@wdc.com, linux-pci@vger.kernel.org, benno.lossin@proton.me, alex.gaynor@gmail.com, Jonathan.Cameron@huawei.com Cc: alistair23@gmail.com, wilfred.mallawa@wdc.com, Alistair Francis , Dirk Behme Subject: [PATCH v5 03/11] rust: helpers: Remove err helper Date: Tue, 7 Jan 2025 13:50:50 +1000 Message-ID: <20250107035058.818539-4-alistair@alistair23.me> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250107035058.818539-1-alistair@alistair23.me> References: <20250107035058.818539-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now that we support wrap-static-fns we no longer need the custom helper. Signed-off-by: Alistair Francis Tested-by: Dirk Behme --- rust/bindgen_static_functions | 4 ++++ rust/helpers/err.c | 18 ------------------ rust/helpers/helpers.c | 1 - 3 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 rust/helpers/err.c diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index 42e45ce34221..0269efa83c61 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -5,3 +5,7 @@ --allowlist-function blk_mq_rq_to_pdu --allowlist-function blk_mq_rq_from_pdu + +--allowlist-function ERR_PTR +--allowlist-function IS_ERR +--allowlist-function PTR_ERR diff --git a/rust/helpers/err.c b/rust/helpers/err.c deleted file mode 100644 index 544c7cb86632..000000000000 --- a/rust/helpers/err.c +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include - -__force void *rust_helper_ERR_PTR(long err) -{ - return ERR_PTR(err); -} - -bool rust_helper_IS_ERR(__force const void *ptr) -{ - return IS_ERR(ptr); -} - -long rust_helper_PTR_ERR(__force const void *ptr) -{ - return PTR_ERR(ptr); -} diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 1d31672c147c..675f8eae0475 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -11,7 +11,6 @@ #include "build_assert.c" #include "build_bug.c" #include "cred.c" -#include "err.c" #include "fs.c" #include "jump_label.c" #include "kunit.c" From patchwork Tue Jan 7 03:50:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 13928175 X-Patchwork-Delegate: bhelgaas@google.com Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1158D1E282D; Tue, 7 Jan 2025 03:52:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221925; cv=none; b=eaeVAjxqlANIwa3zwYyUNOywBnDS3I3U8S1rwbljGZzR7iPa+Ood70UrTVFLxycb4a6iBjQ53V05+AAB+twAULuuRrSyFg3tfXV12fauVQ7YvAYu9r0hju+PXPm2dzrld/JfexpM5aAEmfDwZSnSXMjKacpllLH6Eez4HXl0DkY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221925; c=relaxed/simple; bh=5BrfFFBCBHv6932FS3KDksKXm9dLpoXeq8iAZYe+SqE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X+B/o8fYYpCvRYDV6jUF8gjyA6uVtFDbinPb1IpP4FEkLyg3kzh9uvXPCTaCq8Ue5VoQMq0+roSVo0pbovpAdRKNLY3cTKxINUJU59I51Vpl7hRkSBDxHGD/zi4Y41+R3ft0M8/oSm/UzvLa66M8sGl0xaVQShOS52Nd5KfSqAk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me; spf=pass smtp.mailfrom=alistair23.me; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b=wn1MCndP; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ikkma1Bm; arc=none smtp.client-ip=202.12.124.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alistair23.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b="wn1MCndP"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ikkma1Bm" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id B55911140132; Mon, 6 Jan 2025 22:52:00 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Mon, 06 Jan 2025 22:52:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1736221920; x= 1736308320; bh=bEub0ikOKo+++DSvY9N0stswW670P+GbSK/Ut0G9gns=; b=w n1MCndPAy8nPh90TaHLCghRfSkZQTy6RbcgyGB7xsFie0XEWniKknvUYUhWIF/LF cVnzMRDtGl9rQmXVrpGjIDShVHs8u8Mj0tr/H/Xa5Mw5ANcCcvi3SAQH4VFNy8vp SzNTm+I4nTDddp4R7/s9WwCZkkDaUmznkIpw/n9t3EaAj8QPFug3jn8NAW+KUtc3 /p0u97in9Ldlk5TT6rZsmUwnK+tVYIVdKc3LIsZgmchcgzx9Ut3Fdf1/ilOGL7Z+ JMpkMuUea8en4wW3v5XREupCd43DrZlf8rXvxhuqjcL8q/YIq9inDMxuOeqBQ8HT eZCf+CQcpcQsLPyol9z5g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1736221920; x=1736308320; bh=b Eub0ikOKo+++DSvY9N0stswW670P+GbSK/Ut0G9gns=; b=ikkma1Bm9JpJV2OmM 50eRmZKS51EOmLAuMtdCUjsalmm7uE1UWQykW9P74dQKIHvtp9As8M/AJTbo8/Mc TjAR25J9mMVYKDBDiZy/XBfFgvDSNNtxhPU3/5le7q1mNHg/MBCjAkSa1QVPgAAj IZ/k4YYAGgyx/u+tocQRs3K3Dib9CPNpLoEHlvACySS9428aEs407U9YrWNOt94Q vkZ5WbhheeY8oW3DvHcYuUE7OtVapFKd6paGwFvfwMM2TmcgS+//L7gOs49jABS+ j4lfz/tswve3JxThcoRRkg3q3/pmnPCOAcP90XtzApSYsozWcnmng4sExT1nM4y/ 7Z9UA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeguddgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlh hishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeitdefkeetledvleevveeu ueejffeugfeuvdetkeevjeejueetudeftefhgfehheenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhr vdefrdhmvgdpnhgspghrtghpthhtohepvdefpdhmohguvgepshhmthhpohhuthdprhgtph htthhopegshhgvlhhgrggrshesghhoohhglhgvrdgtohhmpdhrtghpthhtoheprhhushht qdhfohhrqdhlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplh hukhgrshesfihunhhnvghrrdguvgdprhgtphhtthhopehgrghrhiesghgrrhihghhuohdr nhgvthdprhgtphhtthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhnrdhorh hgpdhrtghpthhtohepthhmghhrohhsshesuhhmihgthhdrvgguuhdprhgtphhtthhopegs ohhquhhnrdhfvghnghesghhmrghilhdrtghomhdprhgtphhtthhopehojhgvuggrsehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgtgihlsehvghgvrhdrkhgvrhhn vghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Jan 2025 22:51:49 -0500 (EST) From: Alistair Francis To: bhelgaas@google.com, rust-for-linux@vger.kernel.org, lukas@wunner.de, gary@garyguo.net, akpm@linux-foundation.org, tmgross@umich.edu, boqun.feng@gmail.com, ojeda@kernel.org, linux-cxl@vger.kernel.org, bjorn3_gh@protonmail.com, a.hindborg@kernel.org, me@kloenk.dev, linux-kernel@vger.kernel.org, aliceryhl@google.com, alistair.francis@wdc.com, linux-pci@vger.kernel.org, benno.lossin@proton.me, alex.gaynor@gmail.com, Jonathan.Cameron@huawei.com Cc: alistair23@gmail.com, wilfred.mallawa@wdc.com, Alistair Francis , Dirk Behme Subject: [PATCH v5 04/11] rust: helpers: Remove kunit helper Date: Tue, 7 Jan 2025 13:50:51 +1000 Message-ID: <20250107035058.818539-5-alistair@alistair23.me> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250107035058.818539-1-alistair@alistair23.me> References: <20250107035058.818539-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now that we support wrap-static-fns we no longer need the custom helper. Signed-off-by: Alistair Francis Tested-by: Dirk Behme --- rust/bindgen_static_functions | 2 ++ rust/helpers/helpers.c | 1 - rust/helpers/kunit.c | 8 -------- 3 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 rust/helpers/kunit.c diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index 0269efa83c61..b4032d277e72 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -9,3 +9,5 @@ --allowlist-function ERR_PTR --allowlist-function IS_ERR --allowlist-function PTR_ERR + +--allowlist-function kunit_get_current_test diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 675f8eae0475..9e6c6c9c67d2 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -13,7 +13,6 @@ #include "cred.c" #include "fs.c" #include "jump_label.c" -#include "kunit.c" #include "mutex.c" #include "page.c" #include "pid_namespace.c" diff --git a/rust/helpers/kunit.c b/rust/helpers/kunit.c deleted file mode 100644 index b85a4d394c11..000000000000 --- a/rust/helpers/kunit.c +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include - -struct kunit *rust_helper_kunit_get_current_test(void) -{ - return kunit_get_current_test(); -} From patchwork Tue Jan 7 03:50:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 13928176 X-Patchwork-Delegate: bhelgaas@google.com Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07F2D1E377A; Tue, 7 Jan 2025 03:52:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221935; cv=none; b=mZrETFZlHURQMkY61sGZ4dWPXSY97PREna4nhOQ45szMC9dl80Jj2XdK1U62NVJdt100uXcAB+k/+UnNnOCb8tMi/cU+nJKW7slSlZxaNG5hOq14K1NRR/qRkeingOzLGh79OXIOI6ABCn6iM9F+Q+U8z2g7SIRsLnzJV/rq4/c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221935; c=relaxed/simple; bh=EHSlaTonH2PZtsWfGpxaWYL0HLwW1YZBpvhRYnj6NjM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iatb55l5rCbRT9WrBM8CVfibP0KNwO8HwTe/c0UL18O/o8pVnbxlvqafNZTBf/Z1nb+Q+KuwonHQ+5S2POulQ7soly19DdWdXbjKAvHTIBDhGXIL1YQevAeYfEakAOwERCtqFWyatB4dwhzQHFXMxXFDb+jSkPm6ja9/EMepyJU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me; spf=pass smtp.mailfrom=alistair23.me; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b=vsSi0Ple; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Tw6t5HN2; arc=none smtp.client-ip=202.12.124.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alistair23.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b="vsSi0Ple"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Tw6t5HN2" Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id 2B70D1140139; Mon, 6 Jan 2025 22:52:10 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Mon, 06 Jan 2025 22:52:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1736221930; x= 1736308330; bh=OfYGHDYbEKvGmLe0AavBagBId+cthJ3oCYShygzZcXU=; b=v sSi0PlejpPxLSUJBhVCKhG8hyguZ5MzyDiJQ9liiG/IRP2kRetiiRuF3Y0on4TWs xh8H2DG7YBfpmLMSThDuurJA03d5Dj895egng59UQRyq4HSc0QZtfImRlXeFiwex xdWbH3KNomQAoqYYUwrwHWqFkhZvp2dIC4UqyWvlTlHCZ8IcJOHeHVV77xZWTIKd ge1+7T3JVAWNVmIs+gyqcsmRwpBLAFjmVxrGRH5yCfgpdeqryjPRDYvWnBMMAYEb Lyx/brHJRzBLml9XXjhzzrOLaaF0Xmd4IVWYRr3yCU2gq3xU0QOj+TwRGE+7G4s5 hIIkOShrLzEVSeBK7mSbg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1736221930; x=1736308330; bh=O fYGHDYbEKvGmLe0AavBagBId+cthJ3oCYShygzZcXU=; b=Tw6t5HN2nk8vF0zXk R131X4TwrIyqeng3t7+TEBFxxzj4+7X3wM0HtSmjSyKNMDSw3iHb5w+Z7AYGXRci 4k8OTeQDaP/O7g+geZ2odlAtxgoaL/GV4lMKmCCVOtUV3mvbSrE4FoVvL9h+B3gc /0tz0M2sMYdmsR7u2Cm01vgvslxCPQRwhe0Y7uDtgvW/YY15oVNPD4zY9fRv+rlL AdblQlB4TTdatdq2Vt/vCDqEf2MJGUBlC4YTOxzdtl5z+aJVCjskUiP7Uya8Ii62 pa9FNo+hplWKjGg2U0WZxhAN2EwakOCChgKhnse8otFyK5Crb+wsoRuP8N/LkeJB Qup0g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeguddgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlh hishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeitdefkeetledvleevveeu ueejffeugfeuvdetkeevjeejueetudeftefhgfehheenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhr vdefrdhmvgdpnhgspghrtghpthhtohepvdefpdhmohguvgepshhmthhpohhuthdprhgtph htthhopegshhgvlhhgrggrshesghhoohhglhgvrdgtohhmpdhrtghpthhtoheprhhushht qdhfohhrqdhlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplh hukhgrshesfihunhhnvghrrdguvgdprhgtphhtthhopehgrghrhiesghgrrhihghhuohdr nhgvthdprhgtphhtthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhnrdhorh hgpdhrtghpthhtohepthhmghhrohhsshesuhhmihgthhdrvgguuhdprhgtphhtthhopegs ohhquhhnrdhfvghnghesghhmrghilhdrtghomhdprhgtphhtthhopehojhgvuggrsehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgtgihlsehvghgvrhdrkhgvrhhn vghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Jan 2025 22:52:01 -0500 (EST) From: Alistair Francis To: bhelgaas@google.com, rust-for-linux@vger.kernel.org, lukas@wunner.de, gary@garyguo.net, akpm@linux-foundation.org, tmgross@umich.edu, boqun.feng@gmail.com, ojeda@kernel.org, linux-cxl@vger.kernel.org, bjorn3_gh@protonmail.com, a.hindborg@kernel.org, me@kloenk.dev, linux-kernel@vger.kernel.org, aliceryhl@google.com, alistair.francis@wdc.com, linux-pci@vger.kernel.org, benno.lossin@proton.me, alex.gaynor@gmail.com, Jonathan.Cameron@huawei.com Cc: alistair23@gmail.com, wilfred.mallawa@wdc.com, Alistair Francis , Dirk Behme Subject: [PATCH v5 05/11] rust: helpers: Remove some page helpers Date: Tue, 7 Jan 2025 13:50:52 +1000 Message-ID: <20250107035058.818539-6-alistair@alistair23.me> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250107035058.818539-1-alistair@alistair23.me> References: <20250107035058.818539-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now that we support wrap-static-fns we no longer need the custom helpers. Signed-off-by: Alistair Francis Tested-by: Dirk Behme --- rust/bindgen_static_functions | 2 ++ rust/helpers/page.c | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index b4032d277e72..ded5b816f304 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -11,3 +11,5 @@ --allowlist-function PTR_ERR --allowlist-function kunit_get_current_test + +--allowlist-function kmap_local_page diff --git a/rust/helpers/page.c b/rust/helpers/page.c index b3f2b8fbf87f..52ebec9d7186 100644 --- a/rust/helpers/page.c +++ b/rust/helpers/page.c @@ -8,11 +8,6 @@ struct page *rust_helper_alloc_pages(gfp_t gfp_mask, unsigned int order) return alloc_pages(gfp_mask, order); } -void *rust_helper_kmap_local_page(struct page *page) -{ - return kmap_local_page(page); -} - void rust_helper_kunmap_local(const void *addr) { kunmap_local(addr); From patchwork Tue Jan 7 03:50:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 13928177 X-Patchwork-Delegate: bhelgaas@google.com Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19EDE1E3DFE; Tue, 7 Jan 2025 03:52:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221943; cv=none; b=kIpNFGZttE6ZROhqrhQSbQOkdlPwRwVjN0FtG04g4CZy3fVh8Qr56ae5cbf5tcNyUGGn2AMFovg67k+HdIzIbplifoPczahGmJ+i6avyX79FyWuPwTmHoqASeiRHZugybShtqm1jc6ZHxVlAuI5llcV9lbs3PXNr2KlLOu3LJjQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221943; c=relaxed/simple; bh=cd0agS7AIHU0PVOJAqLdisbQ8RWlif+RxxV6n4J/ICs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MDfBDJY52STiGy68TOgzGv2ZpETIi/FsUBRUfe0a4OI2PQ/L1mj6xdrak7GUYuXHiacsO9Cn6RZhDyBxehnyXoxUlkIXcL4G8I7dWEk9G9LRoJVid98W+sWza31LWYuF+KqBVTAy+XNMBjleLTSiFqqft5ZqxF+mDfxeB/+Kc0w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me; spf=pass smtp.mailfrom=alistair23.me; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b=mS9wqiDE; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=por36wVT; arc=none smtp.client-ip=202.12.124.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alistair23.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b="mS9wqiDE"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="por36wVT" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id BC7B11140149; Mon, 6 Jan 2025 22:52:17 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Mon, 06 Jan 2025 22:52:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1736221937; x= 1736308337; bh=nj0EXgOnxSxBu+4DaTIAnIbfD1oigHDTuBMmfLub0ok=; b=m S9wqiDEh/Vj/aCKxZKXvmbA5QijiaNAX0hwSB7AbghhuKO7hqkL/QOY7wDbJIEId UPtuASfbjD03l8/IajIZe0ojJLeZhY67S0d+eFZguCXOW8xAsxBjjZjAVRRje1Js FWZOC+7TFCN1EEeU+DL69kJ97w+FQUBhIfR+vp9B434kScvCSg/SBl5YsByoijCr tDosHckeuuXopVlM8HV92ozaZ/jBnYAGmdROPtzqi2pW3TwbaD1w5pjnkhUqH/Lq 5fK5E1u4bq9JFCAo+Uge89YieFQBI/u1q2oAU21m4ZkktFRTqhwf9svj/l9mcfpQ Et5zdpCOPL+j9vVZvbwcg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1736221937; x=1736308337; bh=n j0EXgOnxSxBu+4DaTIAnIbfD1oigHDTuBMmfLub0ok=; b=por36wVTUWoqMSo8P D3E6MnwmF0snFmmB6hHM580sETT0vvn/VR79x3AcB6zHmZ27hD/qRrGsiIpnDhca Aa+2InlPrP/5P/Dw85GmMapJ/l9oCfoVwbTxNaoJ6cWdDmSdjxM5T5y3aExzokC4 tsfEqLDMcRY6o076d+Zo4lLzTy3YpEVlzx8r2eKSS36b+qGjg8aM25NEMT0sIGWp tK8/r+R14vFJxaFGUpRE110mkZj+ng2EFKwvtmUFc1h65aUBhZ1dCZ6lJu4vPhch lw9XSEL+Sy2ter4oU5gN/xJ45ev+C9bJv+zl+lj9IbvBPO5+Ywl38nwDib5D7zmX rUrfw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeguddgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlh hishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeitdefkeetledvleevveeu ueejffeugfeuvdetkeevjeejueetudeftefhgfehheenucevlhhushhtvghrufhiiigvpe dunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhr vdefrdhmvgdpnhgspghrtghpthhtohepvdefpdhmohguvgepshhmthhpohhuthdprhgtph htthhopegshhgvlhhgrggrshesghhoohhglhgvrdgtohhmpdhrtghpthhtoheprhhushht qdhfohhrqdhlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplh hukhgrshesfihunhhnvghrrdguvgdprhgtphhtthhopehgrghrhiesghgrrhihghhuohdr nhgvthdprhgtphhtthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhnrdhorh hgpdhrtghpthhtohepthhmghhrohhsshesuhhmihgthhdrvgguuhdprhgtphhtthhopegs ohhquhhnrdhfvghnghesghhmrghilhdrtghomhdprhgtphhtthhopehojhgvuggrsehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgtgihlsehvghgvrhdrkhgvrhhn vghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Jan 2025 22:52:11 -0500 (EST) From: Alistair Francis To: bhelgaas@google.com, rust-for-linux@vger.kernel.org, lukas@wunner.de, gary@garyguo.net, akpm@linux-foundation.org, tmgross@umich.edu, boqun.feng@gmail.com, ojeda@kernel.org, linux-cxl@vger.kernel.org, bjorn3_gh@protonmail.com, a.hindborg@kernel.org, me@kloenk.dev, linux-kernel@vger.kernel.org, aliceryhl@google.com, alistair.francis@wdc.com, linux-pci@vger.kernel.org, benno.lossin@proton.me, alex.gaynor@gmail.com, Jonathan.Cameron@huawei.com Cc: alistair23@gmail.com, wilfred.mallawa@wdc.com, Alistair Francis , Dirk Behme Subject: [PATCH v5 06/11] rust: helpers: Remove rbtree helper Date: Tue, 7 Jan 2025 13:50:53 +1000 Message-ID: <20250107035058.818539-7-alistair@alistair23.me> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250107035058.818539-1-alistair@alistair23.me> References: <20250107035058.818539-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now that we support wrap-static-fns we no longer need the custom helper. Signed-off-by: Alistair Francis Tested-by: Dirk Behme --- rust/bindgen_static_functions | 2 ++ rust/helpers/helpers.c | 1 - rust/helpers/rbtree.c | 9 --------- 3 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 rust/helpers/rbtree.c diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index ded5b816f304..e464dc1f5682 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -13,3 +13,5 @@ --allowlist-function kunit_get_current_test --allowlist-function kmap_local_page + +--allowlist-function rb_link_node diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 9e6c6c9c67d2..54c52ceab77a 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -16,7 +16,6 @@ #include "mutex.c" #include "page.c" #include "pid_namespace.c" -#include "rbtree.c" #include "refcount.c" #include "security.c" #include "signal.c" diff --git a/rust/helpers/rbtree.c b/rust/helpers/rbtree.c deleted file mode 100644 index 6d404b84a9b5..000000000000 --- a/rust/helpers/rbtree.c +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include - -void rust_helper_rb_link_node(struct rb_node *node, struct rb_node *parent, - struct rb_node **rb_link) -{ - rb_link_node(node, parent, rb_link); -} From patchwork Tue Jan 7 03:50:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 13928178 X-Patchwork-Delegate: bhelgaas@google.com Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 065171E500C; Tue, 7 Jan 2025 03:52:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221950; cv=none; b=mbVqFep1kfEbofFdKbI7kQpY5LQDTtfgUjbgNN4BOX4G5pEwi/FV/vTngH6zVa1q4qy/nvHqV1AOkrYcpOqTEzBfLtp8NxNM0rBA5x+OWFSg9nLV6KfPOBPPaoQUAuKn041UW+/ppKqOtgSbTTPnDt9k6FCCA9lVUc4H1PPr4Eo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221950; c=relaxed/simple; bh=ktuF6QGhDbQg8xIfGVMl2TcLdel+kA+paQAD6kULnIM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kqLD4dmp02A2z7BKaE9yvX58JKp1uKKt0jEEWsLuBOWSYGkvIOr13PSa7lh4DSzgl+H2wBiL312ISRIgnp6ScXTqDAPH0xGgFlwkxhUjvZ+QUhUsuvYYe1kttAJjdkgfEuiil8p3belT3ZN/twVencMBVekcmYwNlj2QoasJZVc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me; spf=pass smtp.mailfrom=alistair23.me; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b=iu1DtC5f; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Rxk0cFp/; arc=none smtp.client-ip=202.12.124.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alistair23.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b="iu1DtC5f"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Rxk0cFp/" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.stl.internal (Postfix) with ESMTP id 7A72D254018A; Mon, 6 Jan 2025 22:52:25 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Mon, 06 Jan 2025 22:52:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1736221945; x= 1736308345; bh=8bWDHDA3V6fl83TPJL7Nq440bVs6UgORLNLOTozsUtw=; b=i u1DtC5f2DXFwCPg34L54fW2PNo+45siL6sS+ndsiT8+Qs2JcxVLdvoupliYgxCen oAtcqvIuNaS+qrbk2/8lnJ03LuXOvoqKv+PV0CvjsEZvCrBksw7yS8AckGpRUtCL c3k+hw9z2fAy1Us0a+zpPSdOg9260qr5WRYWpg57IuwLm+e49+BHP4aseZwLILu3 Rosvb0yHRk1m4qfHWqNk0yONqSB9uyklV6wT6avurHziaH6aEXiO3PP984bTv4j8 YV5qz4xOdhrOPflmk56Paz2BIWQTuLqLqEGLHdAoBt+TuRWQHTDu07GnFjUhG4ZZ 0oj3hLFppa/Y/Xn7bUKHw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1736221945; x=1736308345; bh=8 bWDHDA3V6fl83TPJL7Nq440bVs6UgORLNLOTozsUtw=; b=Rxk0cFp//pvofqBW9 3+EC4Qhs5PXsjuJOAXURF5AnBXARM8DK0O2LM/ayavApmX3+95rWV9IzkuQICckS L2kJTpMlka/V/w0EFfWDCznpME1sH7vWjygcppiMWPUyAjEXHP6kjxHaJgOcdh8S fIHbaV0A1ykGTfm1WjmKIuWgVLcubDYaC8FDAdoOcBu6QKX0B/sQ9t5yGFMsjIAF 9YmGCS/Vrtg46/Ow9ncZhRBG9qXfQKSi27ajkERJ91R5hNOqx9HNxYpkKBQl5BvU sCqzGaEF0CXPjx6lrmjBuWUKF1Ty7Iic0y7+mAHFQPZWdmuzsX1EQTgAyZN6d0x3 MO/5g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeguddgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlh hishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeitdefkeetledvleevveeu ueejffeugfeuvdetkeevjeejueetudeftefhgfehheenucevlhhushhtvghrufhiiigvpe dvnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhr vdefrdhmvgdpnhgspghrtghpthhtohepvdefpdhmohguvgepshhmthhpohhuthdprhgtph htthhopegshhgvlhhgrggrshesghhoohhglhgvrdgtohhmpdhrtghpthhtoheprhhushht qdhfohhrqdhlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplh hukhgrshesfihunhhnvghrrdguvgdprhgtphhtthhopehgrghrhiesghgrrhihghhuohdr nhgvthdprhgtphhtthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhnrdhorh hgpdhrtghpthhtohepthhmghhrohhsshesuhhmihgthhdrvgguuhdprhgtphhtthhopegs ohhquhhnrdhfvghnghesghhmrghilhdrtghomhdprhgtphhtthhopehojhgvuggrsehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgtgihlsehvghgvrhdrkhgvrhhn vghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Jan 2025 22:52:18 -0500 (EST) From: Alistair Francis To: bhelgaas@google.com, rust-for-linux@vger.kernel.org, lukas@wunner.de, gary@garyguo.net, akpm@linux-foundation.org, tmgross@umich.edu, boqun.feng@gmail.com, ojeda@kernel.org, linux-cxl@vger.kernel.org, bjorn3_gh@protonmail.com, a.hindborg@kernel.org, me@kloenk.dev, linux-kernel@vger.kernel.org, aliceryhl@google.com, alistair.francis@wdc.com, linux-pci@vger.kernel.org, benno.lossin@proton.me, alex.gaynor@gmail.com, Jonathan.Cameron@huawei.com Cc: alistair23@gmail.com, wilfred.mallawa@wdc.com, Alistair Francis , Dirk Behme Subject: [PATCH v5 07/11] rust: helpers: Remove some refcount helpers Date: Tue, 7 Jan 2025 13:50:54 +1000 Message-ID: <20250107035058.818539-8-alistair@alistair23.me> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250107035058.818539-1-alistair@alistair23.me> References: <20250107035058.818539-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now that we support wrap-static-fns we no longer need the custom helpers. Signed-off-by: Alistair Francis Tested-by: Dirk Behme --- rust/bindgen_static_functions | 3 +++ rust/helpers/refcount.c | 10 ---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index e464dc1f5682..9c40a867a64d 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -15,3 +15,6 @@ --allowlist-function kmap_local_page --allowlist-function rb_link_node + +--allowlist-function refcount_inc +--allowlist-function refcount_dec_and_test diff --git a/rust/helpers/refcount.c b/rust/helpers/refcount.c index d6adbd2e45a1..ed13236246d8 100644 --- a/rust/helpers/refcount.c +++ b/rust/helpers/refcount.c @@ -6,13 +6,3 @@ refcount_t rust_helper_REFCOUNT_INIT(int n) { return (refcount_t)REFCOUNT_INIT(n); } - -void rust_helper_refcount_inc(refcount_t *r) -{ - refcount_inc(r); -} - -bool rust_helper_refcount_dec_and_test(refcount_t *r) -{ - return refcount_dec_and_test(r); -} From patchwork Tue Jan 7 03:50:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 13928179 X-Patchwork-Delegate: bhelgaas@google.com Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 559551E571B; Tue, 7 Jan 2025 03:52:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221959; cv=none; b=J+moOl+TuU6I22XL5lZecFTIL3oBp5dlc6u3NTDBstIY7sKz0r4tW6jORgJrqdR3MFxsMWh6r7jQwarMFpY4K8NlpJd8jqxFuuSHc0UX4Q8AAWhglsDf2MSdf8Oq82O7wNLfFyJNJUEgT9nQaJ6oK88d2rdKNuSyMzQN/sHTOjc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221959; c=relaxed/simple; bh=WJM8agB18razC459I8KPMiDyInJYNz/buuLZP8sSpYg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mUOOwVNJKpgwJ1R2lmHlBrZfiuFfKioTgfoqGe/MvxSCuPdH21FbFKoQsQki4spWMquUs9KVOiriaM7e6sgSH9atHMqpvDBvJROZP+ybcJgNLtr+316MGFJDKZFy1/H30eWuu+V3LcxnmN6CPJCLeXlOB29NTvT86WV3Hfz28mU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me; spf=pass smtp.mailfrom=alistair23.me; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b=YsrOwSe8; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=OzHJ9ace; arc=none smtp.client-ip=202.12.124.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alistair23.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b="YsrOwSe8"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="OzHJ9ace" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id B7F8E1140137; Mon, 6 Jan 2025 22:52:33 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Mon, 06 Jan 2025 22:52:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1736221953; x= 1736308353; bh=uDYuNp9Rb3X+K7oxTJbqZ8wyi03RrB4MU+gB0NKcPJU=; b=Y srOwSe8lgNNGX65YnDUHTghbwOxPiMwpS9MZQXrC1fc+YwLkyqTH7AzxdCV5ZRPp 7ad2fTQM+O/TAKkGKn7GI42IdBFhfkyRle2Q0iE09K57vr7TBipT9I8Fzsgl3XGM gsij2+lRYNKmgthcrrEqg6buRI7FPeDNv3YNSrO6kGZ+hUP2azQtMqDemFakoEqt xlRvK94pI4xHI5hmAiA49nINVZi7g8IxsDY+lsw9c1HqYTwdCYbYip3B5dGxjnyL rV5cimdcOViq+ntr+pfdxXynviSQ1opIIoNcKCUDA6ORX5awbFea2kX3LYz2+WWu 4eT6VwC8n2TKrgavhHg1g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1736221953; x=1736308353; bh=u DYuNp9Rb3X+K7oxTJbqZ8wyi03RrB4MU+gB0NKcPJU=; b=OzHJ9aceBiB6hhlVJ GRKkdXi7GiR4odTPUTD0ep6g2JAKR+bGEG12WYVVqGteQjTFOtED0yhrpRSYd7qM 5FsG2cqmII0HLm1XDAU2ALXssrM8+2d5KfdW1V0PGoc8xLMm9lrSE4Hhy+Hn77cN E7FJ/EH9KEp9XahnJ1NS15GkmWlhSMIrlyIPoBJ1Rk2U4p0zLEqzyw3UjPhQjy6d BrJabPCiBxP7AsyW3N6oTcVpVS/b66fX+9eisHJW2LaNM7t/sBKU0ue/tDMWpdPL jyqWRUaczv+1FtAas5LY5cshReqv8WyU5CDc7gwgD2+e3bBfXvwWTe80ZHOoFKKB RV/vA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeguddgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlh hishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeitdefkeetledvleevveeu ueejffeugfeuvdetkeevjeejueetudeftefhgfehheenucevlhhushhtvghrufhiiigvpe dunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhr vdefrdhmvgdpnhgspghrtghpthhtohepvdefpdhmohguvgepshhmthhpohhuthdprhgtph htthhopegshhgvlhhgrggrshesghhoohhglhgvrdgtohhmpdhrtghpthhtoheprhhushht qdhfohhrqdhlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplh hukhgrshesfihunhhnvghrrdguvgdprhgtphhtthhopehgrghrhiesghgrrhihghhuohdr nhgvthdprhgtphhtthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhnrdhorh hgpdhrtghpthhtohepthhmghhrohhsshesuhhmihgthhdrvgguuhdprhgtphhtthhopegs ohhquhhnrdhfvghnghesghhmrghilhdrtghomhdprhgtphhtthhopehojhgvuggrsehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgtgihlsehvghgvrhdrkhgvrhhn vghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Jan 2025 22:52:26 -0500 (EST) From: Alistair Francis To: bhelgaas@google.com, rust-for-linux@vger.kernel.org, lukas@wunner.de, gary@garyguo.net, akpm@linux-foundation.org, tmgross@umich.edu, boqun.feng@gmail.com, ojeda@kernel.org, linux-cxl@vger.kernel.org, bjorn3_gh@protonmail.com, a.hindborg@kernel.org, me@kloenk.dev, linux-kernel@vger.kernel.org, aliceryhl@google.com, alistair.francis@wdc.com, linux-pci@vger.kernel.org, benno.lossin@proton.me, alex.gaynor@gmail.com, Jonathan.Cameron@huawei.com Cc: alistair23@gmail.com, wilfred.mallawa@wdc.com, Alistair Francis , Dirk Behme Subject: [PATCH v5 08/11] rust: helpers: Remove signal helper Date: Tue, 7 Jan 2025 13:50:55 +1000 Message-ID: <20250107035058.818539-9-alistair@alistair23.me> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250107035058.818539-1-alistair@alistair23.me> References: <20250107035058.818539-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now that we support wrap-static-fns we no longer need the custom helper. Signed-off-by: Alistair Francis Tested-by: Dirk Behme --- rust/bindgen_static_functions | 2 ++ rust/helpers/helpers.c | 1 - rust/helpers/signal.c | 8 -------- 3 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 rust/helpers/signal.c diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index 9c40a867a64d..407dd091ddec 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -18,3 +18,5 @@ --allowlist-function refcount_inc --allowlist-function refcount_dec_and_test + +--allowlist-function signal_pending diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 54c52ceab77a..2731ddf736dd 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -18,7 +18,6 @@ #include "pid_namespace.c" #include "refcount.c" #include "security.c" -#include "signal.c" #include "slab.c" #include "spinlock.c" #include "task.c" diff --git a/rust/helpers/signal.c b/rust/helpers/signal.c deleted file mode 100644 index 1a6bbe9438e2..000000000000 --- a/rust/helpers/signal.c +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include - -int rust_helper_signal_pending(struct task_struct *t) -{ - return signal_pending(t); -} From patchwork Tue Jan 7 03:50:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 13928180 X-Patchwork-Delegate: bhelgaas@google.com Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 167C91E883A; Tue, 7 Jan 2025 03:52:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221966; cv=none; b=ueOa6z//HZHG6S6qDyC3i1sAO0uYmGLhyobmu2sGXhwtohFNACmWsg5c6bqnZg5yvgnjwqLqS1Xl2e9W5im8uufMZ4/KrjeHWuybphskutE60XoRn35LMVTblNjfk7oJ6gh3kveUhYumG3wWnKUKxuc0EBECiGtUTe6OEVg0hSo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221966; c=relaxed/simple; bh=ca4xx630+g0PAjkawxxCm3Yjq6HP4OpCrNReD91pACw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m+4GklLaF49M0M4YrsgbiJW6Tg3M3wI7Qas+Dq8WDW1RXMtw/HSre+lod/lfjlB0Fj3dYstdazStMLqS8uHqWcXdqWZpXa9hlnuXvaqWS/X6MF+UMUGqecSYVgUPIswv2rtMQyGEbDjU8gQWr5oPnVbRqf3kpgnis8AU4tQo4/w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me; spf=pass smtp.mailfrom=alistair23.me; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b=EWgmzQxL; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=kAoFE7G8; arc=none smtp.client-ip=202.12.124.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alistair23.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b="EWgmzQxL"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="kAoFE7G8" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id B6D311140152; Mon, 6 Jan 2025 22:52:41 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Mon, 06 Jan 2025 22:52:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1736221961; x= 1736308361; bh=UBZi08O7ZyCFdLTlJ4kxsaxYFuFhIyxFjKNL1zlgn6M=; b=E WgmzQxLbG9IQgWiCMaTdXt1criM1UGAz5Q6IsvMPYORYrR68I/9YpVEHtAyH2Zxt dKSCN2DVPD8BJ01lAwBByoGkbDgh9TN+bD/8K3+G8R3A8l2KxrK/vjEgXup9IVKW Lk9cWZ/9psmktbnHJhe+Sd+fyyrc/C3HpIUiR+J3/vsBQRpXmQwoYLZKvruXCcyN 2TJp/UBFdDFjppRGq8AkqmFlVRP5ue98GFipF7S/2l0dKlVH3uikjC7OAmAyCY9Z 8cfUr/MuH4z3rxUmiZ4DMESIjXvgBkMo1uzohbl6/unjGKSgTP1oAgAcXFuj8pa4 TwvPt480MDnf6CKxcJwUw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1736221961; x=1736308361; bh=U BZi08O7ZyCFdLTlJ4kxsaxYFuFhIyxFjKNL1zlgn6M=; b=kAoFE7G8qPLghwBfq doWmO5Ro8RUsUxgAE0cL5e8yXr6fI1V6M2TtBJNbMr9qP8IGsKQKQ3Z3ni8+ucxr 8GoApL1XzjrM2Kn/RVlhFXkZm9I2F7/vLbb/tH2P8c2nJdMDKz10oz98RIZckAUi Tl8I1qIEvEORsfPke9/zs36WQRgadNs99fOnm8ziSYXYgKxp923VK3F1QMN5JO2d ZTTgK2jZSbqwdh7UzmvbVaZUVC758dPJ4oxjtUcaXxQY0KRlwlEUXbXe4wu73xrg yGLW8iClFzL3RU98nmfNn36OUpDxUHkjLelZOSCUJze+r4kAFZ1+TMntehgZS4tE YHZvA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeguddgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlh hishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeitdefkeetledvleevveeu ueejffeugfeuvdetkeevjeejueetudeftefhgfehheenucevlhhushhtvghrufhiiigvpe efnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhr vdefrdhmvgdpnhgspghrtghpthhtohepvdefpdhmohguvgepshhmthhpohhuthdprhgtph htthhopegshhgvlhhgrggrshesghhoohhglhgvrdgtohhmpdhrtghpthhtoheprhhushht qdhfohhrqdhlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplh hukhgrshesfihunhhnvghrrdguvgdprhgtphhtthhopehgrghrhiesghgrrhihghhuohdr nhgvthdprhgtphhtthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhnrdhorh hgpdhrtghpthhtohepthhmghhrohhsshesuhhmihgthhdrvgguuhdprhgtphhtthhopegs ohhquhhnrdhfvghnghesghhmrghilhdrtghomhdprhgtphhtthhopehojhgvuggrsehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgtgihlsehvghgvrhdrkhgvrhhn vghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Jan 2025 22:52:34 -0500 (EST) From: Alistair Francis To: bhelgaas@google.com, rust-for-linux@vger.kernel.org, lukas@wunner.de, gary@garyguo.net, akpm@linux-foundation.org, tmgross@umich.edu, boqun.feng@gmail.com, ojeda@kernel.org, linux-cxl@vger.kernel.org, bjorn3_gh@protonmail.com, a.hindborg@kernel.org, me@kloenk.dev, linux-kernel@vger.kernel.org, aliceryhl@google.com, alistair.francis@wdc.com, linux-pci@vger.kernel.org, benno.lossin@proton.me, alex.gaynor@gmail.com, Jonathan.Cameron@huawei.com Cc: alistair23@gmail.com, wilfred.mallawa@wdc.com, Alistair Francis , Dirk Behme Subject: [PATCH v5 09/11] rust: helpers: Remove some spinlock helpers Date: Tue, 7 Jan 2025 13:50:56 +1000 Message-ID: <20250107035058.818539-10-alistair@alistair23.me> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250107035058.818539-1-alistair@alistair23.me> References: <20250107035058.818539-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now that we support wrap-static-fns we no longer need the custom helpers. Signed-off-by: Alistair Francis Tested-by: Dirk Behme --- rust/bindgen_static_functions | 4 ++++ rust/helpers/spinlock.c | 15 --------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index 407dd091ddec..9d6c44e277b5 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -20,3 +20,7 @@ --allowlist-function refcount_dec_and_test --allowlist-function signal_pending + +--allowlist-function spin_lock +--allowlist-function spin_unlock +--allowlist-function spin_trylock diff --git a/rust/helpers/spinlock.c b/rust/helpers/spinlock.c index 5971fdf6f755..72ca0208ed10 100644 --- a/rust/helpers/spinlock.c +++ b/rust/helpers/spinlock.c @@ -15,18 +15,3 @@ void rust_helper___spin_lock_init(spinlock_t *lock, const char *name, spin_lock_init(lock); #endif /* CONFIG_DEBUG_SPINLOCK */ } - -void rust_helper_spin_lock(spinlock_t *lock) -{ - spin_lock(lock); -} - -void rust_helper_spin_unlock(spinlock_t *lock) -{ - spin_unlock(lock); -} - -int rust_helper_spin_trylock(spinlock_t *lock) -{ - return spin_trylock(lock); -} From patchwork Tue Jan 7 03:50:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 13928181 X-Patchwork-Delegate: bhelgaas@google.com Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 040E01E9B09; Tue, 7 Jan 2025 03:52:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221974; cv=none; b=i0ugWh1WIgem6sFyZSu2KqyeJODmCqJMyzOpzeYLVipxU+ZTMLvd3hRhIkylHt7f3S4CBo5r5ohkwNjJ/Ncq5cGKrmoDownti2QdX4jPmthSzGGTuCQW8APeQ+Ou4y+57GnpzC8GY2THHziZx3HzcKPAKfOWaPkRCxrnTRMkjL0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221974; c=relaxed/simple; bh=shclbD4m40GcjPTZvhzkGHRYbPJZG50Z0vKKKwDHAX8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dGL0Up7AQLuIlfKsFxoJwxhpwt5aM+gRYPBim4Owu9YHtWUisfo4NNtTQPsMS95l47Imr+RtwvNwi9JnZlBuoRJ8xLc0DIvFFyApI90l5epPajasgL+F22plgZBgc0k8wUwtRtsXnZGgi9R3cSldTUAve//bh6UMMrgoocMcoZA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me; spf=pass smtp.mailfrom=alistair23.me; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b=vxchY+0x; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Wz7tAAC9; arc=none smtp.client-ip=202.12.124.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alistair23.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b="vxchY+0x"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Wz7tAAC9" Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id A1AD92540194; Mon, 6 Jan 2025 22:52:49 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Mon, 06 Jan 2025 22:52:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1736221969; x= 1736308369; bh=nCGxfzjG/lwLPtxDK38RAhotjzRn8PNJB7cqZ+mSotE=; b=v xchY+0xFIbuXq4z2O4YAYAw6K+xQCWVVxwpgT7Gczfj7+IQO5GLjSaAt5lvfWIj9 JG3JFeS/XbnypYFSsxNU7vMZglzz2MphxWulevym4XA/6Aas/1Dyw+VemHzS8RhU GdGdq/W1UksGvaCFypim2mXt0dUXtSLHrqMPElTb1Zn8W6VAWVjikn5ZXIjjj7yv LINOtnqupkCqdrLrFVJRnQ3aaVdH2wiQemLinmCKuiBcyaVUcAM9thlLlITMqdcj cAghc2H8hLKrRhrKhrbi7lVDZCj9YA3QK700moDpWXy1IGatw83qMF78+qEHKLzV ZS+ua9n/yX/T4wRmopd/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1736221969; x=1736308369; bh=n CGxfzjG/lwLPtxDK38RAhotjzRn8PNJB7cqZ+mSotE=; b=Wz7tAAC9F5U8F4P58 +B9OB0HMTQmUw2M87tp8fwrHwSMf/9kSkfhVzc9KjinaaCdr9irB1SGNwT1C9vdx DmMuB0nv4UERzkvF7AyFf9nENazHZi8zCPZdRyea1EFCmODgX61w7VhU7sd/P3yY PVtf80Z3HCd/NumhbHEE4HTvMc4f1xcX8zMJyTIjgdfCLL/UbaNZ0bjmZBY7AxV4 Xc8yobamPy/xvBhaDNo3ZVsC9HX204glgZP2iBbiA278xorHjB4zl4ax0LFBdxwA OemUb3fIxh3BPZZEaXdQNSiFSvWYMVWIscnMSIIBAtIduGS83hFziGTfweeI2RaE C0pzQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeguddgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlh hishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeitdefkeetledvleevveeu ueejffeugfeuvdetkeevjeejueetudeftefhgfehheenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhr vdefrdhmvgdpnhgspghrtghpthhtohepvdefpdhmohguvgepshhmthhpohhuthdprhgtph htthhopegshhgvlhhgrggrshesghhoohhglhgvrdgtohhmpdhrtghpthhtoheprhhushht qdhfohhrqdhlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplh hukhgrshesfihunhhnvghrrdguvgdprhgtphhtthhopehgrghrhiesghgrrhihghhuohdr nhgvthdprhgtphhtthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhnrdhorh hgpdhrtghpthhtohepthhmghhrohhsshesuhhmihgthhdrvgguuhdprhgtphhtthhopegs ohhquhhnrdhfvghnghesghhmrghilhdrtghomhdprhgtphhtthhopehojhgvuggrsehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgtgihlsehvghgvrhdrkhgvrhhn vghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Jan 2025 22:52:42 -0500 (EST) From: Alistair Francis To: bhelgaas@google.com, rust-for-linux@vger.kernel.org, lukas@wunner.de, gary@garyguo.net, akpm@linux-foundation.org, tmgross@umich.edu, boqun.feng@gmail.com, ojeda@kernel.org, linux-cxl@vger.kernel.org, bjorn3_gh@protonmail.com, a.hindborg@kernel.org, me@kloenk.dev, linux-kernel@vger.kernel.org, aliceryhl@google.com, alistair.francis@wdc.com, linux-pci@vger.kernel.org, benno.lossin@proton.me, alex.gaynor@gmail.com, Jonathan.Cameron@huawei.com Cc: alistair23@gmail.com, wilfred.mallawa@wdc.com, Alistair Francis , Dirk Behme Subject: [PATCH v5 10/11] rust: helpers: Remove some task helpers Date: Tue, 7 Jan 2025 13:50:57 +1000 Message-ID: <20250107035058.818539-11-alistair@alistair23.me> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250107035058.818539-1-alistair@alistair23.me> References: <20250107035058.818539-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now that we support wrap-static-fns we no longer need the custom helpers. Signed-off-by: Alistair Francis Tested-by: Dirk Behme --- rust/bindgen_static_functions | 3 +++ rust/helpers/task.c | 10 ---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index 9d6c44e277b5..8bc291a7a799 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -24,3 +24,6 @@ --allowlist-function spin_lock --allowlist-function spin_unlock --allowlist-function spin_trylock + +--allowlist-function get_task_struct +--allowlist-function put_task_struct diff --git a/rust/helpers/task.c b/rust/helpers/task.c index 31c33ea2dce6..38a7765d9915 100644 --- a/rust/helpers/task.c +++ b/rust/helpers/task.c @@ -7,16 +7,6 @@ struct task_struct *rust_helper_get_current(void) return current; } -void rust_helper_get_task_struct(struct task_struct *t) -{ - get_task_struct(t); -} - -void rust_helper_put_task_struct(struct task_struct *t) -{ - put_task_struct(t); -} - kuid_t rust_helper_task_uid(struct task_struct *task) { return task_uid(task); From patchwork Tue Jan 7 03:50:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 13928182 X-Patchwork-Delegate: bhelgaas@google.com Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F18F61E0E16; Tue, 7 Jan 2025 03:52:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221982; cv=none; b=nc0zdqo6UK72xhodHLLhALx9O5JFsCuHNEAxxr6PKhRAC0828cFj/1g8eprATDtlBRNJd2Lec1WHPSFlQvO9oSSVcezta5QhfwKMg7FoRVZDvQj7cjw9v4R6TV92ky0Gw4dvJL9fxLvt6iLIgDzvLzfXJHzhKPvLw4xpIysI6tg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736221982; c=relaxed/simple; bh=h/vdAz68f5WBEK+WdATCg2LIYtqAKRgGlxS03XAJoYw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I7YTbivcapPZ+wXB2k2Zb0ryeew/i6z72jdppAgaf4EtvchJA6NI87LW7pufE2Idw6tsPT3T8MT2gwd4SUoEbTlS7MUVVVTpWBrHbRj2Ze23Nd3azMAeDseyif8Db/PgxKO6eHr7L9zomh6h7hpnsA7EWOteUfS26rMDVQuHl+c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me; spf=pass smtp.mailfrom=alistair23.me; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b=AbjOH1yi; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=tOa6TzcJ; arc=none smtp.client-ip=202.12.124.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alistair23.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b="AbjOH1yi"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="tOa6TzcJ" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 894BC114015D; Mon, 6 Jan 2025 22:52:57 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Mon, 06 Jan 2025 22:52:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1736221977; x= 1736308377; bh=AZJ1va9BbDkIfSjPw6PRUjwodT7OYt+ydpDIg7Yws0o=; b=A bjOH1yib4RcOWpz/8YHSqn6A4PFeYeS+OFcm/S/DuDeHf8P7h3OMnR8e6EuhkjnO WMxtQ6a6+0blSZJx2U++iWjCM6Sqv13Z/MXzxvvWqd7rlUedMNYM2AezYZyuS4Xf wXhBZ5BA6TblPEd040Nq5brtsdJ7UpGGZU9HFWEc0ezD9jzfEnviwUNqNl/9H0zJ zuYRMETVGhehxhQYkjku4dQ3wDS6d1xZm0NWV439iR8UA67ydtKm2jakiUItKg9D CWtU14woB8Q4xLNm9FhJf9dKwwNx++qPEPYCE6llGjSpPN2SrvfRWYo+96CIkF4y zGNLPQMNLpSjsqO7+zEwQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1736221977; x=1736308377; bh=A ZJ1va9BbDkIfSjPw6PRUjwodT7OYt+ydpDIg7Yws0o=; b=tOa6TzcJLsrPL8Gbe NfphB65zDVwL4CxjKdsN9/jjVKj2/lFMOs0Micrr6ULlGL+NY54vWIhuay8vS/S0 5p7igg5StEblE6GtV75FLSTpmOnE9VmhG62Oz4Jpl0VksLDmC70Nonv5K85vY3kN DodfMT7wjTBj7SztyzdBMH+mEjneICZ2xRE8C+F9kKkh/98c+TcT3Dlm01oK4zzT 62hSDbPRg2N520iRLFf9myXyNEf3kDzN2CnY10T1h2lNqcCtnhQd20ErUUbET0WW rSBXVIWhbIL3Z2sJP+ELe1095Bi3rK3Ih29/fKrqCsbYKVyuMNX/t7bO/gq3gRuU R/Kew== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeguddgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttden ucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlh hishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeitdefkeetledvleevveeu ueejffeugfeuvdetkeevjeejueetudeftefhgfehheenucevlhhushhtvghrufhiiigvpe dunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhr vdefrdhmvgdpnhgspghrtghpthhtohepvdefpdhmohguvgepshhmthhpohhuthdprhgtph htthhopegshhgvlhhgrggrshesghhoohhglhgvrdgtohhmpdhrtghpthhtoheprhhushht qdhfohhrqdhlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplh hukhgrshesfihunhhnvghrrdguvgdprhgtphhtthhopehgrghrhiesghgrrhihghhuohdr nhgvthdprhgtphhtthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhnrdhorh hgpdhrtghpthhtohepthhmghhrohhsshesuhhmihgthhdrvgguuhdprhgtphhtthhopegs ohhquhhnrdhfvghnghesghhmrghilhdrtghomhdprhgtphhtthhopehojhgvuggrsehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgtgihlsehvghgvrhdrkhgvrhhn vghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Jan 2025 22:52:50 -0500 (EST) From: Alistair Francis To: bhelgaas@google.com, rust-for-linux@vger.kernel.org, lukas@wunner.de, gary@garyguo.net, akpm@linux-foundation.org, tmgross@umich.edu, boqun.feng@gmail.com, ojeda@kernel.org, linux-cxl@vger.kernel.org, bjorn3_gh@protonmail.com, a.hindborg@kernel.org, me@kloenk.dev, linux-kernel@vger.kernel.org, aliceryhl@google.com, alistair.francis@wdc.com, linux-pci@vger.kernel.org, benno.lossin@proton.me, alex.gaynor@gmail.com, Jonathan.Cameron@huawei.com Cc: alistair23@gmail.com, wilfred.mallawa@wdc.com, Alistair Francis , Dirk Behme Subject: [PATCH v5 11/11] rust: helpers: Remove uaccess helpers Date: Tue, 7 Jan 2025 13:50:58 +1000 Message-ID: <20250107035058.818539-12-alistair@alistair23.me> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250107035058.818539-1-alistair@alistair23.me> References: <20250107035058.818539-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Now that we support wrap-static-fns we no longer need the custom helper. Signed-off-by: Alistair Francis Tested-by: Dirk Behme --- rust/bindgen_static_functions | 3 +++ rust/helpers/helpers.c | 6 ++---- rust/helpers/uaccess.c | 15 --------------- rust/kernel/uaccess.rs | 5 +++-- 4 files changed, 8 insertions(+), 21 deletions(-) delete mode 100644 rust/helpers/uaccess.c diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index 8bc291a7a799..ec48ad2e8c78 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -27,3 +27,6 @@ --allowlist-function get_task_struct --allowlist-function put_task_struct + +--allowlist-function copy_from_user +--allowlist-function copy_to_user diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 2731ddf736dd..eae067fe2528 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -1,8 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Non-trivial C macros cannot be used in Rust. Similarly, inlined C functions - * cannot be called either. This file explicitly creates functions ("helpers") - * that wrap those so that they can be called from Rust. + * Non-trivial C macros cannot be used in Rust. This file explicitly creates + * functions ("helpers") that wrap those so that they can be called from Rust. * * Sorted alphabetically. */ @@ -21,7 +20,6 @@ #include "slab.c" #include "spinlock.c" #include "task.c" -#include "uaccess.c" #include "vmalloc.c" #include "wait.c" #include "workqueue.c" diff --git a/rust/helpers/uaccess.c b/rust/helpers/uaccess.c deleted file mode 100644 index f49076f813cd..000000000000 --- a/rust/helpers/uaccess.c +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include - -unsigned long rust_helper_copy_from_user(void *to, const void __user *from, - unsigned long n) -{ - return copy_from_user(to, from, n); -} - -unsigned long rust_helper_copy_to_user(void __user *to, const void *from, - unsigned long n) -{ - return copy_to_user(to, from, n); -} diff --git a/rust/kernel/uaccess.rs b/rust/kernel/uaccess.rs index cc044924867b..d8f75de93073 100644 --- a/rust/kernel/uaccess.rs +++ b/rust/kernel/uaccess.rs @@ -226,7 +226,8 @@ pub fn read_raw(&mut self, out: &mut [MaybeUninit]) -> Result { } // SAFETY: `out_ptr` points into a mutable slice of length `len`, so we may write // that many bytes to it. - let res = unsafe { bindings::copy_from_user(out_ptr, self.ptr as *const c_void, len) }; + let res = + unsafe { bindings::copy_from_user(out_ptr, self.ptr as *const c_void, len as u64) }; if res != 0 { return Err(EFAULT); } @@ -330,7 +331,7 @@ pub fn write_slice(&mut self, data: &[u8]) -> Result { } // SAFETY: `data_ptr` points into an immutable slice of length `len`, so we may read // that many bytes from it. - let res = unsafe { bindings::copy_to_user(self.ptr as *mut c_void, data_ptr, len) }; + let res = unsafe { bindings::copy_to_user(self.ptr as *mut c_void, data_ptr, len as u64) }; if res != 0 { return Err(EFAULT); }