From nobody Sat Feb 7 07:02:43 2026 Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) (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 7B79B18C0C; Thu, 14 Nov 2024 00:56:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545809; cv=none; b=CuGTw3g5I253Rv42hhnQhLH5+UMEPsjCgAX7uaBgymPZ6yEnARewCKSRjmMPfacXYQU3wpyVYXKzrAMo9kQ5iYiyZJrK+GiTRsZ5CN4q0VgosjfGUtnAip6sGGfupd4lHE+fo/XjDZVt4kmogEMe5tVJpMQzvAw4+/lOD0lUXho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545809; c=relaxed/simple; bh=9C65kBmkAR6cChs2nZ7CihG3j5zRSexZrv6B08Szl3M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jQM6uQHjZECV3dpIlxPvA7SihIxs1rQCUjoo68c161Za0xHC9NYALMk8ydKgmB3CkWBPkKK1n22ZTSjLzy5Hxp3cHzbTKzU6ppCiFA6CskMdGoYBLfRr1k+5P2PR+co3Qq3OPMkYOQ2xxEUdR5gXyOrbB2DZzGSfdQTVY73W4Xo= 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=hvFW+glT; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=dQEGKH9/; arc=none smtp.client-ip=202.12.124.156 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="hvFW+glT"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="dQEGKH9/" Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id 1AC212540043; Wed, 13 Nov 2024 19:56:46 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Wed, 13 Nov 2024 19:56:46 -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=1731545805; x=1731632205; bh=+d8V6Jj0Y/vJREyku853JCQb+9egjMgH l0thuG2QDGs=; b=hvFW+glT03gn+agOd5juZlrNInUo5F+v5GNsZ1mQINwUhVph VM7JMKd1WQiAxnLdbje5bu6ChFzPAdeEdNZGBkulCMMweSgXP9Tf/zUSj1Io5ouW KMrWypQt44cOKotuC+tK4BeAJUZ3E/UqE2ZFQG5tfejhlNKwa6dl+yclNNObpAH6 BYIUM9dcCicfZCRbm+CvAI916tWWis3G0IkUI4N7GA4NAngE7q9QZfkdJk94eBFs ax7WpuJT0jhwdnmRG++tlagLV5L5vZej8w93GcLIlDlOnq2KnrPztEGrLYhU0ACu ggSfBGOaj8NDi9UUJ3ZWfB5s2hjkoNaMpa16zQ== 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=1731545805; x= 1731632205; bh=+d8V6Jj0Y/vJREyku853JCQb+9egjMgHl0thuG2QDGs=; b=d QEGKH9/TFWDFwygVDVIKdWxoqVcVH3W5PS2lIVXHRkYRJi9pEV/GFovEITGmUoNI KZRN3xRBuWPFQ4CMekLXqLM4n7lnTXiALvNNccAbgeAkMb+FWZeQrEgv0FpFhROQ VOdU9/DmjaDcvLgg+ohz2Eak/8iKUiXcsECdMdTsZ2sbLW5Zl0qnDSZ4ZNRQNddq dzuZyNg6DDC9T2p5o4fhNvTuOzrMkUAILLJqcR4vXwzSK7g0J/MUBrUqSuYtwzbT L7aI9cXwgJIFZdFNbjTM0KnwsMf8QpKnlq3jmietfXo2sZPSgf1AY80aWP6s+d2L 12y52Xe47+NrAmRCPe0Ug== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddugddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeen ucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgrihhrsegrlh hishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpefhteejjeetieelhedvheeg teegffeutefgteelleegheejvdfgfedvueektdfgudenucffohhmrghinhepghhithhhuh gsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgvpdhnsggprhgtphhtthhope duiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghl sehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepsggvnhhnohdrlhhoshhsih hnsehprhhothhonhdrmhgvpdhrtghpthhtohepsghoqhhunhdrfhgvnhhgsehgmhgrihhl rdgtohhmpdhrtghpthhtohepmhgvsehklhhovghnkhdruggvvhdprhgtphhtthhopegrlh gvgidrghgrhihnohhrsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprgdrhhhinhgusgho rhhgsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehgrghrhiesghgrrhihghhuohdrnh gvthdprhgtphhtthhopegrlhhitggvrhihhhhlsehgohhoghhlvgdrtghomhdprhgtphht thhopegrlhhishhtrghirhdrfhhrrghntghishesfigutgdrtghomh X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 19:56:40 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, benno.lossin@proton.me, boqun.feng@gmail.com, me@kloenk.dev, alex.gaynor@gmail.com, a.hindborg@kernel.org, gary@garyguo.net, aliceryhl@google.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com, tmgross@umich.edu, rust-for-linux@vger.kernel.org, ojeda@kernel.org Cc: alistair23@gmail.com, Alistair Francis , Dirk Behme Subject: [PATCH v4 01/11] rust: bindings: Support some inline static functions Date: Thu, 14 Nov 2024 10:56:21 +1000 Message-ID: <20241114005631.818440-2-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114005631.818440-1-alistair@alistair23.me> References: <20241114005631.818440-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..2d91160dcc69 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|#include ".*|#include "bindings/bindings_helper.h"|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 Feb 7 07:02:43 2026 Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) (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 D355C11CA9; Thu, 14 Nov 2024 00:56:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545814; cv=none; b=Ca6Q0W12BNbYLw4Fx1O4hMogkdXyC9XE0JUw9eYcQZXZuooEBjUBr5oJFe17e7BNIIK6J8YVkJVFiU8c9GgRjdTVRdxEZjef0MkasTz5oFXnqxaifeBfUrU4BJ858SjAWl3uhq3kNAxR5CjbjBmyayNXBuMvqOnO4xcSS0Rj8zg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545814; c=relaxed/simple; bh=8CTpy5XgifioLxP6Qh2pZMdAV+qTvmOjPzrz8vkW2EM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kD45vIzSL3+uQgylqzg39A4B/ax0gJM8aizFzeztYt4wOIEenS/zyrPiyhYOG98vpsoWme/suFXFdxkByQ6RjAhvKGl9etg4rIdVTvARwBwceH/p0QvGla7Gpgbp9xwqQh8Lm+vk3CNUEzRWWQ1gSoXOZCcFoxJNTXLzLuUwj/k= 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=scOIeuk4; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=btSZIxdp; arc=none smtp.client-ip=202.12.124.156 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="scOIeuk4"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="btSZIxdp" Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id 896B52540213; Wed, 13 Nov 2024 19:56:51 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Wed, 13 Nov 2024 19:56: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=1731545811; x= 1731632211; bh=Qhhi/RnmTfbZ+0bbwtUGV9mixNqBtZzvb7H9GH7C+oQ=; b=s cOIeuk4ZyEu9U0IkS/lb5IY/wLGHZ/tkbAV2HFAD5Xk1cA7jaEGm0FOzcyz7favm KLvvdohQjBIZVCMbrLFU9q4bH8YqzyBkmzOajaCI135mstti0FDdC7VSjkQcy2IU LvHr5t8JJPiiNdIFKD+pSPI+K3zBipEvtGAjYg/CcCjbfK3aM2QxabIFMkBHHWJD z8HI+gFrdOxlOzY3bb6KA35imq7VHAmpLPpdN+KcEhSUrP1kbnUweQj63ogGEi3q fTrvw4AuYe4lj8WUMnOGG1DR3tjRiavjlD5M17L291gJDfGivvI0bNKVah3WFhY+ HAmKYYwFuoxTIhIpTmUeQ== 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=1731545811; x=1731632211; bh=Q hhi/RnmTfbZ+0bbwtUGV9mixNqBtZzvb7H9GH7C+oQ=; b=btSZIxdpCgm7NAB5k h+Kd1E9Ngh28dDbc7YBJ+thp5oMS2s1Gci3IUvQmuEaDuoyDsKYJp/cynPAPiDUK geNQvI3AZFFRHRInxqL+0fhnmghuy9v8FVlG7SgqWnNzG+UTSSqKzE8sQtg76R+D NniE60/2+2Afz8tCXrdoWY0q50/MdYCcYdgI+wXwpMpppvPGAYj9+jdR4pOPrtUF KPHnVuW7HcAWA8LsWD9AhnFxA4TnvCrGBZ3hgXWJicFT+VyG8z/bCx1/m+nYmM2O 53OIBIt21V39/86JJAGIFZaggijq3lxfU0QQsY8+RzIzUlmYHOYW8fZTHvtRB9aD Cd/UA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddugddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecu hfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepiedtfeekteelvdelveevueeu jeffuefguedvteekveejjeeutedufeethffgheehnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdv fedrmhgvpdhnsggprhgtphhtthhopeduiedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghp thhtohepsggvnhhnohdrlhhoshhsihhnsehprhhothhonhdrmhgvpdhrtghpthhtohepsg hoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgvsehklhhovghn khdruggvvhdprhgtphhtthhopegrlhgvgidrghgrhihnohhrsehgmhgrihhlrdgtohhmpd hrtghpthhtoheprgdrhhhinhgusghorhhgsehkvghrnhgvlhdrohhrghdprhgtphhtthho pehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopegrlhhitggvrhihhhhlse hgohhoghhlvgdrtghomhdprhgtphhtthhopegrlhhishhtrghirhdrfhhrrghntghishes figutgdrtghomh X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 19:56:46 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, benno.lossin@proton.me, boqun.feng@gmail.com, me@kloenk.dev, alex.gaynor@gmail.com, a.hindborg@kernel.org, gary@garyguo.net, aliceryhl@google.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com, tmgross@umich.edu, rust-for-linux@vger.kernel.org, ojeda@kernel.org Cc: alistair23@gmail.com, Alistair Francis , Dirk Behme Subject: [PATCH v4 02/11] rust: helpers: Remove blk helper Date: Thu, 14 Nov 2024 10:56:22 +1000 Message-ID: <20241114005631.818440-3-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114005631.818440-1-alistair@alistair23.me> References: <20241114005631.818440-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 Feb 7 07:02:43 2026 Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) (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 518C72C859; Thu, 14 Nov 2024 00:56:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545819; cv=none; b=J7H7JOsqQXmVMyWW5C6YiVwA5eVVfGczboG1EyimKyCTFHK+JVNQ5ZVV3/WjN1OH9RiND/rbuXiimFU0Yt9pvGG5hiYAhISMDgaReYojQtUTIDBl02UvtZD7/1qEz6phxJYXFayfjXujlpmdRDnMm/6mxVgY/GRt58wqSiplSXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545819; c=relaxed/simple; bh=1q5Ejy87bZRBBVhsdPth3lT1FM3HlR4ejX4eZkdUDyo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RNEC0TMQ5NIWamT9YFM1lSlSKBro848ctGdzdSZ/hBT5WvUZxRMvIz2utWbQ0J5BjDKkLWtMkPSi3Vx3Ns182hbp1X/1tKmVm27txhijQBfnXKk53Gg95QiBYa6GdjNisRWyB3gk5OoaLwLYurUiOxOGKZymhOXxfbptDhPucqA= 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=D9zH3p4S; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=I/X5st5Z; arc=none smtp.client-ip=202.12.124.156 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="D9zH3p4S"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="I/X5st5Z" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 1B6FF254022D; Wed, 13 Nov 2024 19:56:57 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 13 Nov 2024 19:56:57 -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=1731545816; x= 1731632216; bh=tZ8pFmHsuq6U6oemTG4oDG/xxrwAvllajiVqaE2wCNU=; b=D 9zH3p4SOlWRJY7/077oZPjojy8NYh3WqtUWzxYcdj0W5o+P50L/16seBcUbRhcD8 baYIfXmI0weL4w5eGO/psikBE7umjsPnNdPO+b3t4Lrd5NmOysyqhD8RTQQetdkp QJj//hzlj1QjYtiEVa0qvoCsZTB8vpe8JNioGM3SjNe0VShB8xmKQRULN7fS4PPe 3KmVarmloUQNILM72A0Cxx2R6VwWuKt+rj442yLYqOqnoR0au5kOFhPHpL6cMuuJ faKmZZFwTLfKmN5cpsd/S1ARO8b623aa1VB155DYq5qCowS3dCusZcDRqMQ9GSMy v7QcbXv0ik0KueFDXRYqg== 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=1731545816; x=1731632216; bh=t Z8pFmHsuq6U6oemTG4oDG/xxrwAvllajiVqaE2wCNU=; b=I/X5st5ZPwv5W6z5j 4YdWtAEkEvMGt1C9QoSqVFGjewAH9x5TJGyg+K2Yiht4m9umhQgGs26CdY3CSSwk Ed/xaUMvn+2+2WO8PNMZIUMZ4FyjUoEK81oJPcnroiBFWmlt3ahPuAr9FrECw93v nCkIyEIgKbjfImK8EhEyxrt5nZOiwlv0aubDzWW56E5zeGVxDV6nbxw+RMScu6Yk 6KOBfldP5UyU7Jjwjeb33qySH3jJhs5RQIOb6MTLolSWRoMm5Y0PvJzQ3Fmlp7u6 TrZE9OrXDjamzyaRmVpnC+VWuIT7JXaRKGN6N2bz81Py8dp3XZPtj2yFtCqonSCB s5MWA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddugddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecu hfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepiedtfeekteelvdelveevueeu jeffuefguedvteekveejjeeutedufeethffgheehnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdv fedrmhgvpdhnsggprhgtphhtthhopeduiedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghp thhtohepsggvnhhnohdrlhhoshhsihhnsehprhhothhonhdrmhgvpdhrtghpthhtohepsg hoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgvsehklhhovghn khdruggvvhdprhgtphhtthhopegrlhgvgidrghgrhihnohhrsehgmhgrihhlrdgtohhmpd hrtghpthhtoheprgdrhhhinhgusghorhhgsehkvghrnhgvlhdrohhrghdprhgtphhtthho pehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopegrlhhitggvrhihhhhlse hgohhoghhlvgdrtghomhdprhgtphhtthhopegrlhhishhtrghirhdrfhhrrghntghishes figutgdrtghomh X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 19:56:52 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, benno.lossin@proton.me, boqun.feng@gmail.com, me@kloenk.dev, alex.gaynor@gmail.com, a.hindborg@kernel.org, gary@garyguo.net, aliceryhl@google.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com, tmgross@umich.edu, rust-for-linux@vger.kernel.org, ojeda@kernel.org Cc: alistair23@gmail.com, Alistair Francis , Dirk Behme Subject: [PATCH v4 03/11] rust: helpers: Remove err helper Date: Thu, 14 Nov 2024 10:56:23 +1000 Message-ID: <20241114005631.818440-4-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114005631.818440-1-alistair@alistair23.me> References: <20241114005631.818440-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 Feb 7 07:02:43 2026 Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) (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 C03103BB48; Thu, 14 Nov 2024 00:57:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545825; cv=none; b=T80hyNuS31KC5bOyWvhFAi95BNExtc0FrrHOyg7HGwoirZfDoHSb00kt5D2daGPaF0YJJoMJk2u5YnpEFnhlW8MiztyH5IX+5clgVHykQV+N71oEJdDWrICn8rVwm8I/XsQ35/TtqdYvFnfDMzRsRk0bwghzA7oX5stEBiUjnRY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545825; c=relaxed/simple; bh=52dEVd6ieui/hgDILxz6PiV9KN4P39vTK1VY9+/EgTQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UOOZWxtQ1JAtEwERjSgQ5bvPd0AMTq7OJsNkXr/PzROMD+A0UFtEbta7XglUFLHkN8+KzCR8sTfFGJZe/Yjwg+tFvqg1DouzinaZap5fGjcij4fObnNJ5c656pxp3t8b3byQKv1Lyc4X3+auamrIMBg2MkvCO1obWBE5X0ZNDMM= 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=zqyDSvp1; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=EmPyIP5o; arc=none smtp.client-ip=202.12.124.156 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="zqyDSvp1"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="EmPyIP5o" Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id AE4EC2540245; Wed, 13 Nov 2024 19:57:02 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Wed, 13 Nov 2024 19:57:03 -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=1731545822; x= 1731632222; bh=I6BKnKD2q7G5Z5xhABHswk5DPT3rlGXx+hkakcGtDYY=; b=z qyDSvp1gxjMXkd64weBqpSS98h7elYOeirEjvbCzTjgMMb3Cit+GZ6nMzuISbJQW skRoYqTwAFTxp8/tmliUDbXPLKylcyqpDPbdQCHIJIUdxNXnp0ZBDFus13Pwc+UY BI795WE8Li9ZjTg2ETjq9XYcMbQ2beFuERz71L5Zr8YOSpt098q1MuDVMWiiyxm6 P2GdDLsGfVN0aNvaG6XXGcmdH6VciX2mKnMXlPfaH/dafsnHLb7zX8R2LGmLELp2 M60cKD9G50ZoQSZMzB+SZji8wyjItlnXg3h4iiH8poMjeogwq92SFJArtEOhFs1D s01Ac1ggdJ8voGFzUXvWg== 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=1731545822; x=1731632222; bh=I 6BKnKD2q7G5Z5xhABHswk5DPT3rlGXx+hkakcGtDYY=; b=EmPyIP5oYLsKuaXTz 5MaiZIJBAD99n/iNJjltTuPCJgvGMeStUvQb9IZnr7JjfANs2mgB3KQeESTggbG/ YB400xkG0ypib4Fas/iLfNqutHndOQZ9F4eFOqNgLa58PuILwnwzeAM4pcD+5doN hcsNoCBlA2GJoG1f68PX6AmxQqFAkgJ2Ab/pyLZc3AsC9DPF0PyX9SDcaeOUao0S x+jPyNjpszWNC7zy9FqYJYOXusu6m0dJyn/TZDLGtgUyLTKeMNV0Xgt9T+8z2oeE hObC2Cd0BCTBpLdnDEQPOjhluARxW/apL8ptJYKYg8Xz8C76sSqfzZ2Efn1C5w+y OpoEw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddugddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecu hfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepiedtfeekteelvdelveevueeu jeffuefguedvteekveejjeeutedufeethffgheehnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdv fedrmhgvpdhnsggprhgtphhtthhopeduiedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghp thhtohepsggvnhhnohdrlhhoshhsihhnsehprhhothhonhdrmhgvpdhrtghpthhtohepsg hoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgvsehklhhovghn khdruggvvhdprhgtphhtthhopegrlhgvgidrghgrhihnohhrsehgmhgrihhlrdgtohhmpd hrtghpthhtoheprgdrhhhinhgusghorhhgsehkvghrnhgvlhdrohhrghdprhgtphhtthho pehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopegrlhhitggvrhihhhhlse hgohhoghhlvgdrtghomhdprhgtphhtthhopegrlhhishhtrghirhdrfhhrrghntghishes figutgdrtghomh X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 19:56:57 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, benno.lossin@proton.me, boqun.feng@gmail.com, me@kloenk.dev, alex.gaynor@gmail.com, a.hindborg@kernel.org, gary@garyguo.net, aliceryhl@google.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com, tmgross@umich.edu, rust-for-linux@vger.kernel.org, ojeda@kernel.org Cc: alistair23@gmail.com, Alistair Francis , Dirk Behme Subject: [PATCH v4 04/11] rust: helpers: Remove kunit helper Date: Thu, 14 Nov 2024 10:56:24 +1000 Message-ID: <20241114005631.818440-5-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114005631.818440-1-alistair@alistair23.me> References: <20241114005631.818440-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 Feb 7 07:02:43 2026 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (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 7826C42AB1; Thu, 14 Nov 2024 00:57:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545831; cv=none; b=hLYwrPvohuRDwEBSJW0CH5Vlv1i7BpTkCR3Ua0Ii336aaVowMUUAscNRCguhjg0RzwxSllxQiXyYK4xlrWIoJ1y4f8X1ObxwhGbGvcC1Xl3VLdVfbeIMwwCtbOCn9FUeS8vCFVwcuc4Bz+cX605PtZMlyYluT5j6BkXeNuXziNI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545831; c=relaxed/simple; bh=vHXnakfFjhg1fCzLWGE2sHwz/+s+gpfJaYfgMui8rJg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g5TIJzZwGN8m8lo9ichEnnEjNWrUwRnZTTaU8Vq4NgIBzc/jMfPvhhZMIWaI08nvi8oDDIM+hptzfLXI/7Z/i5R4f71u63H8n7S2QuOBNaxemta0loBDdDIrR6qs+XxIOkEpgNexkkFTsfyJU5tLDYNfVqIrXzdXo/rEg2B4/Yc= 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=sLixs6T0; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=dEJs6JZQ; arc=none smtp.client-ip=202.12.124.146 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="sLixs6T0"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="dEJs6JZQ" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id 25AE5114020F; Wed, 13 Nov 2024 19:57:08 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Wed, 13 Nov 2024 19:57:08 -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=1731545828; x= 1731632228; bh=uWdpOcemEhndhcjPj0JJ7aMk2JcquAOu04zIrIsFvmU=; b=s Lixs6T0EA9s3c0axe1hjKTic9w6B0rQDIsEcCXO6v0pKAiSXtvX3DyouRGtaGAI6 DgDKbPf0oJkNBjHP47d/jGU2saB8+Q3zgzY1I3V0Yp3dau3FZPBbr+XW7femSJ+x WPGgAo2KLx7h1RxKCCoUMj36qLOCmnOf3/Oidby9zrIk36Z2SzRMbgV2VwPcKXFH j7BMGppF2fx4VcREqQhpYtXVnmCG9+FQYAtLtjfFZasOF8IjTyzqvqw+iodZ0QbL Rm201KKxyod/Ue4xkrRbdk7ve8RhiUsrdAgbKpuNj44w95zq05qad2Sq4DOEBjfn Ni+o+K32IzJ9UG1bR4dag== 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=1731545828; x=1731632228; bh=u WdpOcemEhndhcjPj0JJ7aMk2JcquAOu04zIrIsFvmU=; b=dEJs6JZQfi+bVZe2a vEkszUebhoOEg6a9c8EZ2WLJb58SBoAnmoXoqJfLRiRhLbflBsiQ844vUZ8iH21Z o/6Ypr9DUdpvI9E8e7T/74yLetchVUSqsbWGDDe4cM4w1QMlZLoXF9JaPfXG3XBh KDywaHggT0YrBt0DwSgWDM6H8irPMHSFt1yh1iaewTfJMot1DK5zXf5Of38Eauad pBgAQl528bm+UEh2FdlqGifpFskyuxt+GINhm5VEq+OaAb81RUYSpB1gwXHyQzWn GcUG0j75OE3Xd9NHMBqwafUWsNxfSOyI//RPuOWFyhWUPX2ENU6S61Z9M+b+rJbg mG5eA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddugddvjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecu hfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepiedtfeekteelvdelveevueeu jeffuefguedvteekveejjeeutedufeethffgheehnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdv fedrmhgvpdhnsggprhgtphhtthhopeduiedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghp thhtohepsggvnhhnohdrlhhoshhsihhnsehprhhothhonhdrmhgvpdhrtghpthhtohepsg hoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgvsehklhhovghn khdruggvvhdprhgtphhtthhopegrlhgvgidrghgrhihnohhrsehgmhgrihhlrdgtohhmpd hrtghpthhtoheprgdrhhhinhgusghorhhgsehkvghrnhgvlhdrohhrghdprhgtphhtthho pehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopegrlhhitggvrhihhhhlse hgohhoghhlvgdrtghomhdprhgtphhtthhopegrlhhishhtrghirhdrfhhrrghntghishes figutgdrtghomh X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 19:57:03 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, benno.lossin@proton.me, boqun.feng@gmail.com, me@kloenk.dev, alex.gaynor@gmail.com, a.hindborg@kernel.org, gary@garyguo.net, aliceryhl@google.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com, tmgross@umich.edu, rust-for-linux@vger.kernel.org, ojeda@kernel.org Cc: alistair23@gmail.com, Alistair Francis , Dirk Behme Subject: [PATCH v4 05/11] rust: helpers: Remove some page helpers Date: Thu, 14 Nov 2024 10:56:25 +1000 Message-ID: <20241114005631.818440-6-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114005631.818440-1-alistair@alistair23.me> References: <20241114005631.818440-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 Feb 7 07:02:43 2026 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (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 05F0F4CB47; Thu, 14 Nov 2024 00:57:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545836; cv=none; b=tpGQFlfrfEaH2JcPBb+b9hJ/F1yinJzqy7WHRPecHpAzB51KpjVLvmaTApLkgeapH5nN1f9ZqHvlyEMLbJVjYPYZ13Gw8m1mOdAr44CRK7nzJkWvGtwXCwWRlUtC45OCaKqxiFdUdoQtinbVKCsDQuA224BK6fUidlRPyamV9L8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545836; c=relaxed/simple; bh=b3G7TYn/khqwTZ5Rwoif9OCtQVXwntJH0+P/NfRT6Pc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MGtQAJkmmpcZFaUGcw7zO2+7ndIIxk0cO3tl85Egt+ugqGTImHSw0a6KwynnIrHfCJl2C2U6H92iAmCQmE/NFx9Z9XBKqdlKV7dlmcUdUjyRbTbdldn7QwGEiyjF1KAOWl+zPA9/db5jZmZMB8D2wPSMu9KANIpAFWrPVs6gsUM= 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=jJTjMRxi; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=CDr6NiL4; arc=none smtp.client-ip=202.12.124.146 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="jJTjMRxi"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="CDr6NiL4" Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfout.stl.internal (Postfix) with ESMTP id B84311140215; Wed, 13 Nov 2024 19:57:13 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Wed, 13 Nov 2024 19:57:14 -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=1731545833; x= 1731632233; bh=6nKfsGoXPcHA69T26BhjzU2l4D/x3cxlhbzWSMf5qAE=; b=j JTjMRxiPuzcgDORTao5nr8XgSWwfMSqHPwmvvlrn0C9d5KOiVAIjVvmgUZnoLYNm vuh7j5o61uypgDQAe0zzDoynfPGaJ5hd7VmAWxZi+ZmBQ2fEg8X0uDkyBS039GGh 5XMTxOQgISnsPjqDvAm2QC7bIAEwgjKTbMSQeOguqH3lEwu+g2ipkVPo5/XvvxD8 FTKdwIXElX7Z8VqkzF4SnBvnBEj0knlh4v9vk/NEQjsHDVlp7pfUHpqnZCco+gb0 CT3m7wtlGxjCh9R/Zaf2ok+XisiEjKUG/HwQ6fvWNdbct9uY3OLzD2ihJ3YQj1Jq 0g41jZsoktjwE3LCbnMtg== 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=1731545833; x=1731632233; bh=6 nKfsGoXPcHA69T26BhjzU2l4D/x3cxlhbzWSMf5qAE=; b=CDr6NiL46muwkBYqJ ldi2JMTdR0c6fccuUeVlIbqwLjaxtVbc+yjz/xE3jHIshTXuk14boLWbFaeCLvJd ynq8UnKvS51+9YJvFV0r/U0mxYbifpWhg6evSlwKjQJ8ZukLB7m5x2xi45lmX/Oh qtmMD5L2/xra6abD9xaocGUXAXf37I/+JOkxM2BFL0cvYArjk1/SxCHjVVmPjaoM 2ILO8wwJHxheykBS39e5kW8+sZpzfMOnso/iATULqUJ473xWZ7/eM8pqZGLTGDKB GW4FL9UaNrsGyy0nq/aR4QsybMwjvNC3hNZFKZnxyVDv75wEbItLsYGCCiZLXaD4 uhHlg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddugddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecu hfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepiedtfeekteelvdelveevueeu jeffuefguedvteekveejjeeutedufeethffgheehnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdv fedrmhgvpdhnsggprhgtphhtthhopeduiedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghp thhtohepsggvnhhnohdrlhhoshhsihhnsehprhhothhonhdrmhgvpdhrtghpthhtohepsg hoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgvsehklhhovghn khdruggvvhdprhgtphhtthhopegrlhgvgidrghgrhihnohhrsehgmhgrihhlrdgtohhmpd hrtghpthhtoheprgdrhhhinhgusghorhhgsehkvghrnhgvlhdrohhrghdprhgtphhtthho pehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopegrlhhitggvrhihhhhlse hgohhoghhlvgdrtghomhdprhgtphhtthhopegrlhhishhtrghirhdrfhhrrghntghishes figutgdrtghomh X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 19:57:08 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, benno.lossin@proton.me, boqun.feng@gmail.com, me@kloenk.dev, alex.gaynor@gmail.com, a.hindborg@kernel.org, gary@garyguo.net, aliceryhl@google.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com, tmgross@umich.edu, rust-for-linux@vger.kernel.org, ojeda@kernel.org Cc: alistair23@gmail.com, Alistair Francis , Dirk Behme Subject: [PATCH v4 06/11] rust: helpers: Remove rbtree helper Date: Thu, 14 Nov 2024 10:56:26 +1000 Message-ID: <20241114005631.818440-7-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114005631.818440-1-alistair@alistair23.me> References: <20241114005631.818440-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 Feb 7 07:02:43 2026 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (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 AAF296F2F3; Thu, 14 Nov 2024 00:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545843; cv=none; b=c3srrOFkyDwf7vKnm0z0Xp5RZA1PwH49j+TOwxW/66G9UeMQCxh8M+QYbhX7rtWzOTViWIYJMHH0La5NE+VzLJvqaMAFwbHqfncNe7XT9ks5liEZW1dMXSRgC3CK9lKi1hQStk8NJXgjAwNaFQitC33uZXq8aTX4cYew5bHy/Sw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545843; c=relaxed/simple; bh=9u/Y9xRFEB9gelgdOptWLSVcjsjDsrc48AYyYZp4ReM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VbLBfS62hoJovx5jHsGFotIx9eb551y9yESU01BZkGcsl4oiEbATV2r+wQXsNNvOX0jdd/8LQYoWpuBqzyybJIkc4bI9sMJd4MNwpin3C84zn1Ko1Z1qO41SgNrq+iOY5+0an71wpa5jZisafpq0zuACLGSYq2p2+W4XHJ3JqAM= 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=I3PrvCUh; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=QnlzPPsO; arc=none smtp.client-ip=202.12.124.146 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="I3PrvCUh"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="QnlzPPsO" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.stl.internal (Postfix) with ESMTP id 66BE1114021A; Wed, 13 Nov 2024 19:57:19 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Wed, 13 Nov 2024 19:57:19 -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=1731545839; x= 1731632239; bh=mOGJ14rZcyKsHL1uCIepHrlEZTpF9vGzxYwzQBdCEVE=; b=I 3PrvCUh+1JMtdF9n1350cEH6L6rLSXMlXdudEmuESGEecIcmsvd7Nr5RXa45r2NL Grpawiy/83kFdu0tHNDAm1q26df66Qgne3Nt/DNDJd1UcSUq5O1HncMKPEADQONB ksSA96SWeAgIqeBCYgXkV+rrNPWO2LNc+3X7KKy3Y9cP35BfCzhP8dj2zBvQUytm S1Qoc6z8O+eEZUygHppdD9bL6ZM336M4+oej061q7JXp9/LIH5I+YhaBhJ9thUZK nMmzeWkGyxCSD4NYV3DvEmlhdXZyXn+ZJgVagFsElhQBs+1ePEYeMYRVciKmZdIX L4kvSCWlBtLMITsQ6nalw== 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=1731545839; x=1731632239; bh=m OGJ14rZcyKsHL1uCIepHrlEZTpF9vGzxYwzQBdCEVE=; b=QnlzPPsO6s4m1cwMR Zh0EmUpFtGwAPOaqyiaGdPt1Y8YhNuT/Bl5pvXTBmgOcXpk7KAnGDlzMAVhzSo2/ CcpHgfCmFRykuvNw2Tk44h43HXr2zzyUJfNAUZwF+mR/xgE9y4laEMPCHnJkV5RD o1fUxYkEksUaom1POCm6aLL/CiOSG6SaAVTWuDComt3ro+e0e5cuf2T2p7ijj/Rh vTx6BCFUq0GV1qopY/fRlen7csvVEQxzU8V22Gtjidww/A1rWPgvFW3+19XL2t6q IJGmDDoa+jI8SYaA/vn/g4Rg75VAsnVyyOAQvNuCM3b6sJj8E2ya1+aTc2St9NKT CPhwQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddugddvjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecu hfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepiedtfeekteelvdelveevueeu jeffuefguedvteekveejjeeutedufeethffgheehnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdv fedrmhgvpdhnsggprhgtphhtthhopeduiedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghp thhtohepsggvnhhnohdrlhhoshhsihhnsehprhhothhonhdrmhgvpdhrtghpthhtohepsg hoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgvsehklhhovghn khdruggvvhdprhgtphhtthhopegrlhgvgidrghgrhihnohhrsehgmhgrihhlrdgtohhmpd hrtghpthhtoheprgdrhhhinhgusghorhhgsehkvghrnhgvlhdrohhrghdprhgtphhtthho pehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopegrlhhitggvrhihhhhlse hgohhoghhlvgdrtghomhdprhgtphhtthhopegrlhhishhtrghirhdrfhhrrghntghishes figutgdrtghomh X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 19:57:14 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, benno.lossin@proton.me, boqun.feng@gmail.com, me@kloenk.dev, alex.gaynor@gmail.com, a.hindborg@kernel.org, gary@garyguo.net, aliceryhl@google.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com, tmgross@umich.edu, rust-for-linux@vger.kernel.org, ojeda@kernel.org Cc: alistair23@gmail.com, Alistair Francis , Dirk Behme Subject: [PATCH v4 07/11] rust: helpers: Remove some refcount helpers Date: Thu, 14 Nov 2024 10:56:27 +1000 Message-ID: <20241114005631.818440-8-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114005631.818440-1-alistair@alistair23.me> References: <20241114005631.818440-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 Feb 7 07:02:43 2026 Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) (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 3BC477DA79; Thu, 14 Nov 2024 00:57:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545849; cv=none; b=oYVR/bT1/95tmXEMmSlhrJa630DQZ8vrPGSekIE6w4uUTKj6vNxY0yuzzfQHmQPTRTfUPjElIoSfGffVRXPgBazC0YLc9zIUzveeisFMfv3PQyXE6LQe7AG5SjMR7P6/zdFRqOmDv+MmuUGP+TzyJTeOpP9XKnmwvIxkte77WEU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545849; c=relaxed/simple; bh=3diFOj1WNc/IGD6l2UVGdqRdSALufTmvPUB1jtkB4SA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ga9sGlJD1n7jTegm5DNaWgRsmPwy+jXsPcE7I/WQj4Y/MjyzpVEw3XHlo5kDgEgREMtAUEeQzP3eeJtM63szlT9DoOT38mIZT+OU7yZCth8v2rFD4tiZxX8wVPAKYp5saf0KXIj7puWbYTzv0Z90ZLo6s5uy8nnYe3v8wYAkdnQ= 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=rP7AMQn+; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=h+0f4Q+0; arc=none smtp.client-ip=202.12.124.156 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="rP7AMQn+"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="h+0f4Q+0" Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id 08146254023D; Wed, 13 Nov 2024 19:57:25 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Wed, 13 Nov 2024 19:57:25 -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=1731545844; x= 1731632244; bh=I82DNJzv7kfFPrLMZSPvOLFKl2qaIomC68nQGim2+iM=; b=r P7AMQn+EvIYuLgobWgafk+J9skoK7RKHq3mJhzMXAq89HBkP5qGkKjuTgU5F2bV2 5HWQjqZSL3hCbTmzvK6md0suKEH3ZWgzc1KCOkDJnbTEblVMM2oUOSQLFWfB3eQ5 tYefKl/r6mI8JTjvrEhg/ETWCuiSVYXk4nAoOei/1XBnS1ezqBqd8sr9MsufQecb +WLFwR2itogMhJF+peCXx4svL+Ehan5pOLhLV+jAMPWwjgma4icWcrQxLmb/xlf/ 13vopu6sPAr3QesUrG0PyvY0MSaW6i0d5tWI54rppRglYrBRmLuHmLVxrK3MTuB9 vxM3aWiU821/oXp9fwVbQ== 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=1731545844; x=1731632244; bh=I 82DNJzv7kfFPrLMZSPvOLFKl2qaIomC68nQGim2+iM=; b=h+0f4Q+02n3BD+GmN t2dLNn6duYJNirziFJVVZgwZXcIoOejgsIlvzLlChK39UjJBCP28GTV8YO7RRx3T SDUIEImpxBWAa66Mn2QdL9T/3MV4o7B0oQEP7gQNKUHoUU1JY8zEDHuvvd/HDETo Cr4BWe97pqqvvnYdz30Re+cuJLixEyJTiQ9zI+vxcbirqdfub18l2HyoR1oTKYPG 2q5SI+hlvUYO+xh8aKqhx35EhB94q4yYfHsfSQvWczW6QIvnaPmRfDzUFB6N91X6 vSTTDUcYLMfE25o5p3fzswTUsVo21YMCABxCHmpE/TcWGI5hPqva5GYQDY7ecZY1 slt/A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddugddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecu hfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepiedtfeekteelvdelveevueeu jeffuefguedvteekveejjeeutedufeethffgheehnecuvehluhhsthgvrhfuihiivgepud enucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdv fedrmhgvpdhnsggprhgtphhtthhopeduiedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghp thhtohepsggvnhhnohdrlhhoshhsihhnsehprhhothhonhdrmhgvpdhrtghpthhtohepsg hoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgvsehklhhovghn khdruggvvhdprhgtphhtthhopegrlhgvgidrghgrhihnohhrsehgmhgrihhlrdgtohhmpd hrtghpthhtoheprgdrhhhinhgusghorhhgsehkvghrnhgvlhdrohhrghdprhgtphhtthho pehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopegrlhhitggvrhihhhhlse hgohhoghhlvgdrtghomhdprhgtphhtthhopegrlhhishhtrghirhdrfhhrrghntghishes figutgdrtghomh X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 19:57:20 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, benno.lossin@proton.me, boqun.feng@gmail.com, me@kloenk.dev, alex.gaynor@gmail.com, a.hindborg@kernel.org, gary@garyguo.net, aliceryhl@google.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com, tmgross@umich.edu, rust-for-linux@vger.kernel.org, ojeda@kernel.org Cc: alistair23@gmail.com, Alistair Francis , Dirk Behme Subject: [PATCH v4 08/11] rust: helpers: Remove signal helper Date: Thu, 14 Nov 2024 10:56:28 +1000 Message-ID: <20241114005631.818440-9-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114005631.818440-1-alistair@alistair23.me> References: <20241114005631.818440-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 Feb 7 07:02:43 2026 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (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 D755282488; Thu, 14 Nov 2024 00:57:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545853; cv=none; b=ScxCTqvcLDRUDVUE3PLVkLiZo/A+7RcWpq8hzgd35jIgn09hk3ns/5k+d6xwnI4M8JY6QToqLr2EzNDU7UbA7QaEQ+my/u2VThxygnD1pooVS23P9/uCkzZQjezAGwmRByeUzmXaqGi/w+2YpaaGoKT/u0VdPolUobghHv1NgTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545853; c=relaxed/simple; bh=jjfm8JYmC2I9nJYRBvn8sy2FkQjaxe2N72DR2frCwl4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GQngAkL6Is7ZF1T1pQe0j6cQDzL2lazuAL88HhWQfOluhAhBN4Ubds7exMr3NhPhHd4xIr3QB49btwA5OKR9G0nzDXWEYIVBKk2PhrVceX9ZBAGK20IsSLZlu1vhhuk+hYO3u5lrwPDddGA2Km5JkoPkwPZ0+E8P2gG8/A+l7uc= 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=KNfF2aPz; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=nIwNqYX3; arc=none smtp.client-ip=202.12.124.146 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="KNfF2aPz"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="nIwNqYX3" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id 9E6BC11401FE; Wed, 13 Nov 2024 19:57:30 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Wed, 13 Nov 2024 19:57:31 -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=1731545850; x= 1731632250; bh=jd0+lguZJuYa2lTmU37tGJeQL8Ao2i0Sy/ndm1dnMtc=; b=K NfF2aPzfSGya6F99fiwI6CnJecEoLR50IiogLDVjA6pINOWoQ2iXgZur7HYhM5nL 1TllAunMUZjNR2uOMuLdqsndEyn+bpHmNS5NlWb6GVwEf0gZhsed4vDoyjChk8+p z+RWQKRkqclIdCc4lvrRUjRnp2yNeZT97Fr1o2Vg56klCb9p5RhLKUVz7EaCSoA9 W2II9gU7ue2LQ+Ay1RsZghvc/RBxu7yUPuWpcfNCcv9BmlyJY/hfk/4mFihPJAKm 6Fo9xylOm0AtbLbTvIvqxnDOzSz++aId5LBawEmYpOD+O4LhJ9gaWuYJ2jllyB+z 5DAonkbv+Y4UuQIWKRnbQ== 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=1731545850; x=1731632250; bh=j d0+lguZJuYa2lTmU37tGJeQL8Ao2i0Sy/ndm1dnMtc=; b=nIwNqYX3jBi0TFtsN QGsIRIrYMKwnpTsfT7edtq817uyG35a30KZx860OSt48D2soZSrgoPSU1luQ0ZsP sA+5MxAeY2vvO7/OXaPJB4sO8M35wT6uhN42KJtwZW3C0xOC2ethmukiY7DyYzgC nCJ2CObkrenaxDbgo5Wn7hTX42fFFVIFcN9ajJpXzd4DIEPDrr+bQJFllNpogx7s xIlara1VMhBvh5Yx9m9Asmqzg46UHHfXD0Bg9NMxUdBQ18+Qv2HUJXnB01aKrr/2 ieawxycHNTvQwHmJVFm42IQCMtplmN85BENxE+sxYLDSNkMrd67zvdlZl/i3LxNw vTfgg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddugddvjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecu hfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepiedtfeekteelvdelveevueeu jeffuefguedvteekveejjeeutedufeethffgheehnecuvehluhhsthgvrhfuihiivgepud enucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdv fedrmhgvpdhnsggprhgtphhtthhopeduiedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghp thhtohepsggvnhhnohdrlhhoshhsihhnsehprhhothhonhdrmhgvpdhrtghpthhtohepsg hoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgvsehklhhovghn khdruggvvhdprhgtphhtthhopegrlhgvgidrghgrhihnohhrsehgmhgrihhlrdgtohhmpd hrtghpthhtoheprgdrhhhinhgusghorhhgsehkvghrnhgvlhdrohhrghdprhgtphhtthho pehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopegrlhhitggvrhihhhhlse hgohhoghhlvgdrtghomhdprhgtphhtthhopegrlhhishhtrghirhdrfhhrrghntghishes figutgdrtghomh X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 19:57:25 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, benno.lossin@proton.me, boqun.feng@gmail.com, me@kloenk.dev, alex.gaynor@gmail.com, a.hindborg@kernel.org, gary@garyguo.net, aliceryhl@google.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com, tmgross@umich.edu, rust-for-linux@vger.kernel.org, ojeda@kernel.org Cc: alistair23@gmail.com, Alistair Francis , Dirk Behme Subject: [PATCH v4 09/11] rust: helpers: Remove some spinlock helpers Date: Thu, 14 Nov 2024 10:56:29 +1000 Message-ID: <20241114005631.818440-10-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114005631.818440-1-alistair@alistair23.me> References: <20241114005631.818440-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 Feb 7 07:02:43 2026 Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) (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 99B6613B59B; Thu, 14 Nov 2024 00:57:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545859; cv=none; b=NQJymHwCcHJhAWuQMmdkugIJnTWQq5R6KCJliWANg6TBdpauZWoXFVbpHDKuAHLT5hWdu8043aLq1OR/KQD+sJLf6N1G73NoH1m7RnxdJ/RQAKICHVAANPMvB4RFgxHUstboyuDLYjg3gj1wzsY1BaYXTOR21DqBQulLr2r6FJ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545859; c=relaxed/simple; bh=EFr6PSSkhe2tY7BjjykFUQ+OKuO0BW9ygo44emPlaNA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RwZJUvK/M5Bp9yYbuoj+6J8i/ZrpvaKg8tBpsuAI3jWKoC81ixImqD8UyO0zakjPuX5trbPQLeZ5AuHnBHPHG08enINawLxZ/1rdVDM1EhByJEO/eyfXuTIv2a1ZAfApkh4fH+cyZNojchqVCMJlk0XJ55v4Gmb1qBS5JQhnZc4= 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=NTXVOaca; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=E4tdh+xq; arc=none smtp.client-ip=202.12.124.156 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="NTXVOaca"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="E4tdh+xq" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id 6C0072540240; Wed, 13 Nov 2024 19:57:36 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Wed, 13 Nov 2024 19:57:36 -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=1731545856; x= 1731632256; bh=64HM+hPNGJXCLJGNoMucCmP8UDaNeqv7QWdlGBPWino=; b=N TXVOacamQtQIhLk5EZX+9Q6lGfKriZWtadi7lbT/rZMzAGXVpgLUswUECiRqdreE vaTBdT6hU+v8gI6uFuggRqx8NQEWc5FVleaogSNMwEfaIExbZ8zbVFd80ytLhUo4 2xFDH2xpg/7H8Z99/qznpmUPamYtBXMcsiCicbqEFjs5rfxLGKuaGJF5sHV7u0Z/ Hu3+iW7ECrArbkk3P/THKeAO/hp0Ceuuaplmolp+uMNtZlXeKCuJZUJd2/khPD8i iPopRnXsczWHfS2jOt0o58k7ZYfs8/scpwJ0/JN9zlTHDTScq07DwNd8Ovmg9SZb GubQJU/dTD3OCMGHJrG9w== 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=1731545856; x=1731632256; bh=6 4HM+hPNGJXCLJGNoMucCmP8UDaNeqv7QWdlGBPWino=; b=E4tdh+xqS8JniL1+V lQ9WyWh6Mh5V2pbQGPS7HjNZe7LZPxqLZbElxsOKJSeuwCif6GM8vOcJNnarSbOJ r1QAkjIsYEDM3pgFDuYs0o/5WKPvYg2tqmyWeFCfZbHMHCAvQknI3+0mZQ5iHj2F 2xIkc5hdqXzu50sYb2fnvdlmoKcqnoSfOGett8mn6/BRSnUG+kWGR93LrLgNA8TP mIdW3AkQxBGpyR5zpcOK96RSd0ntwrPzFP3a6nVh9LnrfZQ+w/RQlee9Ly5M1Ayc qjljr0xtaZVlWrpl259/V3km3d+/7q3/5W7O8Hdx63vyF1WmSaXQmzAmhuKaHbrs ChLsw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddugddvjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecu hfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepiedtfeekteelvdelveevueeu jeffuefguedvteekveejjeeutedufeethffgheehnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdv fedrmhgvpdhnsggprhgtphhtthhopeduiedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghp thhtohepsggvnhhnohdrlhhoshhsihhnsehprhhothhonhdrmhgvpdhrtghpthhtohepsg hoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgvsehklhhovghn khdruggvvhdprhgtphhtthhopegrlhgvgidrghgrhihnohhrsehgmhgrihhlrdgtohhmpd hrtghpthhtoheprgdrhhhinhgusghorhhgsehkvghrnhgvlhdrohhrghdprhgtphhtthho pehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopegrlhhitggvrhihhhhlse hgohhoghhlvgdrtghomhdprhgtphhtthhopegrlhhishhtrghirhdrfhhrrghntghishes figutgdrtghomh X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 19:57:31 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, benno.lossin@proton.me, boqun.feng@gmail.com, me@kloenk.dev, alex.gaynor@gmail.com, a.hindborg@kernel.org, gary@garyguo.net, aliceryhl@google.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com, tmgross@umich.edu, rust-for-linux@vger.kernel.org, ojeda@kernel.org Cc: alistair23@gmail.com, Alistair Francis , Dirk Behme Subject: [PATCH v4 10/11] rust: helpers: Remove some task helpers Date: Thu, 14 Nov 2024 10:56:30 +1000 Message-ID: <20241114005631.818440-11-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114005631.818440-1-alistair@alistair23.me> References: <20241114005631.818440-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 Feb 7 07:02:43 2026 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (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 551982B2D7; Thu, 14 Nov 2024 00:57:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545864; cv=none; b=qz0RJEOv4oMOcnjeU9OH8RhQR86NLhaupaiX63leI/C+GCl1syKQMXj9ejblyfql9gVMSiUh/yhRHw+kubk8yiC/Y0pwoh4Jc7FpymYrwvyCaiIAiLtWgTKuNt7dpS+HgAbGikUmsW0RsVUdl0LD8GfYzv7NEJ+pnRRGPfOcw0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731545864; c=relaxed/simple; bh=WjC01+sS6nKTi7io9kauOjUhdDFeBAC7nscRHge7Vs0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EZ20Ys3Z5T0gC8eyHqxdtgLxfKbOoZORPGxsPuZXyo2ZIqgOihF9w7ZIw1bJWRYS8uGCn9fDIRnQq57Yu5PPxUriDbLkHQze6m/G1Ez6/igKRWAfGLiZDT+3JUhImvSbWbcoY2k9a5ULwVBCfvbFTYbAo5w4Z8mkarDJVJQhtlY= 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=l8tasvGm; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=fNjGWWU1; arc=none smtp.client-ip=202.12.124.146 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="l8tasvGm"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fNjGWWU1" Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfout.stl.internal (Postfix) with ESMTP id F13DC11400AC; Wed, 13 Nov 2024 19:57:41 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Wed, 13 Nov 2024 19:57: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=1731545861; x= 1731632261; bh=+cKsHqUdRIqVh7tWBD/bK/cAI6O3Bzd18FXNBICgPtk=; b=l 8tasvGmgCTw5hQX6fWvxRwJLvEDSSBSGnUYGRiGjK1vp4k2VAlVTkyFcvLOKY9qy FaXYA7R7lCD8lOqcwNerKhOr2uiHQweRLeJBBaGGnrIK2m5xglFUrFe6NVwZ+bAr AfwHmMIjJ7yBVLzSMMk9T1WY8K9Yo+t28cRLy9aZY34ekWdZbqvcIhbzrAlYF2fL w3GeeSEj96fjGYpXKuf7HPlQd54Wwotu8HD7G8Rqgx03xMI25PfdUUPfeStgkhT0 INEdR7xIX/B1yQRTogVBScfq9JPlgj8l+3GjQUxk7KTe6t98jOxd6NEpVc0TI7dV ooYMUTRzV1pdD7et8GisA== 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=1731545861; x=1731632261; bh=+ cKsHqUdRIqVh7tWBD/bK/cAI6O3Bzd18FXNBICgPtk=; b=fNjGWWU1iN9ZHk43O Hks6z+3cOYVcXAjpniPMvOc3hZAvqdgk9fNLHJwXpn12e7d/CUXazibwUc7m8ME7 WVQPDmYIlAiuxTH/p50g2iMisnfd2GJPwwQf8cZepZ10iNL/oHX6VV/OklEKDeuj Vk8pPugHpTEgnxc80eMO3/Tqr2WawbGRJ0U0qsyFy3thfXIjUClRAQkubiniz2Tc Zm54dOA4K3f1rORJylKgm1CShI1ULsM5PMk7rTji6De/ojHFSOQfqzcYLTTXD7Ly mu/UJ+nn9r6QJVHCOkdf4LScZ6Lk6cKcG4UbzCJ/wTCjpPPjk3iDtiWlbLnGHbyf oj91g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddugddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecu hfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepiedtfeekteelvdelveevueeu jeffuefguedvteekveejjeeutedufeethffgheehnecuvehluhhsthgvrhfuihiivgepud enucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdv fedrmhgvpdhnsggprhgtphhtthhopeduiedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghp thhtohepsggvnhhnohdrlhhoshhsihhnsehprhhothhonhdrmhgvpdhrtghpthhtohepsg hoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhgvsehklhhovghn khdruggvvhdprhgtphhtthhopegrlhgvgidrghgrhihnohhrsehgmhgrihhlrdgtohhmpd hrtghpthhtoheprgdrhhhinhgusghorhhgsehkvghrnhgvlhdrohhrghdprhgtphhtthho pehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopegrlhhitggvrhihhhhlse hgohhoghhlvgdrtghomhdprhgtphhtthhopegrlhhishhtrghirhdrfhhrrghntghishes figutgdrtghomh X-ME-Proxy: Feedback-ID: ifd214418:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 19:57:37 -0500 (EST) From: Alistair Francis To: linux-kernel@vger.kernel.org, benno.lossin@proton.me, boqun.feng@gmail.com, me@kloenk.dev, alex.gaynor@gmail.com, a.hindborg@kernel.org, gary@garyguo.net, aliceryhl@google.com, alistair.francis@wdc.com, bjorn3_gh@protonmail.com, tmgross@umich.edu, rust-for-linux@vger.kernel.org, ojeda@kernel.org Cc: alistair23@gmail.com, Alistair Francis , Dirk Behme Subject: [PATCH v4 11/11] rust: helpers: Remove uaccess helpers Date: Thu, 14 Nov 2024 10:56:31 +1000 Message-ID: <20241114005631.818440-12-alistair@alistair23.me> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241114005631.818440-1-alistair@alistair23.me> References: <20241114005631.818440-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