From nobody Sat Nov 23 21:02:39 2024 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.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 BC2A718A6A8; Mon, 11 Nov 2024 11:26:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324391; cv=none; b=XJ6v6xYO37uKku6faty//iX9p8o6dQ7Xg6DZvIADVcX3FG4H0tkn6QzpsCg70Chm6oJ+l2I+/xATsMQp/s3mjXz0Uz/zNXbjsY3IuhG4RkEgjaCU914TXyLwshYBtwKbIBiHuA1Q5fuxBO+Zs5/0pnlYSxnQIz90lGAsPz6JMxc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324391; c=relaxed/simple; bh=TEL79ox3fIqCGIkDxbJzv8epE22eE0exixwhXg6WwAk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cwXC2AQkVCbwEX3JaKGuc3pVdxlhUfNCIMTVPonmV/hiDimjBuVZpOikcV6Qw3vQ48JEMHjQCtpl8hXbSm3dIXaT87lxPMXFoA9C2otpqE3mfp3uGERGtdCrhJv/HHshcjmp0yKBTjWhCUR5CdQt2XdNpi6WA+tw1EUGFZwE12M= 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=krv2CcHg; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Rkes+uFs; arc=none smtp.client-ip=103.168.172.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="krv2CcHg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Rkes+uFs" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id ADC40114010A; Mon, 11 Nov 2024 06:26:27 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Mon, 11 Nov 2024 06:26:27 -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=fm3; t=1731324387; x=1731410787; bh=6ansabR635sGWr6JVqI8JQfwDufPlCHV pGLOLU/q+Wk=; b=krv2CcHgs8Gd0DGiaAI1chuLxJXER8PXcqbhMtxl2pjeJsBj UJU0FZ7BxLzQyaiAA/M097eeY+K/322Cz1F40JeHB3qjsfkzVHr4eLRSBbtAjxEa ngeQxo72zLguXCHWrtAVPPVF46cRF1mWfKg3+TCF1dd0uB1kKUzqVLQoGxBkKdLS NivwFR/yva/jt4xruKeb/WKy3KIK2dFHOh9SbuKoQkdKh87DzjegRfbSv6yIBXPV 4E8qpCKQ5+7yY7keQ+dk90AiC0tfMcp8NvDRFE9qxwhawWHPm/r2o9RXwgQgjYso 5QJvFpu+/4C3wwM6RN+jccExqXJ2a7QaBb6kOg== 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=fm3; t=1731324387; x= 1731410787; bh=6ansabR635sGWr6JVqI8JQfwDufPlCHVpGLOLU/q+Wk=; b=R kes+uFsV+YuO36+Um6scknkanQ0jaWnEHkD8FoDLtpNXU3YunWHOjbiEDUGyuiF1 EArXkljbAHglgluzG2doivskLJ7NQqYRTSw/iDDRac64GCJZWWfYoUfC04TWaBVO 9ykZNG/LxDHzbw9g+W4zTxkg+B7Q2kxcVqzlIMXNRyo855XpR4a9v7SLhj3mLRo3 K+ruSDOmNFr868x8Hz4J3Gq84sNqEVx/IO4u722gZTE6bSblFKi6+GMfTEhjxids 5nhY8xaOwlxhl8GxUY8od3HQeZqSFbeI01n84DheFnIQv0qERjVef7u/iUz1YVYr shmbKrt7xZP5PtqPNZwLg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefuff fkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghn tghishcuoegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrth htvghrnhephfetjeejteeileehvdehgeetgeffueetgfetleelgeehjedvgfefvdeukedt gfdunecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhr vdefrdhmvgdpnhgspghrtghpthhtohepudehpdhmohguvgepshhmthhpohhuthdprhgtph htthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgt phhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtghomhdprhgtphhtthhopegrrd hhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepmhgvsehklhhovghn khdruggvvhdprhgtphhtthhopegsvghnnhhordhlohhsshhinhesphhrohhtohhnrdhmvg dprhgtphhtthhopehtmhhgrhhoshhssehumhhitghhrdgvughupdhrtghpthhtoheprghl ihgtvghrhihhlhesghhoohhglhgvrdgtohhmpdhrtghpthhtohepghgrrhihsehgrghrhi hguhhordhnvghtpdhrtghpthhtohepohhjvggurgeskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 06:26:22 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, boqun.feng@gmail.com, a.hindborg@kernel.org, me@kloenk.dev, benno.lossin@proton.me, tmgross@umich.edu, aliceryhl@google.com, gary@garyguo.net, ojeda@kernel.org, rust-for-linux@vger.kernel.org, alex.gaynor@gmail.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 01/11] rust: bindings: Support some inline static functions Date: Mon, 11 Nov 2024 21:26:05 +1000 Message-ID: <20241111112615.179133-2-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111112615.179133-1-alistair@alistair23.me> References: <20241111112615.179133-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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) { retu= rn 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 =3D "crypto_shash_descsize__extern"] pub fn crypto_shash_descsize(tfm: *mut crypto_shash) -> core::ffi::c_ui= nt; } ``` 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 cons= traints" errors (rip_rel_ptr() for example) * functions with bit masks (u32_encode_bits() and friends) result in "call to =E2=80=98__bad_mask=E2=80=99 declared with attribute error: bad= bitfield mask" errors As well as that any static inline function that calls a function that has b= een 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/rus= t/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. =20 -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 si= de 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. =20 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 =20 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 6daaa4dc21db..431edc73e893 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -10,14 +10,17 @@ always-$(CONFIG_RUST) +=3D exports_core_generated.h # for Rust only, thus there is no header nor prototypes. obj-$(CONFIG_RUST) +=3D helpers/helpers.o CFLAGS_REMOVE_helpers/helpers.o =3D -Wmissing-prototypes -Wmissing-declara= tions +CFLAGS_REMOVE_extern.o =3D -Wmissing-prototypes -Wmissing-declarations -Wd= iscarded-qualifiers =20 always-$(CONFIG_RUST) +=3D libmacros.so no-clean-files +=3D libmacros.so =20 -always-$(CONFIG_RUST) +=3D bindings/bindings_generated.rs bindings/binding= s_helpers_generated.rs -obj-$(CONFIG_RUST) +=3D bindings.o kernel.o +always-$(CONFIG_RUST) +=3D bindings/bindings_generated.rs bindings/binding= s_helpers_generated.rs \ + bindings/bindings_generated_static.rs +obj-$(CONFIG_RUST) +=3D bindings.o kernel.o extern.o always-$(CONFIG_RUST) +=3D 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 =20 always-$(CONFIG_RUST) +=3D uapi/uapi_generated.rs obj-$(CONFIG_RUST) +=3D uapi.o @@ -274,6 +277,21 @@ quiet_cmd_bindgen =3D BINDGEN $@ -o $@ -- $(bindgen_c_flags_final) -DMODULE \ $(bindgen_target_cflags) $(bindgen_target_extra) =20 +quiet_cmd_bindgen_static =3D BINDGEN $@ + cmd_bindgen_static =3D \ + $(BINDGEN) $< $(bindgen_target_flags) \ + --use-core --with-derive-default --ctypes-prefix core::ffi --no-layout-t= ests \ + --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|rust/bindings|bindings|g' $@ + $(obj)/bindings/bindings_generated.rs: private bindgen_target_flags =3D \ $(shell grep -Ev '^#|^$$' $(src)/bindgen_parameters) $(obj)/bindings/bindings_generated.rs: private bindgen_target_extra =3D ; \ @@ -282,6 +300,15 @@ $(obj)/bindings/bindings_generated.rs: $(src)/bindings= /bindings_helper.h \ $(src)/bindgen_parameters FORCE $(call if_changed_dep,bindgen) =20 +$(obj)/bindings/bindings_generated_static.rs: private bindgen_target_flags= =3D \ + $(shell grep -Ev '^#|^$$' $(src)/bindgen_parameters) +$(obj)/bindings/bindings_generated_static.rs: private bindgen_static_funct= ions =3D \ + $(shell grep -Ev '^#|^$$' $(src)/bindgen_static_functions) +$(obj)/bindings/bindings_generated_static.rs: $(src)/bindings/bindings_hel= per.h \ + $(src)/bindgen_static_functions \ + $(src)/bindgen_parameters FORCE + $(call if_changed_dep,bindgen_static) + $(obj)/uapi/uapi_generated.rs: private bindgen_target_flags =3D \ $(shell grep -Ev '^#|^$$' $(src)/bindgen_parameters) $(obj)/uapi/uapi_generated.rs: $(src)/uapi/uapi_helper.h \ @@ -325,6 +352,9 @@ $(obj)/exports_helpers_generated.h: $(obj)/helpers/help= ers.o FORCE $(obj)/exports_bindings_generated.h: $(obj)/bindings.o FORCE $(call if_changed,exports) =20 +$(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) =20 @@ -400,6 +430,7 @@ $(obj)/build_error.o: $(src)/build_error.rs $(obj)/comp= iler_builtins.o FORCE $(obj)/bindings.o: $(src)/bindings/lib.rs \ $(obj)/compiler_builtins.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) =20 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 d6da3011281a..c991bcf607ec 100644 --- a/rust/bindings/lib.rs +++ b/rust/bindings/lib.rs @@ -34,6 +34,10 @@ mod bindings_raw { env!("OBJTREE"), "/rust/bindings/bindings_generated.rs" )); + include!(concat!( + env!("OBJTREE"), + "/rust/bindings/bindings_generated_static.rs" + )); } =20 // When both a directly exposed symbol and a helper exists for the same fu= nction, 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" =20 // For modules using `rust/build_error.rs`. --=20 2.47.0 From nobody Sat Nov 23 21:02:39 2024 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 62B7318C00A; Mon, 11 Nov 2024 11:26:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324395; cv=none; b=pT6feSsdcH3efyAstk3Hp/8eP0eN9RBOFsJkRQnV/vH/D6JZ/c1j3WOBs5aSGHExOKbnJJXOTWBGo1LKsgllQNVc9u9cz7GlHKMluFsj7Tf1VZ85QqizoLJB0FTwZCKlmSD959x5bnQtpy6uSUvwbASODBzYoXoTgWpsk87o01U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324395; c=relaxed/simple; bh=wQZFZgq8it/5ClhvvagLCd/QLHwbkRUFQF5cxWEyhns=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=okryGT2oLlSabvsYhUWULH6KIFDKf+0IzneYujnNMAVKkP2vyoH4NEJkZJsJScnPyibYd559X0Ehl6DfDH0rnZsUcHniY0mIfpEaparB2NrNi8wvpDcNXF7XudRG4YdpQD9PP/lyWgUn4rhUUTlElsS+HHiBhkXCJcf0Vbl+h74= 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=M50NHpqO; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=BeYPy6ud; arc=none smtp.client-ip=103.168.172.151 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="M50NHpqO"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="BeYPy6ud" Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.phl.internal (Postfix) with ESMTP id 86C7513805A1; Mon, 11 Nov 2024 06:26:32 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Mon, 11 Nov 2024 06:26:32 -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=fm3; t=1731324392; x= 1731410792; bh=cfBlT8kONCC2xuKO1y00pYcl1lydxefqG+nfeJG8XPU=; b=M 50NHpqOZ6SEo2PQDloR3eZnoOuJEjXn2BU9+vM/dXZ4AmXK6vpT0fk2G9yrOqXn/ hA07+1jO8Z1LyRmFHVUooyZOXE6ZQnmaRWrjfHOUXTiEBKIFDCvI1XNHWJOCF2Wj GPeFjGxSZ0qjQsTdrysZ4kEq5T6LRuebHEepdCPQZJPBcvdI/uVHC1OnQ8fEVzjQ gIhB1RiUp7hJtaRUsEkq35t2hVi3c6sQfQJX7rite+s5+QjbXnMp6fkWxG0ctXKC YN0mlXEv8ZA04kpTwOldf+k0I/VcRX29t47loSyhVaXK4LKu+TvZQFd9EgtFtmPE gR9esZMUYANyuYxy6VJgA== 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=fm3; t=1731324392; x=1731410792; bh=c fBlT8kONCC2xuKO1y00pYcl1lydxefqG+nfeJG8XPU=; b=BeYPy6udAvpAVwNMi Ziv6fCl+qYB+KRVV6/taWkUTTC337lAZ6r7IBkIFf018Nrb8xdClHCbnxSAWr8EQ c/IzC20rSlBUOdcOvdbq3ftWUyxkdLOVRht2VpWh4zNZUhIhuar/YhSlMbJcoQQ7 e2o0nKtI6H7txpbtTQOqIAS3NbwrHX4T2mXZYQhICwTaJyJig8G+Pdpphr9mpp++ lHseXSfBGRURUVGx9ErtzkPF2pLIVLyMqVcjNXak06ViYmx+A/3/6mlFCFxWhq7U 5snNJyBsDkIgZMRGLAaNbEUefWFZi2YOdmHE4B08ebm95fbJnv1k3szsWWZwr1xy +I/Zw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefuff fkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgt ihhsuceorghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtth gvrhhnpeeitdefkeetledvleevveeuueejffeugfeuvdetkeevjeejueetudeftefhgfeh heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlh hishhtrghirhesrghlihhsthgrihhrvdefrdhmvgdpnhgspghrtghpthhtohepudehpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvg hrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghi lhdrtghomhdprhgtphhtthhopegrrdhhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpd hrtghpthhtohepmhgvsehklhhovghnkhdruggvvhdprhgtphhtthhopegsvghnnhhordhl ohhsshhinhesphhrohhtohhnrdhmvgdprhgtphhtthhopehtmhhgrhhoshhssehumhhitg hhrdgvughupdhrtghpthhtoheprghlihgtvghrhihhlhesghhoohhglhgvrdgtohhmpdhr tghpthhtohepghgrrhihsehgrghrhihguhhordhnvghtpdhrtghpthhtohepohhjvggurg eskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 06:26:27 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, boqun.feng@gmail.com, a.hindborg@kernel.org, me@kloenk.dev, benno.lossin@proton.me, tmgross@umich.edu, aliceryhl@google.com, gary@garyguo.net, ojeda@kernel.org, rust-for-linux@vger.kernel.org, alex.gaynor@gmail.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 02/11] rust: helpers: Remove blk helper Date: Mon, 11 Nov 2024 21:26:06 +1000 Message-ID: <20241111112615.179133-3-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111112615.179133-1-alistair@alistair23.me> References: <20241111112615.179133-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 '.*' =20 --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 20a0c69d5cc7..426b0d7f6587 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -7,7 +7,6 @@ * Sorted alphabetically. */ =20 -#include "blk.c" #include "bug.c" #include "build_assert.c" #include "build_bug.c" --=20 2.47.0 From nobody Sat Nov 23 21:02:39 2024 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 48E9A1957FD; Mon, 11 Nov 2024 11:26:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324399; cv=none; b=BR3PPjZy6vrjP/v1AdtjdEe9lC8r3nAwW/A0MFvFTCW53EYs/cmP32KQZPmQ4aUh3wwi0adUSTJV2EWMAnwWUdqbkqFXWakjOYvkm7KcshVNKKlk3BNjcxjgPheuO930alMqNStNCECWZ0vAcad2/xIG/XQVvCD2yIequWHtsUU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324399; c=relaxed/simple; bh=SON/JaleK4TchWRnzi6oNY1AHrpCXsraiEov7uOkBEY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CdSiP1S7INCawSLPUzlFwTCNhy3cLogX+PqOx+1QcXufVEbSoSnUyvpSIm5Od9Sl9X9ey5FKhHfHBNSeVDOghUEMeyHS2zd4dB1P4CaKBYyBtnGfqrYU1tmwGT/nDn4p2ZNnsbZz4v8OsixhL86Zs/XxzBLuEXblCQEglCxGKXI= 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=WfQjU9JN; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=CW0qdJ1z; arc=none smtp.client-ip=103.168.172.151 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="WfQjU9JN"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="CW0qdJ1z" Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id 5789A13805E7; Mon, 11 Nov 2024 06:26:37 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Mon, 11 Nov 2024 06:26: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=fm3; t=1731324397; x= 1731410797; bh=WZkv48fIwhGDB8Z0aFKd/GZqPV/8yRyGz1OEJ6pPV4Y=; b=W fQjU9JNEcKPohFs6GV1Qo8LMBWSNRqBJhWIKX/df28jx2VPGFYWrwngwGasVZ16H 7GQW5sHggo+TCXXAMC/6mUXShv1VObUZH9xj1iHrEfxpg+A3UAM/7vZtS3+9PuP+ 5Jx9AEADI6HQCaLhUdwPyFAnE0dgWUI2gIsH/BWw2mP1KrvWCszU2NK5VOntVqLe zR05rgpKgjFn7jLEa00m9CyeN+6N4oczloOTUqK6fTgIATVTAiu274EEnL57AfrP hYErBck5q1kcZFoXj5RZkBcWNBm05o2X26kP2s1mGkY40b8QtVcblKXQYj4fPTXB pUXDeaUJ/MNaQRnbgn8Kg== 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=fm3; t=1731324397; x=1731410797; bh=W Zkv48fIwhGDB8Z0aFKd/GZqPV/8yRyGz1OEJ6pPV4Y=; b=CW0qdJ1zegEKmDJUt SDWWPeJHXN9ftf2rZ/xL60cw0iMGDWMFNsbEgHRqHWTWXqWBGvtOipbu+QDzQT3n 5M1ZOZtMy3XhqA24oT1KtSlgq+K5fFdJBSDK6rCz3yPBZSc40L56YMmdpQtIW5yb kbKdPhNPOrcYo0YewLuTEZqEJIIaOUmHz5COnJhOT8t6DkPeLHngSTexs5g8/1h7 UHuPwY61qlpGMfNlAFHlTMV1QTg9z7Uq4q1OKMI/wfFQdevZYtUurErTQvQ6q/ii EPJo/FHu/S84HZ4CI+XBlz08D7GVi/Daoc8zX7hvxtz7oD9CJoOhCOUSUy7ZjxaW B6+SQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefuff fkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgt ihhsuceorghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtth gvrhhnpeeitdefkeetledvleevveeuueejffeugfeuvdetkeevjeejueetudeftefhgfeh heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlh hishhtrghirhesrghlihhsthgrihhrvdefrdhmvgdpnhgspghrtghpthhtohepudehpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvg hrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghi lhdrtghomhdprhgtphhtthhopegrrdhhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpd hrtghpthhtohepmhgvsehklhhovghnkhdruggvvhdprhgtphhtthhopegsvghnnhhordhl ohhsshhinhesphhrohhtohhnrdhmvgdprhgtphhtthhopehtmhhgrhhoshhssehumhhitg hhrdgvughupdhrtghpthhtoheprghlihgtvghrhihhlhesghhoohhglhgvrdgtohhmpdhr tghpthhtohepghgrrhihsehgrghrhihguhhordhnvghtpdhrtghpthhtohepohhjvggurg eskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 06:26:32 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, boqun.feng@gmail.com, a.hindborg@kernel.org, me@kloenk.dev, benno.lossin@proton.me, tmgross@umich.edu, aliceryhl@google.com, gary@garyguo.net, ojeda@kernel.org, rust-for-linux@vger.kernel.org, alex.gaynor@gmail.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 03/11] rust: helpers: Remove err helper Date: Mon, 11 Nov 2024 21:26:07 +1000 Message-ID: <20241111112615.179133-4-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111112615.179133-1-alistair@alistair23.me> References: <20241111112615.179133-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 @@ =20 --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 426b0d7f6587..e089ecdf091f 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -10,7 +10,6 @@ #include "bug.c" #include "build_assert.c" #include "build_bug.c" -#include "err.c" #include "kunit.c" #include "mutex.c" #include "page.c" --=20 2.47.0 From nobody Sat Nov 23 21:02:39 2024 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.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 F10CD18A925; Mon, 11 Nov 2024 11:26:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324404; cv=none; b=kwGshAprzv7hrCcNsGDyzF+LqBgqnmqRoNCkyHhonoervoOV7Qtib9bXbWbBSk+tYyneAWOSp+wiuZHuTH3bXIorj6t/3tJMHCEvYpG7UiIX4lVKnRDOmnWEKxn1jrjMQHly6wgXvdfds8ZldFinoAARyyvVfIIJoX/QitI3rJw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324404; c=relaxed/simple; bh=KfYzRBx8hqlpoHlW7Rtc57+XWE2jcubBYr1j8iDL/k4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RKBOp5E/KwoKQZRU/aahyYo5oKbRlpHMRHfEsRkC2Vz5CobAwGbBrUqMJ7kykc4XPvyYc9QfWJ2SbNFOJxGj27L2+9dCu1xgaTLTWDkZmcWe1hqlnpXGabysT26q8n952FNoAGuDILQBclMCTTe9Q8euyvI/PRYTeRKspQWm5rk= 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=bfR/7cJ8; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=FyHK8l00; arc=none smtp.client-ip=103.168.172.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="bfR/7cJ8"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="FyHK8l00" Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 051361140113; Mon, 11 Nov 2024 06:26:42 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Mon, 11 Nov 2024 06:26: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=fm3; t=1731324402; x= 1731410802; bh=REkDqjw7otbgawUP+tllfahw6R9deuAH+VzUmIgzxcw=; b=b fR/7cJ8M1EOUjUUIBxO9cZ964OBzebSDIfvPKQEZ10MB0UiW1H7av2usrcZNU9S9 RSnvL9MpOgI2z+URWnCG9e+hQhh0SaZ2X+KbSiIfEc5PYdlI9kVsfUucr96nzQkP VC1a3N7lUU/AVdBFaMju/gXGMtCUOStGumqeSXOZIF+C/bplSyLg5FfXVNE862z/ jF7KFlEOmcwk+lyOicXuEFWifkXXccIcELDN4+u7Tu51nq302k6LKfGtvcCzHfZZ RSN5N0hCPogaMJbu2e0HTeBzXYJl2MvgE6SJ3mD4VvQ9YEqu2fHK2WyaXgI2XiLW F7tFfsdln59bo4e4e12dA== 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=fm3; t=1731324402; x=1731410802; bh=R EkDqjw7otbgawUP+tllfahw6R9deuAH+VzUmIgzxcw=; b=FyHK8l00ElvWlzBYJ p3ySaajcwzCAZ0TSmrXGLurH0nKf50ai05jPLJG0dpz3WQ3TA5VhC2dkaqDl3rSs AbmVk5S2A/600AGzg6jfv4jwbnXNoFCogDAuI4r+rASBQIl5b4heUTUTAKiQ2OtW ybosJgq1nmLN2AQrWbb57sP+BKB6w5BgRbGqR/cFOvbMDbkGeXCcXKiRMlyNMsr1 zJ/l5Pq95CBdkBm3AmsWVfOMIm+/dG/qRfe9gwFtie3kcxNEohBn3v7FWiw/kmLX 4dRWCFZYlp2Wu31yuz5r/5nL3k3bVKbWadeDJw0MNgiStSVnK+z+9X5v8B6xIn21 Gjc0Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefuff fkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgt ihhsuceorghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtth gvrhhnpeeitdefkeetledvleevveeuueejffeugfeuvdetkeevjeejueetudeftefhgfeh heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlh hishhtrghirhesrghlihhsthgrihhrvdefrdhmvgdpnhgspghrtghpthhtohepudehpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvg hrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghi lhdrtghomhdprhgtphhtthhopegrrdhhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpd hrtghpthhtohepmhgvsehklhhovghnkhdruggvvhdprhgtphhtthhopegsvghnnhhordhl ohhsshhinhesphhrohhtohhnrdhmvgdprhgtphhtthhopehtmhhgrhhoshhssehumhhitg hhrdgvughupdhrtghpthhtoheprghlihgtvghrhihhlhesghhoohhglhgvrdgtohhmpdhr tghpthhtohepghgrrhihsehgrghrhihguhhordhnvghtpdhrtghpthhtohepohhjvggurg eskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 06:26:37 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, boqun.feng@gmail.com, a.hindborg@kernel.org, me@kloenk.dev, benno.lossin@proton.me, tmgross@umich.edu, aliceryhl@google.com, gary@garyguo.net, ojeda@kernel.org, rust-for-linux@vger.kernel.org, alex.gaynor@gmail.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 04/11] rust: helpers: Remove kunit helper Date: Mon, 11 Nov 2024 21:26:08 +1000 Message-ID: <20241111112615.179133-5-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111112615.179133-1-alistair@alistair23.me> References: <20241111112615.179133-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/bindings/bindings_helper.h | 1 + rust/helpers/helpers.c | 1 - rust/helpers/kunit.c | 8 -------- 4 files changed, 3 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/bindings/bindings_helper.h b/rust/bindings/bindings_helpe= r.h index a80783fcbe04..00b1c1c3ab76 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index e089ecdf091f..60b3fdc5c2de 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -10,7 +10,6 @@ #include "bug.c" #include "build_assert.c" #include "build_bug.c" -#include "kunit.c" #include "mutex.c" #include "page.c" #include "rbtree.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(); -} --=20 2.47.0 From nobody Sat Nov 23 21:02:39 2024 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.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 77ACD199E94; Mon, 11 Nov 2024 11:26:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324409; cv=none; b=U/qyYt7GNPmxEb7Kpn/4+ObgbBdOZrkX8Q4oh7JaL/6prTtSfXbeV589JanGW4RrA6wez9yZ6XknStEay0RRxILjl/3/FATPJAmevnsOLvvlKwo2QzN7kRQh7FalKp4VoQdzR/lut3UwekDoErU2BnlR73P0ppJyUH4cSu3SASI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324409; c=relaxed/simple; bh=GMuaS4QDIQEpCiX5szW+r4txCCG8ieqMcikkU2eW4U0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lzKetQJX02T0Bf/InOQIRiIAkkSw3UB+IyAPCXmpgyYQu9VShl575njma6b0JSdmYf5Sp86TvKICnBXO4HpJlbdS+5tsNQA5J7jygml9bKhr8tx/+3u/yq/kNF6wFb1qolDX10hDfQQ4KxTrNVvwVB0VtaSNanIt5FlFkoZRppI= 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=cmthzs6q; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=QlCaaQ3v; arc=none smtp.client-ip=103.168.172.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="cmthzs6q"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="QlCaaQ3v" Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id B1544114011B; Mon, 11 Nov 2024 06:26:46 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Mon, 11 Nov 2024 06:26:46 -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=fm3; t=1731324406; x= 1731410806; bh=/QZTLtT2lWye6dYH5xNL5OIi64neWskoWFOZUezPH64=; b=c mthzs6q6BIiYR/K361aC0qc4OAPnOy/KHfY5d6gIz+ke5zS2YXmHMEl+gj3xdeiX FCt/fbU0pQH9bwfZC1w7IDNYN1KryqPEvXf9I3Re7y5RmAxACNf4ulQWCJoQsm+N jFKp2mkR7cOLhSK666IbMei0j9cGjPQTUBgOlbTPcoperZ5RcIFTmLUkcrOFhu2h 1MyLs1JSce5A1yOpTN60+dM9cyn8mXLTSIQI9Rly2wuZa/Wka0RGAsF4l4/OD6vw vOcYDIm1NJUFydzTkUaX8Tl4S1BMRoL3inNS783/7ZNESLy+SOV43ouNzfJ1oRb1 z3RQtq7LtSirMha/CGARA== 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=fm3; t=1731324406; x=1731410806; bh=/ QZTLtT2lWye6dYH5xNL5OIi64neWskoWFOZUezPH64=; b=QlCaaQ3vMa5E9lkvV Zw8NAcn5KV7XQar0wPNPqXSSyRTdQWhEjHU0QtfZlgCi6Nxm5CwQIWO+synIyZ/U pcTG/8JJZROp80c+T/C8m2NhA6aku9DMCkogBwTyJUnLFSl3F8RUFExRDub6d0GO 41pO20AvhUFwU2zmhvaBf60R9v+pSzvOEGLSzowrkv+uywmcjNijlEsdqo06rgFc IccAWBlj87LiaESS7thVTM2j+QaiJxoBRbhSg/qnYTBwvDCOEEsrbhKqQy57IvJi DKkMh7FO63WphZ+cLD5LZyXex758HuHhuAc/seBJ7ub83kXaPK01TwHfYAjxH+z4 QsXGQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefuff fkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgt ihhsuceorghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtth gvrhhnpeeitdefkeetledvleevveeuueejffeugfeuvdetkeevjeejueetudeftefhgfeh heenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlh hishhtrghirhesrghlihhsthgrihhrvdefrdhmvgdpnhgspghrtghpthhtohepudehpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvg hrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghi lhdrtghomhdprhgtphhtthhopegrrdhhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpd hrtghpthhtohepmhgvsehklhhovghnkhdruggvvhdprhgtphhtthhopegsvghnnhhordhl ohhsshhinhesphhrohhtohhnrdhmvgdprhgtphhtthhopehtmhhgrhhoshhssehumhhitg hhrdgvughupdhrtghpthhtoheprghlihgtvghrhihhlhesghhoohhglhgvrdgtohhmpdhr tghpthhtohepghgrrhihsehgrghrhihguhhordhnvghtpdhrtghpthhtohepohhjvggurg eskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 06:26:42 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, boqun.feng@gmail.com, a.hindborg@kernel.org, me@kloenk.dev, benno.lossin@proton.me, tmgross@umich.edu, aliceryhl@google.com, gary@garyguo.net, ojeda@kernel.org, rust-for-linux@vger.kernel.org, alex.gaynor@gmail.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 05/11] rust: helpers: Remove some page helpers Date: Mon, 11 Nov 2024 21:26:09 +1000 Message-ID: <20241111112615.179133-6-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111112615.179133-1-alistair@alistair23.me> References: <20241111112615.179133-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/bindings/bindings_helper.h | 1 + rust/helpers/page.c | 5 ----- 3 files changed, 3 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 =20 --allowlist-function kunit_get_current_test + +--allowlist-function kmap_local_page diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helpe= r.h index 00b1c1c3ab76..452f8afc9b09 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include 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, unsig= ned int order) return alloc_pages(gfp_mask, order); } =20 -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); --=20 2.47.0 From nobody Sat Nov 23 21:02:39 2024 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.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 46C341885B0; Mon, 11 Nov 2024 11:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324413; cv=none; b=P4Hmux/Oq7EwfXviEFr9FDAOzo9NvUB8MVSZGQ6TbwZgvTbL8B5blPvCTvLxh4Iw0tuczIHGYBwPl+lTxP9ZsaB/Lckz1inSso8TtD7mfShkPdYU5ZT6QjU4S2dRHCiLhViojdiEhrXHxQVfCfqLUPJCW9g6RJ1QWJQRPVHXgbg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324413; c=relaxed/simple; bh=smkbaBTw/7e9dIxKPtuwy0mQ6QjLYCQpxHYDMsCZ7g4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SJZUzVumRWQycNwWaASDMAcGbz6NozNo+hmeUKBUFG/L6mVH7432JvN/xIR517Q226Abg7l09q8jH1tIVLaMqOnbWfmRLfk8rvKYAOqqFaDG8YkInzjqagJB+Mv4WHBY72NJITDd4moCZSzQI8hAE8ybAI3IQmGfOtglNl+6gbU= 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=EOjsD4Nl; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=hlSSU82p; arc=none smtp.client-ip=103.168.172.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="EOjsD4Nl"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="hlSSU82p" Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id 5B33C1140158; Mon, 11 Nov 2024 06:26:51 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Mon, 11 Nov 2024 06:26:51 -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=fm3; t=1731324411; x= 1731410811; bh=d5wQn60NOuuq4X212FSUMcTjiXVPeanrUkv8HB5ANgE=; b=E OjsD4NlVQ+P+LC0jw7DPASHASfiplXiwSLooARW7T+L0ELnnmhw0gnZVKFfG+JP3 dgZhmb/Y+xe5NoEpDjEXEIMBz/rWoPnMrwk1cjRGdK6b6OR21KbhR/DV7g9tG2Kb waKoajgSFRenBqc/D0kctsU4SmctaRw9tZyZ02eCv8FrMiARVnIUKOz9PHitqskH d/K1tYCnC2cj0ILstR7A9WVe8/YBQmaUm5EXrkHTGFJDUsjwUDDfBoffCfTu46S3 rSW1dIWeXAcJ3aYbB7Z//oeMN+CjJeF6ho+mBmbYHkfU++gf4WfIuOlQwqBSA6rv KZLELqsgnkAdYDnYEsBtw== 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=fm3; t=1731324411; x=1731410811; bh=d 5wQn60NOuuq4X212FSUMcTjiXVPeanrUkv8HB5ANgE=; b=hlSSU82pxBe5nMJ8P /tzfNJrBu4/Dr+LFSAW8HxDwMaQlEJlFvCTJ8fycsomlOIZEJXe/Y76ajTcbWvbO EGH0qQ80Fwn0CPqta5wlSMpK71pMLdn7XeeHQ3ViRlKXLFfqK4YMR5DivnAwWVMa 1j1dGClas1NNhR4muwxj0RQwbsDgSD60vlIoOwscJnbGl7SnEjKPJptDgMKL2aj+ IxuGMIpJ+HQ0vHI5NCdewu2dYfLLA3GzmYqI7GXbJTg74X/PySnlJ17aOUPfRNlj t6FU3tIFsQifB6pVQmZY0cu3M9HKlVv10u9KzA0DxC8f1YTh1JsykoCpoh/Y1P22 M+C+g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefuff fkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgt ihhsuceorghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtth gvrhhnpeeitdefkeetledvleevveeuueejffeugfeuvdetkeevjeejueetudeftefhgfeh heenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlh hishhtrghirhesrghlihhsthgrihhrvdefrdhmvgdpnhgspghrtghpthhtohepudehpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvg hrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghi lhdrtghomhdprhgtphhtthhopegrrdhhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpd hrtghpthhtohepmhgvsehklhhovghnkhdruggvvhdprhgtphhtthhopegsvghnnhhordhl ohhsshhinhesphhrohhtohhnrdhmvgdprhgtphhtthhopehtmhhgrhhoshhssehumhhitg hhrdgvughupdhrtghpthhtoheprghlihgtvghrhihhlhesghhoohhglhgvrdgtohhmpdhr tghpthhtohepghgrrhihsehgrghrhihguhhordhnvghtpdhrtghpthhtohepohhjvggurg eskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 06:26:46 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, boqun.feng@gmail.com, a.hindborg@kernel.org, me@kloenk.dev, benno.lossin@proton.me, tmgross@umich.edu, aliceryhl@google.com, gary@garyguo.net, ojeda@kernel.org, rust-for-linux@vger.kernel.org, alex.gaynor@gmail.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 06/11] rust: helpers: Remove rbtree helper Date: Mon, 11 Nov 2024 21:26:10 +1000 Message-ID: <20241111112615.179133-7-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111112615.179133-1-alistair@alistair23.me> References: <20241111112615.179133-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/bindings/bindings_helper.h | 1 + rust/helpers/helpers.c | 1 - rust/helpers/rbtree.c | 9 --------- 4 files changed, 3 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 =20 --allowlist-function kmap_local_page + +--allowlist-function rb_link_node diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helpe= r.h index 452f8afc9b09..d7591b709407 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 60b3fdc5c2de..39adea78a647 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -12,7 +12,6 @@ #include "build_bug.c" #include "mutex.c" #include "page.c" -#include "rbtree.c" #include "refcount.c" #include "signal.c" #include "slab.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); -} --=20 2.47.0 From nobody Sat Nov 23 21:02:39 2024 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 0582218D63E; Mon, 11 Nov 2024 11:26:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324418; cv=none; b=scwePdrGlZiblbukvqBohK90+GVIuS3WfdlTClIRr80/+lCBbyj/tj9p5PO6X3iFS+/mV4CAQk67uOTTmBy8vBwZqCtEfqdJH6ex17o511176sk87/YUH1LPEjokxA/TzAGE2k8pNC98zwobGixiJcxzkspf40l/FTpgHZpeBHY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324418; c=relaxed/simple; bh=58FL7pO/o2ICsLVI9Pf9dWhZeHr7aEJk3ywVQGdXZ58=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TuGI3g8iV8GF2CNnJpHzYNhaIuikTRys03s17apXfr9BA8OCnPNQQHhY+qpF5Yr37rAd+2+OngxWFdSyP8UfgoZBbgWuVeizMYDFEbh4D4T+q3Vu3F1onAJN1GlQ+qznqmnsXglGKN1ySB8O1SWFhIzN1c+C7u8yWc6z3I8uvso= 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=SXU2AQDO; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Xf2FD8aQ; arc=none smtp.client-ip=103.168.172.151 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="SXU2AQDO"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Xf2FD8aQ" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id 2C06913805EE; Mon, 11 Nov 2024 06:26:56 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Mon, 11 Nov 2024 06:26:56 -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=fm3; t=1731324416; x= 1731410816; bh=o0J4L60Sq8xxKMC4EQmqGP3LlG/Y7G9sOLqiDCT9zsk=; b=S XU2AQDOyAQyurw5CWHo5vsPgsySLRC5UWNrZPXWIMxXamItV0jG6IHakTXB3e6XI 4oVs1LprDSyrojTV7h/dH52saZpsHKKG5fMr6yl4vFaDu8dZW/I0C3iv462FQmhR 8pfk0ZfHq6NFW/bgy9FdFL21OApvrnuRQKrxC8IIpPPWd86XN+uAYhTbHiFlxZSy l4lsPl4WplKFe43lpELTOs0PPWnX7Q0nGQLPWtsmAsDqoUMJKZH2lfTq+nVZZ1Tq 0uVL/phWBAPSF2CI3hkgQqVrbadMVIt4pObGsYKRU3i4acwya4QaB86kfSyfRsK6 9BVgBBXt8oUP50tXZ/cgg== 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=fm3; t=1731324416; x=1731410816; bh=o 0J4L60Sq8xxKMC4EQmqGP3LlG/Y7G9sOLqiDCT9zsk=; b=Xf2FD8aQ2Wi2jH61j jMNkMyF+AS7AYI9TM0CP2zQdnmjkBr36YaQmQ+FrRK1CSdGWWsNJJcNDg8Etz4fP SGizApg9K1Z88nAwXbwJ8e3UHZQsnmhufIJptAf2rFP/DQ4K14BV/YwZZu7fvrI+ Abznunan71ygsPId8cM5+0xYB39iRm+enhtYgtjYmJAf7Dp+/BX4sRXQ7aV7hnx8 sNQMfChRTwhbSB9fOtN2VFMTQOSR8OtEf4aHlg6hZk/Y1Jbv6l0SMkkHFyjQ8cRi rNAeOgMikLN6S5dkqlaS8lyWG0bWhiwGv8LQjyP0wE1Yh7/88Jx5un1o3ohMNqmE h1/jw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefuff fkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgt ihhsuceorghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtth gvrhhnpeeitdefkeetledvleevveeuueejffeugfeuvdetkeevjeejueetudeftefhgfeh heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlh hishhtrghirhesrghlihhsthgrihhrvdefrdhmvgdpnhgspghrtghpthhtohepudehpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvg hrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghi lhdrtghomhdprhgtphhtthhopegrrdhhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpd hrtghpthhtohepmhgvsehklhhovghnkhdruggvvhdprhgtphhtthhopegsvghnnhhordhl ohhsshhinhesphhrohhtohhnrdhmvgdprhgtphhtthhopehtmhhgrhhoshhssehumhhitg hhrdgvughupdhrtghpthhtoheprghlihgtvghrhihhlhesghhoohhglhgvrdgtohhmpdhr tghpthhtohepghgrrhihsehgrghrhihguhhordhnvghtpdhrtghpthhtohepohhjvggurg eskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 06:26:51 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, boqun.feng@gmail.com, a.hindborg@kernel.org, me@kloenk.dev, benno.lossin@proton.me, tmgross@umich.edu, aliceryhl@google.com, gary@garyguo.net, ojeda@kernel.org, rust-for-linux@vger.kernel.org, alex.gaynor@gmail.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 07/11] rust: helpers: Remove some refcount helpers Date: Mon, 11 Nov 2024 21:26:11 +1000 Message-ID: <20241111112615.179133-8-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111112615.179133-1-alistair@alistair23.me> References: <20241111112615.179133-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =20 --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); -} --=20 2.47.0 From nobody Sat Nov 23 21:02:39 2024 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.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 C6B5E19C569; Mon, 11 Nov 2024 11:27:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324423; cv=none; b=Ftv7L0//OX6882APmzKLrL25QJPqUx/ZpQ4dbuNRjgI1l2k94xPBkz4LesMv5SsRUy5E+KQHi+gOd1AiEfGH0nlmOGag0aJzthYbLKUMreDpBrdqgpoN7ypWBrHkRO1y79jNBv2JcuJYKpQImr5ImK6ihQ06S/JDreJsBuQizdM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324423; c=relaxed/simple; bh=Y4JvU57X6ir+1mDm/+JX72vbO9dSqe4/Crr+At5SFWM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jETg9lf1hoiT1/gliRjcRPpXQIB1vD3ef8zv7Chima2H2Ezd+xqvz5mJnrMSmAdMG7cgLzzXFKraM8iw+bJAwR7tnjyeyjULG1F7Pag4oR6hFp9l52hVZDG9Q80pCSDoIwPlF5T9SU1lr46ug4tzt8+FdxHuUDM5WZCI0exDG7k= 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=G6iUsE6b; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=QGy2i3Ss; arc=none smtp.client-ip=103.168.172.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="G6iUsE6b"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="QGy2i3Ss" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id E5AA51140168; Mon, 11 Nov 2024 06:27:00 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Mon, 11 Nov 2024 06:27:00 -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=fm3; t=1731324420; x= 1731410820; bh=6UEOUB01K36SAy7a4pudUqlYFbJ+kyQEawJpvVXUrAA=; b=G 6iUsE6bdXWu6lXYl4YgYYvECwWv1EJkrCm5LjRdJJDdkufSK9I5xzaQ6nXUjltQZ 4GqrJhc4a2hJt+HfV26cGiKPM6O14H6UpbkEYBxZGVEWbUgY5NusLFFKDI5Iq8qm cNU62aJE0PMM//jMGYi+mWLbW6ipGw+L9kjyb8ZvP/xU8McxYBVk7WuyIdnAOl+/ 6kn/JtO/GG632VCeFzTb65771rO8hB7QLpr3LQECnc4ITTIJWO+wFnws8nlmDnbc R+BNtSbFUys4GQfKZgUAdjD6Ul8KafLJCPcQeDxbkad5uQYe/xjkcHTCFAicSl8y zV9OAMGu1RijMBiDJtlmg== 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=fm3; t=1731324420; x=1731410820; bh=6 UEOUB01K36SAy7a4pudUqlYFbJ+kyQEawJpvVXUrAA=; b=QGy2i3SsVhrmH8bXF nGX/ilK6ujGCTegBwTr5YWsXTC/LZlTipyuj5Nkg673AYxkrzgV+Jt1FJHzBMVc4 agg4y0NVyK+PPbk+wAh1Jlm+xjQ+LBoLLPUKu0IdX8D1oUwEwIz1Fl6MGIpY2cnj RqMwKs5SRNt2dK9YDDhVawx6j+2OPhsM1liSNVRxIXvTSNrjLpXNqzeA+4mSz7hi PYM6v3VLkqE4BxQd41KYVaYvfBMVXm93/yhKlxWiL5D4FRx3umGQe7jSB/d1GA85 tTy26wHQCSOiH8qoCeAaoLLktTnt3DLQ7CanMO9gdp+4Nfd0qysmpoOXFVAQJqHT lkfgg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefuff fkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgt ihhsuceorghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtth gvrhhnpeeitdefkeetledvleevveeuueejffeugfeuvdetkeevjeejueetudeftefhgfeh heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlh hishhtrghirhesrghlihhsthgrihhrvdefrdhmvgdpnhgspghrtghpthhtohepudehpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvg hrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghi lhdrtghomhdprhgtphhtthhopegrrdhhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpd hrtghpthhtohepmhgvsehklhhovghnkhdruggvvhdprhgtphhtthhopegsvghnnhhordhl ohhsshhinhesphhrohhtohhnrdhmvgdprhgtphhtthhopehtmhhgrhhoshhssehumhhitg hhrdgvughupdhrtghpthhtoheprghlihgtvghrhihhlhesghhoohhglhgvrdgtohhmpdhr tghpthhtohepghgrrhihsehgrghrhihguhhordhnvghtpdhrtghpthhtohepohhjvggurg eskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 06:26:56 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, boqun.feng@gmail.com, a.hindborg@kernel.org, me@kloenk.dev, benno.lossin@proton.me, tmgross@umich.edu, aliceryhl@google.com, gary@garyguo.net, ojeda@kernel.org, rust-for-linux@vger.kernel.org, alex.gaynor@gmail.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 08/11] rust: helpers: Remove signal helper Date: Mon, 11 Nov 2024 21:26:12 +1000 Message-ID: <20241111112615.179133-9-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111112615.179133-1-alistair@alistair23.me> References: <20241111112615.179133-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/bindings/bindings_helper.h | 1 + rust/helpers/helpers.c | 1 - rust/helpers/signal.c | 8 -------- 4 files changed, 3 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 @@ =20 --allowlist-function refcount_inc --allowlist-function refcount_dec_and_test + +--allowlist-function signal_pending diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helpe= r.h index d7591b709407..e21a5f260e3c 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 39adea78a647..ebe3a85c7210 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -13,7 +13,6 @@ #include "mutex.c" #include "page.c" #include "refcount.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); -} --=20 2.47.0 From nobody Sat Nov 23 21:02:39 2024 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.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 85ABB19CC27; Mon, 11 Nov 2024 11:27:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324428; cv=none; b=V5cVWRhyxrVxcLjXYxsr9fuIijkH8ZSul2v7EQ9E0ijtteH4bCU2YJ360xiB5IZGt3u9Xfsikb51PXrkQjbXixWo/gsbpsrzLMTV7HHCb0o33Y2+TfIx6xEGILj9xqavszJlSWXuFeuV2UESl6Cl80X4+sAkf4Iu609CXm6oCfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324428; c=relaxed/simple; bh=Cc9I2bfItF6VORRBhwQ+2yR1z/lvVBWvY0H7rJ+gQUI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qip35CMAn5ZZApLz2RZlORPz5E39rYFAbs2BL4U5O2snvSMhtVYT8VGXQldufMK1QBF6p/5IWVl1bWJPY0sKaGEeXvlC70PtiLiLGqoPT9R0rkp93symZNwOUsNvVlPSiriYk/fLKxm4oUN7uLsxQ5OflklLwqrQ3Q/pEp+st8M= 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=azhy4qns; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=DQglz+yV; arc=none smtp.client-ip=103.168.172.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="azhy4qns"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="DQglz+yV" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id AF5431140151; Mon, 11 Nov 2024 06:27:05 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Mon, 11 Nov 2024 06:27:05 -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=fm3; t=1731324425; x= 1731410825; bh=PxwW2iqkZmOlBEA7liSszqDuU5+i9FamttGbAbW5ZYg=; b=a zhy4qnsEib2MIn/JC2OUMOHYvWV1E6qC7JqS6bJpkz8BqFdqKf6ogpL7jv4JxtqB qj+eJ3JhrfNlGR+X9nAH60GVqT93RePHhUA3xz/731a/J4FuJaqyvHsngk8OGWjp z6p4omewvMCGwpTFWmyty2RxzISl6gz5bCRumCPfpi0bE72inTwx/pY4S3S0njv2 jmXWLen0Xhg5nfOZJlle0aPLcjJUIuJD+AfaBZ/+U/5/KPnD3lFU0VAuHkNwQgSj LCsWmGgRtsMhlAzrbVmYFCbbM5BlPLFe8jKoayoitgY/ha/FmSKrrCVe0qK1TLDl X7qqIErwGLne+ftoz3Cyw== 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=fm3; t=1731324425; x=1731410825; bh=P xwW2iqkZmOlBEA7liSszqDuU5+i9FamttGbAbW5ZYg=; b=DQglz+yVUQ8SAM65P YO+2njeU6nXxxAV0Q8q4gHcd1HNGqfVmpn63IS3SDMp/+89dEmsNZbNAs4iZuvJK hriMp29bERpB1ae/KosCOVfbPBhFcPWX/SsHGYaIv7sE+rbyYLxkkL/d5A1NZbiS gyLOQEVWhrPgIMtmqrSKjsNcNAYWb32EImBKiSjIctpFBXeV/2qsgVqIxvTYWOOo zg1jbbBHyCucSE01+OSU0r5E+bMP4+dYlHq+oIlLhRfIei2znYy4mgg09TXqn5Zi pzUpH+5K6XKylZl7ZxmVhWcLKJeTFdw7+oy00I+uL3S+aOtnoWSQIl/AyweliJHK 118Kg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefuff fkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgt ihhsuceorghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtth gvrhhnpeeitdefkeetledvleevveeuueejffeugfeuvdetkeevjeejueetudeftefhgfeh heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlh hishhtrghirhesrghlihhsthgrihhrvdefrdhmvgdpnhgspghrtghpthhtohepudehpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvg hrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghi lhdrtghomhdprhgtphhtthhopegrrdhhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpd hrtghpthhtohepmhgvsehklhhovghnkhdruggvvhdprhgtphhtthhopegsvghnnhhordhl ohhsshhinhesphhrohhtohhnrdhmvgdprhgtphhtthhopehtmhhgrhhoshhssehumhhitg hhrdgvughupdhrtghpthhtoheprghlihgtvghrhihhlhesghhoohhglhgvrdgtohhmpdhr tghpthhtohepghgrrhihsehgrghrhihguhhordhnvghtpdhrtghpthhtohepohhjvggurg eskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 06:27:01 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, boqun.feng@gmail.com, a.hindborg@kernel.org, me@kloenk.dev, benno.lossin@proton.me, tmgross@umich.edu, aliceryhl@google.com, gary@garyguo.net, ojeda@kernel.org, rust-for-linux@vger.kernel.org, alex.gaynor@gmail.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 09/11] rust: helpers: Remove some spinlock helpers Date: Mon, 11 Nov 2024 21:26:13 +1000 Message-ID: <20241111112615.179133-10-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111112615.179133-1-alistair@alistair23.me> References: <20241111112615.179133-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =20 --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 b7b0945e8b3c..1c47608c42ed 100644 --- a/rust/helpers/spinlock.c +++ b/rust/helpers/spinlock.c @@ -11,18 +11,3 @@ void rust_helper___spin_lock_init(spinlock_t *lock, cons= t char *name, spin_lock_init(lock); #endif } - -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); -} --=20 2.47.0 From nobody Sat Nov 23 21:02:39 2024 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.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 5322319D089; Mon, 11 Nov 2024 11:27:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324432; cv=none; b=coH/p3SO+PZcF8qxi1z7bkuv4eLIar6rmNQ5Rt+VEusdM2aOY2rA3u6eIOm/v0Id89osok8JzYmsXQ2WHauxF/WFhJFz7dE3JcqdhYfnPCmApd1peisvWRq7NQGFYTTtY2BYgOhCVJyq3QCbmFcvuF8G143B0XzBerE9zaG9Qiw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324432; c=relaxed/simple; bh=R65aQHF8S29WYMZTDd0AF6M7wAHphSEKHYPhQqNa1/o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QCnNHAh9RKodZq8yGntSj8cbThdLLtTdkl2cTxskYdA8oJKnBV4Gb/cK95bqR5KWlCO9A+0H/RTcgfLByijHiEcmEVDJSCoEOFsKPpawkUj9TXwDhg3K4VIPn9HvaK7fvFr56JNWiaZsDVeIiwhQDVD3PTKRZz8Cb4XK15Be6nY= 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=QoiWDhaA; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=HM71lfDw; arc=none smtp.client-ip=103.168.172.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="QoiWDhaA"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="HM71lfDw" Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id 727751140169; Mon, 11 Nov 2024 06:27:10 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Mon, 11 Nov 2024 06:27: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=fm3; t=1731324430; x= 1731410830; bh=es18TvJLVSKmeYC1eMKi2tSXwgG+M8AS6GTeeBImdmU=; b=Q oiWDhaAdtTGzatl6CpNNHmfFIxcsU9IBbZIascgnGjgxhmPdK7K+u5Y9aRFmhqc/ EyUHkEM7apkKMWZVNZT7HG7JuId+XMbaEt/dzKLaqga1UDJsQ40Pob/dFzjABpAH ojMHNAHirSSNQMwSe7P6vXWP8PA4eP7dS0uRLBqlK2NmeopXtzhlcWYVi33q6QUb 9FozQn1eyz6YgbFSD14vh5fcM2xbJMmQPaIvUMVvmn1Mk3hcL3Kmnk/HYNjbeB0/ WsdYf4L55mzNRzLTI9Wr3+PhUphYte8LL/UC6SNbSxIAgEMSqj836Nx3WtynNyiQ reqtjPMabRVQ74ZL2gtow== 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=fm3; t=1731324430; x=1731410830; bh=e s18TvJLVSKmeYC1eMKi2tSXwgG+M8AS6GTeeBImdmU=; b=HM71lfDwyyexVwRKq QCSacHn4ImNm3vo7rRTm0RKKifYAIQQjIkija9+M5Ze70QNArX7htZhbiN3TIt2P kxxCo7t5sTVP+nLqDkv/6SvZaqeesnBlulRldoCs/PcORvK7W2GNwrJj/rr3xrwd KveX8+DK5L0q++IetkCQhHpdLHAPLGpQdgNRADIqS6IgmQUUpEUEz0uIi2KYVcVk hfu38b+NKfIvJeSWSMg1miHJuBS9hImoGpXYwb4QEX1kTx++1x46cIddRE+IWUkl 2EEHCIYkYrGrCzJzhicqh7G2RRNtb/Emz58mzKXvk3InYcsKY9WoykhCGOiNhRoF murrQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefuff fkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgt ihhsuceorghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtth gvrhhnpeeitdefkeetledvleevveeuueejffeugfeuvdetkeevjeejueetudeftefhgfeh heenucevlhhushhtvghrufhiiigvpeefnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlh hishhtrghirhesrghlihhsthgrihhrvdefrdhmvgdpnhgspghrtghpthhtohepudehpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvg hrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghi lhdrtghomhdprhgtphhtthhopegrrdhhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpd hrtghpthhtohepmhgvsehklhhovghnkhdruggvvhdprhgtphhtthhopegsvghnnhhordhl ohhsshhinhesphhrohhtohhnrdhmvgdprhgtphhtthhopehtmhhgrhhoshhssehumhhitg hhrdgvughupdhrtghpthhtoheprghlihgtvghrhihhlhesghhoohhglhgvrdgtohhmpdhr tghpthhtohepghgrrhihsehgrghrhihguhhordhnvghtpdhrtghpthhtohepohhjvggurg eskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 06:27:05 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, boqun.feng@gmail.com, a.hindborg@kernel.org, me@kloenk.dev, benno.lossin@proton.me, tmgross@umich.edu, aliceryhl@google.com, gary@garyguo.net, ojeda@kernel.org, rust-for-linux@vger.kernel.org, alex.gaynor@gmail.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 10/11] rust: helpers: Remove some task helpers Date: Mon, 11 Nov 2024 21:26:14 +1000 Message-ID: <20241111112615.179133-11-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111112615.179133-1-alistair@alistair23.me> References: <20241111112615.179133-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/bindings/bindings_helper.h | 1 + rust/helpers/task.c | 10 ---------- 3 files changed, 4 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/bindings/bindings_helper.h b/rust/bindings/bindings_helpe= r.h index e21a5f260e3c..63b78a833303 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/rust/helpers/task.c b/rust/helpers/task.c index 190fdb2c8e2f..788865464134 100644 --- a/rust/helpers/task.c +++ b/rust/helpers/task.c @@ -6,13 +6,3 @@ 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); -} --=20 2.47.0 From nobody Sat Nov 23 21:02:39 2024 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 474FB19D8B4; Mon, 11 Nov 2024 11:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324437; cv=none; b=gLNKX2TcfeJBgLpbsO5zpwsxLwkiks8puvLT4V3xvh9jLnt65JOOV4kbqGdPChqspZKfH+rNSgcVisW6r9Ima9vKmxZ+ghstFZ8xJmEeC83YtcZLmzELcsWP+gx/LeQnbjLQXMB+HMoutn2iwOaeSLSTK3MwCKdNGT5I8nclkeg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324437; c=relaxed/simple; bh=zTGp2tNg+iUcSEL7U57VPmRiKo5PyUGyTr5Wzj3OZss=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gARnDjP1jfPez5O8q5/J4XyiI2aEoKQpA9a9E+SMcs9v43ISHnDb4NFeB81WiiyWhDQocj5tFH/TJNIAW/ptZS6nGZD0tFASrqIQfJ1tLZrYzfJfOF+heY/WlYyXbc+IIc0wUqQv9dIpzefTSPWJBHyWG2Vfkr9aQcxn61TBE5g= 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=ZReCH5hG; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=nKiGXhPs; arc=none smtp.client-ip=103.168.172.151 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="ZReCH5hG"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="nKiGXhPs" Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 48A3E13806A2; Mon, 11 Nov 2024 06:27:15 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Mon, 11 Nov 2024 06:27:15 -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=fm3; t=1731324435; x= 1731410835; bh=9Edqij0qmUbgqLwK4hO3iEBCcscgXfAGElwn+Vgc2xs=; b=Z ReCH5hGqvGAi93bmP6cpjuWqpanszsYw/m7Sa1hyX0UELdKzqqjX/KoIdVPIKzZl 2catNhmsCuxb/hsR7pb2tjDD4Qc1sezaDubmuHYUYpid5YPbav7gziHpuZ2eJZ7e ZTwICaHRcGdqctoVDOh9UhzyIZB4smkK5Hgz4adsA6aTZmc1vBiYCYONRJReCbvB cUJCReH877LQ32yqxSW7JQuMnfAHLjXbSGh4ddx+8/GyftlfyuNs5HpOzkMS/Mw8 jqfYzDXvzPPWg6YjR7JHn4kWXZAMZEKii7wSK8NKMoHOfEyHI61tYaspN0PN9bHX 3VpHoimzhdJ2wheTBBSpg== 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=fm3; t=1731324435; x=1731410835; bh=9 Edqij0qmUbgqLwK4hO3iEBCcscgXfAGElwn+Vgc2xs=; b=nKiGXhPsMfgugeJZ4 OfYdf16mF/Opy6TyMKOPy7TiqnKiFk3ZM5S4hG484fNquwe1CUJl0UxxOUYcPajb b76Oyh95IGpIIVP/EUX+diAKfP7FupkYP7Zf3JQpkeyYNIDlTCEqcIaQkS0r9bwg Jc+i30BpuvnMy1hONPT6tVeSK3dUieDYWuOgR5wQDsu998iUSl6xe6vVZOn8jgjG 4zPLPN/IvukqgcbVXeDjDJ/YgRbTJj/R/40GgevS/cks88PBg9qbZ6lXO26FADcE 3TzeIk8d6SqYUqysebMU2+p3WeCOOIA2dwIDxBsXpvbPiwIZwe6JTx90BbwBEo++ t3PkA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefuff fkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgt ihhsuceorghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtth gvrhhnpeeitdefkeetledvleevveeuueejffeugfeuvdetkeevjeejueetudeftefhgfeh heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlh hishhtrghirhesrghlihhsthgrihhrvdefrdhmvgdpnhgspghrtghpthhtohepudehpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvg hrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghi lhdrtghomhdprhgtphhtthhopegrrdhhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpd hrtghpthhtohepmhgvsehklhhovghnkhdruggvvhdprhgtphhtthhopegsvghnnhhordhl ohhsshhinhesphhrohhtohhnrdhmvgdprhgtphhtthhopehtmhhgrhhoshhssehumhhitg hhrdgvughupdhrtghpthhtoheprghlihgtvghrhihhlhesghhoohhglhgvrdgtohhmpdhr tghpthhtohepghgrrhihsehgrghrhihguhhordhnvghtpdhrtghpthhtohepohhjvggurg eskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 06:27:10 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, boqun.feng@gmail.com, a.hindborg@kernel.org, me@kloenk.dev, benno.lossin@proton.me, tmgross@umich.edu, aliceryhl@google.com, gary@garyguo.net, ojeda@kernel.org, rust-for-linux@vger.kernel.org, alex.gaynor@gmail.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v3 11/11] rust: helpers: Remove uaccess helpers Date: Mon, 11 Nov 2024 21:26:15 +1000 Message-ID: <20241111112615.179133-12-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111112615.179133-1-alistair@alistair23.me> References: <20241111112615.179133-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/bindings/bindings_helper.h | 1 + rust/helpers/helpers.c | 6 ++---- rust/helpers/uaccess.c | 15 --------------- 4 files changed, 6 insertions(+), 19 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 @@ =20 --allowlist-function get_task_struct --allowlist-function put_task_struct + +--allowlist-function copy_from_user +--allowlist-function copy_to_user diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helpe= r.h index 63b78a833303..7847b2b3090b 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include =20 diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index ebe3a85c7210..42c28222f6c2 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 funct= ions - * cannot be called either. This file explicitly creates functions ("helpe= rs") - * that wrap those so that they can be called from Rust. + * Non-trivial C macros cannot be used in Rust. This file explicitly creat= es + * functions ("helpers") that wrap those so that they can be called from R= ust. * * Sorted alphabetically. */ @@ -16,7 +15,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); -} --=20 2.47.0