From nobody Sun Nov 24 05:29:58 2024 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96688405F7; Thu, 7 Nov 2024 02:08:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945328; cv=none; b=OcDcIiWoIeOfbyIwf7z70GhKZclJbfP1tUPXR9h0sw+YxgT1899Z60fbqJbBsprwRlMQ2GfJiZmRJXEV3xiHrPJq5vuE+7sYCmnN/W2ugPpx1LJeiVONSoTCSqGR4qy/VT+/UyjzhUi60d+02EsFWvMlF8Mkz+mqdO+yZ0/3YyY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945328; c=relaxed/simple; bh=7cu9PKpMg7PIT036BMkB/S+nqDpY4cTVeq6Cz3UwXuU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uVLk8kHDbP3mXAxEszVUbqwPOYGxtiS65I2KVPRDNCcLE6NyDY/z/wZu07xE3QJpqEmvgezKQMeSiV9I6tO+trLntHY+pC/x1+fRozhoh3L0DIWGLicYOnXGyGfEb4jAj6bCeP7KfIU2I7UN+dX4KL0574oIQ4+vBV3yx4Ps9rg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GsHHVtxC; arc=none smtp.client-ip=209.85.215.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GsHHVtxC" Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-7ee4c57b037so404606a12.0; Wed, 06 Nov 2024 18:08:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730945326; x=1731550126; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c8uiK/Ic0Cv9zs1Cmhd/sJuJ73EalyYXJTfTOVDE8k0=; b=GsHHVtxCI+j86hBbEPkmNbB16vM1dfdgvSn0piIWNTc2p0aj2rLbMVlRCnkyCj9HIM iHsC42vnXLgSoK3XB3/GNiyiwQh4g5/HqwnZRfLefxZClSK7l109kZMO818Bh6fyE6z0 L/y9swG3cyxXs8an+1927FladQLJMsXnclrCHbmnzVvHyljw9c4inRlQq0J499V0OusW 0izhHRLTzKtFYvjhqjyYcrD0LXCiCZZEETFDxHLsWZX76JyeYoMjGaQR6eWxMA6cVES/ nO3FTiUu0IGZBlUTYU1NK8eHmdYkGo4TxPi0/7ssrklW6evfX6/PojWrrND201n2rG0e hJzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730945326; x=1731550126; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c8uiK/Ic0Cv9zs1Cmhd/sJuJ73EalyYXJTfTOVDE8k0=; b=BR/6IEnBV3n9Dp0mTTtYOSx/Nn4uhGg3KcIuLVDxDMwZke8dC/LMcROzHurF5/EAo7 ZQPtEYFjLIsfvcJndymmKvtOn6gInNjxumCcOTUA5rV/4h5BZv999SrorHTPx3C/f/TJ SHun32cM+lw9vEMUroCuQrnHdmxFD0Xjjli1bn+febhY8MZ4rCc5Y/wuMlYf2efkL2tR ilaSw7vWeInNbu8M+lccRjJKyPzWGay3ynJGPXQgmguKJSVwu9b0L93/keWTZFCh5311 27aAFw+C43sZ8CnYa63zWPFq3pjh/bPhMvUmLt9YGJvAuGLy4wKw+BZ1rXKHfByZGNAl SBXQ== X-Forwarded-Encrypted: i=1; AJvYcCVzS2ll5Dy5IYUehOayXpoourJFcq2twbTA/ijxLnuChhmTKa4ZLssDDUJJBU13BE2aWO/vqqLkJyZo0u4=@vger.kernel.org, AJvYcCXRr7F3dTE2/06NoPoZQrBkl0fu6Fu42nkjkq5/+LA5kK0LGmBGkiuz3ahReoEVvlD2o9Ddxo7SO102pH+C4xo=@vger.kernel.org X-Gm-Message-State: AOJu0Yya0NHJyWw7hwt6gXbisO3ZJBDFeXUga6R7PLHtDH3oT6RIg/kY sMSy/az2npdpab9Lqq5NQIuQ5TAhkEG+4EuFauttqhj3qCivtd6d X-Google-Smtp-Source: AGHT+IHSZ18e093uRS+GpjjWCpbTJ2osSEj2Jz1jCRDcfKw2MooH+iEJg9ij210Kp4gtbGIk81dMww== X-Received: by 2002:a17:90b:48c4:b0:2e2:d17e:1ef7 with SMTP id 98e67ed59e1d1-2e94c298d32mr29364096a91.3.1730945325807; Wed, 06 Nov 2024 18:08:45 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f98b3sm2549916a91.32.2024.11.06.18.08.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:08:45 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: alex.gaynor@gmail.com, benno.lossin@proton.me, gary@garyguo.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, me@kloenk.dev, a.hindborg@kernel.org, tmgross@umich.edu, boqun.feng@gmail.com, aliceryhl@google.com Cc: alistair23@gmail.com Subject: [PATCH 01/13] rust: bindings: Support some inline static functions Date: Thu, 7 Nov 2024 12:08:19 +1000 Message-ID: <20241107020831.1561063-2-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107020831.1561063-1-alistair.francis@wdc.com> References: <20241107020831.1561063-1-alistair.francis@wdc.com> 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 (dependig 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 --- rust/.gitignore | 2 ++ rust/Makefile | 36 ++++++++++++++++++++++++++++++++--- rust/bindgen_static_functions | 6 ++++++ rust/bindings/lib.rs | 4 ++++ rust/exports.c | 1 + 5 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 rust/bindgen_static_functions diff --git a/rust/.gitignore b/rust/.gitignore index d3829ffab80ba..741a180238013 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 b5e0a73b78f3e..4ea5ce96440d0 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 alloc.o 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 alloc.o bindings.o kernel.o extern.o always-$(CONFIG_RUST) +=3D exports_alloc_generated.h exports_helpers_gener= ated.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 @@ -275,6 +278,20 @@ 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 + @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 ; \ @@ -283,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 \ @@ -329,6 +355,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 @@ -410,6 +439,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 0000000000000..1f24360daeb38 --- /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 93a1a3fc97bc9..63b915a8e4fbf 100644 --- a/rust/bindings/lib.rs +++ b/rust/bindings/lib.rs @@ -33,6 +33,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 e5695f3b45b7a..e4bd5b694beb2 100644 --- a/rust/exports.c +++ b/rust/exports.c @@ -19,6 +19,7 @@ #include "exports_alloc_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 Sun Nov 24 05:29:58 2024 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7A2217BCA; Thu, 7 Nov 2024 02:08:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945333; cv=none; b=PwoJ32M7nK6hJU9Eq5/QK9T/wdF5BbVrEo00W+UDCVB1TGYyjcqvrJzXFqsdwlr6etC+MbePOOqqrIwpsrH+dL7NbAFDtQFbSLW2W0XfHSnYEwGVgZbQVHkW6hO9UDYbaySYgVrvV+C2uZTN/zmpQ71RqxOdVFjbhKnon7uSK6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945333; c=relaxed/simple; bh=tCzl4sLcDtNPTi7ell42zZZmjIKm71zOm6VxpxOjylM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OUXC8G4uhReVfT+8Lw+odaN8kAZbgKWRHAvGscJIasB8CruUMVLHWrcimYtM46H8Xn1fcK0XZReTsIY+f7Y+AdvUqcjFgdQIxxJl4Iq8w2rvtZr/SGMonfbsEaHcBsGBAb+KC1hnZTMiqsmna39lU9PcYFSDR+kNNKYd4qWRmdc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hpbptNCq; arc=none smtp.client-ip=209.85.215.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hpbptNCq" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-7f3da2c2cb5so414968a12.2; Wed, 06 Nov 2024 18:08:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730945331; x=1731550131; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7lfZIgu31R4zQkJW6U15q/+sPg565w1qMTJ664MZPho=; b=hpbptNCq/4hD7i1wegL8K1uH+mjFYM/s8qSy81vLcv+uT+RILFOUBslbsTLQi5dHYI pVXy85mWQZWYCNGRd/dE6ZEYthQTnQeaHeuqYma6o7AOiKV1cip38WDRCSwkdrQI0uuT ZbM+nGrLL7AAFuWCkKIufCIJ7uTIyIiRzMzobYP3LPRl2QPEuLj/OWHhW+j9QVAjDyAB Tblb0JXWpjvFXHNTfYMdEgvtfiueEg03e87BPRacdB5i6ekoSibzoxACm0dVoO0ccEZk bU4TCzeYxvVTtg8Q0BdbqEK25BxrIMou3Sxit9+SkSE5a0vKjiIlRNSvgTtRIyGN5EAc wnNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730945331; x=1731550131; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7lfZIgu31R4zQkJW6U15q/+sPg565w1qMTJ664MZPho=; b=dES1r9lshsLKTuQrA4GL9Bpu1AKd1g+2Yiusef6KQBkIpoXCiiCeqmdzT3n3RuizxX azF8QmIAnc1lZgXCXaxvQxI7+nMqQs2EQZoVSltPKFXiQ4OB/UlNw1T4jq4T1nabMzCf gD5MwJF+j7Iy5yjbgRvtvXHTwjCXBX+wq2En3b0YDwS/7GjAsBHGijvuIcsaY+MDN9P4 Yxc6KlcuNOd0L+G5PJ5K1hn/1lfZ8OyICYbjzjPUKsTpezJPL8xJLyXuaHDYLOgdo4Tf ELBtuQfneg2caIZOPMZWYBH/HSl3lETfjVQLgqfeWY+MNJVkJvXefUHdyUm8VLCIe1VF FbGg== X-Forwarded-Encrypted: i=1; AJvYcCXHn5HoW3Cf2+Z8sg8tG6kkgxjVeer0k0y21z4hdBch7iuE1JG7y8O5PPrpqCX+hPN0D3qidrXNPXSxdjU=@vger.kernel.org, AJvYcCXkulQ5v4d6DWvOw4LDCWTm/qIwoVisRNCf9Btdkub4+EhXvUHtjKwYSCLCyMf8m4Tsc77VZIWCxkoS184cOkE=@vger.kernel.org X-Gm-Message-State: AOJu0YxwJQx5BrDLLU0Dplrr7vCwQMO8ySkzcDb1s97fUL6vAxa4qQjB sKsu6Xw4JEMwHUCUlq6Z0vzavq0oRdBAsmJuodbTnpTI4KKr1XF7 X-Google-Smtp-Source: AGHT+IHGj1wdDUsqzubqhkc8CYCtJemPUQeUQAaVouT8cy98UksrEoROzmpDUMk7J2PgBQN0XACVFg== X-Received: by 2002:a17:90b:3ec9:b0:2e2:bf7f:3369 with SMTP id 98e67ed59e1d1-2e8f105811emr46004701a91.5.1730945331057; Wed, 06 Nov 2024 18:08:51 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f98b3sm2549916a91.32.2024.11.06.18.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:08:50 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: alex.gaynor@gmail.com, benno.lossin@proton.me, gary@garyguo.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, me@kloenk.dev, a.hindborg@kernel.org, tmgross@umich.edu, boqun.feng@gmail.com, aliceryhl@google.com Cc: alistair23@gmail.com Subject: [PATCH 02/13] rust: helpers: Remove blk helper Date: Thu, 7 Nov 2024 12:08:20 +1000 Message-ID: <20241107020831.1561063-3-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107020831.1561063-1-alistair.francis@wdc.com> References: <20241107020831.1561063-1-alistair.francis@wdc.com> 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 --- 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 1f24360daeb38..42e45ce342211 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 cc9f4e6a2d234..0000000000000 --- 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 30f40149f3a96..1df56294cad46 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 Sun Nov 24 05:29:58 2024 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1250217BCA; Thu, 7 Nov 2024 02:08:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945338; cv=none; b=FvzX500DnCOXNHla9eSNzsP4pUiEI8VJS2xgyS0PAlMwCSkd9Wh3d3Hf6tMLYOXU9N0QZJgdAbbIhdt0jYKiyD8aHG2ws5zZWxF/AQdbLf6Z6oIou9NBsQ0VOKNByCvxbZXi20zO8eTWbO8CYJQ3DIIAcr9jpLzoGztE/DP4n0w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945338; c=relaxed/simple; bh=GFjIOlmW5cYspF3RYOvDHrimMS95IsTapsdaD7UAObU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e0xRsZI9jzreyMNuLkSMxAy/GIJNip393j256i2Rc2/zHtvg1OtjpvGr/8Ojbn3cTuZv0Lv6bs89Tr+t+PNf69nuluUUD6n34hkvBqdmp/PXJL5Bvb7/LnWZfdp/osC3VvmRAJz4BQ3agA8bHqKyf9A9AROecN6a+3wUhzuEozA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QydKNGtM; arc=none smtp.client-ip=209.85.216.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QydKNGtM" Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2e2e6a1042dso358320a91.2; Wed, 06 Nov 2024 18:08:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730945336; x=1731550136; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ECpNhgje1W38COAl3ahJTUVL/UpVGUVi4I7zpfAWrY4=; b=QydKNGtMvy31TT6rkD7e8t7JJZhxxlumtisCWDlROaE48FvOx689PNFvbyn5ZU7zos VnbDB6qJzNPtfzXk9MkhNt44Vg/Cv3RcoF8yCrfQHCuKTTMo1zrg8AYzeWW4Jd5eNJA4 BZ/drapSDCA7/MANyF7FInSTE0ExACSMaCeLITqEb1qoRl8eitCLIQl+7xi1xifq5uf3 xG6jKXQW23ATCdFYg1tgbgQ2h/ydhzHr4lJQXi3JZn9lGCXn7dPUrVCCNYHizbLvT5ml +WUEZ2QKSRK2WA5+suDErC5VXMfgLx1VMiSMewAj5LNEjSqtl/NiyeI4/hiKgemCawfV SaZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730945336; x=1731550136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ECpNhgje1W38COAl3ahJTUVL/UpVGUVi4I7zpfAWrY4=; b=p7B6BvIbn2YJXYBnqpJfXXuiC5GW0mGcf/IRJwH1azJ5HWA+yvpkbpoQbL7fQjPALO yJxC9Rr5BWzYiGPoikCcSpUUgNIs91CBl9mQOxhlR32S57pU0eSlFZqoD16sNGpNjYIa nOQW6Uyb3zMSeNmRp0pmqJi79gx4C0/ZK0z04Cx6S05cIyjrLfxCiOAvS94BPcmyphzO TARzS/SAssUpujaizks6iXXuZeNZbry/DArzGp6YroLSNn4oQDcv7ih08OBAdubZH1UT hOJlBBE9QmGZs8QA5ewKXIOXyuisdMzgFR70OD7WQeHweJ3jCO//D+hzI0Jkqgkgw86i M8Pw== X-Forwarded-Encrypted: i=1; AJvYcCVlLcv4KGMdm6cc6ytIT7ghUN4buvjUR+fwDc9Cf4uy2NoOuH0HUQqa89L+s7Q56z2kd34lLZHAdU7nRzs=@vger.kernel.org, AJvYcCXH6eBNEfZVUdCCKEBB+uKftuJeA7ZCmdO8dPUwp1ZWa+LbB8w6QJuJsCjULVDyRRphyl/tPyB4DD6GtAAlXv4=@vger.kernel.org X-Gm-Message-State: AOJu0YxyKAOVXBwaydPE8vp7+k3qH3sdLpG322W+pahwkTl33uow0lJG SphEmAz47XUA0WfyxhFYYFs98hgsOsIgYIwJU4r4LIoP1Xcun4K7 X-Google-Smtp-Source: AGHT+IG3DEWlNL3zFemQErhcj1ZfEJuWNBY/fnKjyRre1KIHVIY4X0GLsPXlRK+dSukbH0uvlKQ4ag== X-Received: by 2002:a17:90b:35cd:b0:2e2:ef25:ed35 with SMTP id 98e67ed59e1d1-2e94bdfdedemr29550898a91.0.1730945336328; Wed, 06 Nov 2024 18:08:56 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f98b3sm2549916a91.32.2024.11.06.18.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:08:55 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: alex.gaynor@gmail.com, benno.lossin@proton.me, gary@garyguo.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, me@kloenk.dev, a.hindborg@kernel.org, tmgross@umich.edu, boqun.feng@gmail.com, aliceryhl@google.com Cc: alistair23@gmail.com Subject: [PATCH 03/13] rust: helpers: Remove build_bug helper Date: Thu, 7 Nov 2024 12:08:21 +1000 Message-ID: <20241107020831.1561063-4-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107020831.1561063-1-alistair.francis@wdc.com> References: <20241107020831.1561063-1-alistair.francis@wdc.com> 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" This doesn't seem to be required. Signed-off-by: Alistair Francis --- rust/helpers/build_bug.c | 9 --------- rust/helpers/helpers.c | 1 - 2 files changed, 10 deletions(-) delete mode 100644 rust/helpers/build_bug.c diff --git a/rust/helpers/build_bug.c b/rust/helpers/build_bug.c deleted file mode 100644 index e994f7b5928c0..0000000000000 --- a/rust/helpers/build_bug.c +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include -#include - -const char *rust_helper_errname(int err) -{ - return errname(err); -} diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 1df56294cad46..0f0c16c1e8149 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -9,7 +9,6 @@ =20 #include "bug.c" #include "build_assert.c" -#include "build_bug.c" #include "err.c" #include "kunit.c" #include "mutex.c" --=20 2.47.0 From nobody Sun Nov 24 05:29:58 2024 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 521B915C138; Thu, 7 Nov 2024 02:09:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945343; cv=none; b=HHp8sjII1jecPv557bLfCr1qbN6nzY7gblJoteFixElY3gvX4Srw49eXDJcxxCNujrBsHMnugJlfyLMbaJXz/ERzGDR244iwXnk+U6SRaUsR2XqgzUgCgM4zHehYmdTxWoQM67ezV/c5i/2Q1CA3GZlUn6AuLoZ8TWpagHstDv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945343; c=relaxed/simple; bh=pfNDrAMVomEUvW+LbVJP1x7ST16tFeEZjpxTr+Y9JDw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IrfkkC8aS7EidZSMrIauTKqpH3UUzfpVjV4YBqF6wDMzGWrcAXokl8E29Ir79X6SvP0RJFt92tZ9ThrurGKUrz4m5iJIe/74eTA+HbAiZz/bB8t8/PHTpEV9ZN2aflIFJX/afvasJOCle6zd9fNwt4K4I/L8ghIUo3J0VdpwD8U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NoUdwzwm; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NoUdwzwm" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2e2e050b1c3so1259363a91.0; Wed, 06 Nov 2024 18:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730945341; x=1731550141; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Rf0pvGrDPvRarrQBRRieA1xBLh/1KQSgL6QjimbV8ss=; b=NoUdwzwmynpKd35IgKIXkltbEYz8sRAxIo/Fq32iLBv5Ij1mqRT/rNb9HmBL7/19Pl YnD80k2S/edGQEyNn1VELleVHzZ8d+YiLSoxyRGGH2tAVGZyTY3Ue4lgSoBnZbWrEEA/ 4ogk4ddmSulUudmOJ5Uht6L0ksMslvefvIhJfXkVJE/ViegTF1U40SjeuP8AiTt+M6IH Gw4tfKBZM+gk1+eOy6mUQMic/8mI8XwU+Xw2CTTFY/auA9tTKa+37QZ0MzKA5hUj3jUD 6TBwNLnCJlJr5T2s/MyHe0eI/8ZTYp7TXM7xBCRlsMUqAeQnDB+V8MChhId0pi/L6weW jBxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730945341; x=1731550141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rf0pvGrDPvRarrQBRRieA1xBLh/1KQSgL6QjimbV8ss=; b=wUeV5gxp2k2GhgTXCoilWTdoP8wpK/u1oyczpNwdn6d6LtkuStbr3BZ89SRh8wCim2 NOMkP1uIVF815UmItpJr3nn5JzrZjfkQOEIL1hv/eMrq8caCtCMEkxBTzpcMBAfZjYW0 1xvAfFsTYaKtr1Z3z/Ojn+IDfRPHa3oUpppnp0BCnl78xvxn/ApzpnOZ06YxQKxSlHFW JAhDeGyrRyg7c8yxvyVzawwgfoCUAwg71NEPT+HYwGYdwI6+BZqogQmreRYfmQt3UXbx YBDbioq7a9b7bivUafiKQnqCCY8u/8AZA9R9n1RDj9lalC6cGr1465Bx8jc18nVEVP6i JlIg== X-Forwarded-Encrypted: i=1; AJvYcCX8fiyTneMR+AuIqrqTVPbAsQwknFGH8wsDYkvkjAlS93NZuCoosrmJf8bsomAvwtinnx9JhFsULvM+pegXUHE=@vger.kernel.org, AJvYcCXyR+b2rNKb0PrsfeVTDprAiAeYjCA7ardbNCpdk47TcpK32fauBWGh3AWlKIDbuAX9Zc4Vflc42yGQ0lc=@vger.kernel.org X-Gm-Message-State: AOJu0YyP5sc/2xf5dhkHX5fFjtomNfjecx3x6cybPMUKqFsaOpARuXy5 O3qMgRfx7oaQUIMS0O+I9A3X84vQTzu0lyOx5VG79P+oe2//3fj1 X-Google-Smtp-Source: AGHT+IHHcmX79oI8Xych7iPIxgGCKaQ61oMoset3klp7hllqm6olOIaLUlRHUoSwv8YOau99JwYvXQ== X-Received: by 2002:a17:90b:4d0a:b0:2e0:f035:8027 with SMTP id 98e67ed59e1d1-2e9a4d265b5mr2301560a91.2.1730945341540; Wed, 06 Nov 2024 18:09:01 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f98b3sm2549916a91.32.2024.11.06.18.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:09:01 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: alex.gaynor@gmail.com, benno.lossin@proton.me, gary@garyguo.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, me@kloenk.dev, a.hindborg@kernel.org, tmgross@umich.edu, boqun.feng@gmail.com, aliceryhl@google.com Cc: alistair23@gmail.com Subject: [PATCH 04/13] rust: helpers: Remove err helper Date: Thu, 7 Nov 2024 12:08:22 +1000 Message-ID: <20241107020831.1561063-5-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107020831.1561063-1-alistair.francis@wdc.com> References: <20241107020831.1561063-1-alistair.francis@wdc.com> 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 --- rust/bindgen_static_functions | 4 ++++ rust/helpers/err.c | 19 ------------------- rust/helpers/helpers.c | 1 - 3 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 rust/helpers/err.c diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index 42e45ce342211..0269efa83c618 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 be3d45ef78a25..0000000000000 --- a/rust/helpers/err.c +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include -#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 0f0c16c1e8149..40e51daef412e 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -9,7 +9,6 @@ =20 #include "bug.c" #include "build_assert.c" -#include "err.c" #include "kunit.c" #include "mutex.c" #include "page.c" --=20 2.47.0 From nobody Sun Nov 24 05:29:58 2024 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7211442A97; Thu, 7 Nov 2024 02:09:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945348; cv=none; b=X6lIdBuLHWYqYL7gElVKRg8ZyXcwLozvEmOeja/mFUwiLHU/b6B1e/kUvPbaP8Z1NJuWSSgMnFQc7TIoZ58kxAnNWjxsV8Q/wqlCiIXbrhoWxhgWbDg2zhO4VDGh4or8Dd+kO9jXMzQq1dnI0sKVMHgHU90GWYzok8oiEtFtYxs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945348; c=relaxed/simple; bh=U/MHHMANLLRFH8bXUZDEC7Ll1T4qSlmleiKizwJ2cz0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t6p5RdASZV/T3xLK5KlRI7e+uVm28FvePq+A8lnKtNF59Vu0e+y5bNUoCfWK+4GbkhkdCSny+uQO2Yb++XWYI4X41uOybKiKQjEfGE0yqU685HSrToFvNZFa8CKEhWVjQtMUnQmx9RiGO0WZl1iaShRKbyPhmnj7v/89r7i3GEw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kkPbRjZ0; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kkPbRjZ0" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2e2cc469c62so332739a91.2; Wed, 06 Nov 2024 18:09:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730945347; x=1731550147; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4LgUzLaa/81IYkOXJGqaU2iQyIFHmm0Jvesuccgag3s=; b=kkPbRjZ0719SIFFibxWoNuPXI2aGpTqHKDAjnHRhHSNyRTbvOz9P0FA2DjiU0d+Dp3 7gw1afiC8jDtUQXrxG3L5LyR2HAxbzlN3WPvArVwbYgMFcEDpfOE08+VBHYHLW6odB7n 0Fn4lr5MKfR42WZ44uRk5N37iLUr9sRNPzYQnNXClfJlmiKV33cuT3BTOW8PcCGITzm8 t2F5HWdKoJH5Vg0uYgN41s6e/3B1XKg5K6AMilr4kpFfmt2cpy593rPQM3h0CErbO99O RDbv2Z9OhZ6gOIL1reTJA0NCVj1j4hVus/8ca2b+CsJR9puQGf1i0Ycxf1kzAFgYu6Jw cwbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730945347; x=1731550147; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4LgUzLaa/81IYkOXJGqaU2iQyIFHmm0Jvesuccgag3s=; b=dqlsVwtPyH0DNX0oLSFCr6BevcXiecjJMPfpRcka7089WdXrO+ITnAjAMjCK9tep2N l0RG8Jg3XH5TX3ldRDX2rTktJixiK09XxK7uiKftFnqbthq9BsmTbSQX5HkrQzJYNdf9 J75w2BndPDsREprfjiOYi2ksRKCtZAjr4Qnih8lMDpHEqcCIUyZEWJiQ8sbzTaH8td4T MFRjQU/KME3ZoPHyRG3HtByeFv7PZCGMqmgtILa9LfuQjLpn5itJeh6UcgiFO3PP906c I5sKXTSDfZoRGf2BRZVay7J7K9eGh+UOfXgVVtICIdhpMZO1nRcYbL5MjWbEgno7csal TjBQ== X-Forwarded-Encrypted: i=1; AJvYcCU6ZqTUqsFBZKWf9jGwXm8fmkg3Ye95JwTIfHdlXonNPv0VE0y1K4KkinWNoMV61RB49qm8gdJQeAHqL8bmHHM=@vger.kernel.org, AJvYcCX9I8MinS34i2Y4VTu3gJRfblufAzhMuunICL4KQzIJKJX4CU8Pul93F+jFgutUHwAQLyBtdU5jAjlbWyw=@vger.kernel.org X-Gm-Message-State: AOJu0YyNXfV3ZShbxmrkgfwV5WdNhA3xr7arkYb+WP/TPals3+VUfbCx g+coeZi0MJgQ051jGq9AJhVxWszsWYFSDN/cBsEGT7CyMsHoaTjO X-Google-Smtp-Source: AGHT+IGfJWUafciN2fNXLy1jWI1dGe71eoWoM4W2pn15Ul+b+0lSTNIqhVZhjbJURnXoG4DzkOlD4Q== X-Received: by 2002:a17:90b:38cd:b0:2e1:ce67:5d29 with SMTP id 98e67ed59e1d1-2e94c2dd2afmr29798279a91.21.1730945346805; Wed, 06 Nov 2024 18:09:06 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f98b3sm2549916a91.32.2024.11.06.18.09.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:09:06 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: alex.gaynor@gmail.com, benno.lossin@proton.me, gary@garyguo.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, me@kloenk.dev, a.hindborg@kernel.org, tmgross@umich.edu, boqun.feng@gmail.com, aliceryhl@google.com Cc: alistair23@gmail.com Subject: [PATCH 05/13] rust: helpers: Remove kunit helper Date: Thu, 7 Nov 2024 12:08:23 +1000 Message-ID: <20241107020831.1561063-6-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107020831.1561063-1-alistair.francis@wdc.com> References: <20241107020831.1561063-1-alistair.francis@wdc.com> 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 --- rust/bindgen_static_functions | 2 ++ rust/helpers/helpers.c | 1 - rust/helpers/kunit.c | 9 --------- 3 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 rust/helpers/kunit.c diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index 0269efa83c618..b4032d277e722 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -9,3 +9,5 @@ --allowlist-function ERR_PTR --allowlist-function IS_ERR --allowlist-function PTR_ERR + +--allowlist-function kunit_get_current_test diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 40e51daef412e..875e1fed81c24 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -9,7 +9,6 @@ =20 #include "bug.c" #include "build_assert.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 9d725067eb3bc..0000000000000 --- a/rust/helpers/kunit.c +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include -#include - -struct kunit *rust_helper_kunit_get_current_test(void) -{ - return kunit_get_current_test(); -} --=20 2.47.0 From nobody Sun Nov 24 05:29:58 2024 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9CB818B47E; Thu, 7 Nov 2024 02:09:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945354; cv=none; b=EXelTV1B7Z7QQjwww/w6iVo65qRbiXphpAM7PI3bVAh0UnmvL1HCoArsQvl0WDvabi8GLzgssEbvhyLBP3i0XbAsx38m6QO+U5Qg4PmnYfqQuCeJ6TPqRkHTrI8NU9MzJrDWi5vSMeE2ueQexFWIAc3LFG2N19tjYh3V75g9EbU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945354; c=relaxed/simple; bh=OBqPs2vruTM3OL96Dshim5lAbj5UwzFAi7bwkUS4e7Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BJM0/lCsCVXtM5SLewkc1F+/xu3Cw/AiKfJjj1RET5gVf2fEJYIHFnYZc7EH4vCZ8sRVO+OBQlS7UjYxuC+uy+3qK+EgmDAtH2UR9W+xc1Ri+Q85HNnX0whSpmtuY6yzaL0ApawgKvyLr0xUUpkthN4obGk68M0pX5EpnaZyf+c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=B6uvb3dX; arc=none smtp.client-ip=209.85.216.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B6uvb3dX" Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2e2b9480617so368059a91.1; Wed, 06 Nov 2024 18:09:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730945352; x=1731550152; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4Nx9ez4yVW8aC5Yu+EVh1rahutankVFO3Y6fA2Tk+j4=; b=B6uvb3dXLORpQ169ecrnBX6ZNV7evXKWWoyvcstP4WpDcjb3teTW4g0bjDIT34bgEW p5k97dTwkCH3d4mEisfoWAUnV49iMK8UVgtf2KQRcDRxjM1/BYUC44p49Q2GR/Bt+9ea Su1i030pGHY1S2TjykqQZzAT9sdwer2kQt1VTwar4olZSmMPFB8v+SuKZVWl2rlPf5b3 +oMTGbvU9fw1np9MFgXUBHW1jC2w5PGt8S/M0pHTqfr5sf3W0egWDgKYWjbgCFf+I5Kv pola4+4moxkeRmGPqCdRssPQwz6KDiOT5ZSomziFphtUiMf1rEfm5B6HMcNh/JKia+4B JAHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730945352; x=1731550152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4Nx9ez4yVW8aC5Yu+EVh1rahutankVFO3Y6fA2Tk+j4=; b=jWExabSIJWj3J5Imac0f0KsLHseTGQh+b3cuNIYbPoOqwFS0Ly2GJE83bnO5myFD/1 IbXT6vsajxv/SyB+d0dx0khki3bxrCJUTa6OvHxq6VygPNm1LF2MMvWOTdgYAz4Gfmx6 rPU4WJpHry5aKGihgJELduXP9QAxHluG5wK6MADZSVzOkqXD3s87RdJ0bVJSTz8zG4Kh EzyowvB8Dg1Vb7Tbf9SMXH0eKzZ1665UQPT4+Bk8AUlmfOFNHbyMU0kpQrpgzJXW3B0o 1kC4YgA5AH7mO88CQ8AuZVx3Yf3bZv0w5Yn5yOBQ42d9CFN6s0NhUIh00HPItyr+ZMyH 5Ksg== X-Forwarded-Encrypted: i=1; AJvYcCVF5duUAqIU5Eaoo0llkpxiKnn+lwoBxJD400JREIBhcYHcKdW8wpg8UL1YA5kVsbxbLXALArQfrLO+ylN3ewY=@vger.kernel.org, AJvYcCWy1rm0Wm4nSRL/Jl71nzvS6BtOprVDXYtDsYFNIo93QjLrivA0+UMjHCOLQ/AMXOTbx5EDFBiUBA+HQWI=@vger.kernel.org X-Gm-Message-State: AOJu0Yz0nZEHOL6U9huAyBOWZkj0qXFuaajkPaTlGqDtSBt/4C48Lgpj K2UrDYVGbVzu0ZjU6eF0ML4lv6u6emzMX93+NCVozIEJhsjbugLYlo65Og== X-Google-Smtp-Source: AGHT+IGwkX9VXHWg5JhZIquh8ttvWcnn6ztjmcv84kBdIPJPBZSErxpXSOaLsm6/3r6YBiW3J8K9eQ== X-Received: by 2002:a17:90b:380f:b0:2e2:c40c:6e8a with SMTP id 98e67ed59e1d1-2e9a7657c1bmr255975a91.26.1730945352034; Wed, 06 Nov 2024 18:09:12 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f98b3sm2549916a91.32.2024.11.06.18.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:09:11 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: alex.gaynor@gmail.com, benno.lossin@proton.me, gary@garyguo.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, me@kloenk.dev, a.hindborg@kernel.org, tmgross@umich.edu, boqun.feng@gmail.com, aliceryhl@google.com Cc: alistair23@gmail.com Subject: [PATCH 06/13] rust: helpers: Remove mutex helper Date: Thu, 7 Nov 2024 12:08:24 +1000 Message-ID: <20241107020831.1561063-7-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107020831.1561063-1-alistair.francis@wdc.com> References: <20241107020831.1561063-1-alistair.francis@wdc.com> 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" This doesn't seem to be required at all. Signed-off-by: Alistair Francis --- rust/helpers/helpers.c | 1 - rust/helpers/mutex.c | 15 --------------- 2 files changed, 16 deletions(-) delete mode 100644 rust/helpers/mutex.c diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 875e1fed81c24..61ace53675c04 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -9,7 +9,6 @@ =20 #include "bug.c" #include "build_assert.c" -#include "mutex.c" #include "page.c" #include "rbtree.c" #include "refcount.c" diff --git a/rust/helpers/mutex.c b/rust/helpers/mutex.c deleted file mode 100644 index a17ca8cdb50ca..0000000000000 --- a/rust/helpers/mutex.c +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include -#include - -void rust_helper_mutex_lock(struct mutex *lock) -{ - mutex_lock(lock); -} - -void rust_helper___mutex_init(struct mutex *mutex, const char *name, - struct lock_class_key *key) -{ - __mutex_init(mutex, name, key); -} --=20 2.47.0 From nobody Sun Nov 24 05:29:58 2024 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1547C74E09; Thu, 7 Nov 2024 02:09:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945359; cv=none; b=QpmffLOXi25YwyZCFOqQHQr6aiFTbLbNjo1K/WodvOhzgLMTtfQfKJiR5i9/+lPDHNXi/hWwN3mab9/H6D8UBdWLaaw3KZci1StWTK/v7ecZRFlI5uidKQUiwVkl2EuskmO4o1Z4fh36GI8jVFUNIfE4oAF/jHWo0g48JnDGXz0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945359; c=relaxed/simple; bh=cYOpiQickTgC+Mplcot3xmEYlpUhGFzhNQSORbuD9Qo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mgb0nvjTz23b7gHRh0fsBKbYCXGDWcSH9ip2v9QUQcuOJMET2LNVBENA27QoMfgiWIrwB1O9aoIhjLpyLqXXI2K++VrOk8c19j+jISiZ7qfdklH5hqXuB3qzlwpkK7AZiUWURXBpxLYIz6ZbuLpi+dRTmtk7d7ZZW99FAPXqgJE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XaB5NgNn; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XaB5NgNn" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-71e625b00bcso269407b3a.3; Wed, 06 Nov 2024 18:09:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730945357; x=1731550157; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+XJ6HmFVVf2xmJmPPwMaXX7al+Tj25yJ5hDxjBV8Tlw=; b=XaB5NgNnLE03p4gppoTkSAhPAwU4wT+CkwJjT+qpY1lZqGNaTxPiwSiqmRWAxf7Lpt OHzfcfdoe+UYnofXHw6yP5jX5j5pfnjAaQn+QB2ldlSjOYKM2p8GHwg3D5xMiF4sYeqe aR1E32hUxykWO2j38CId7uZSgSkZFE2dskPjXb80XCYiFnkHA3pEzQHNOGOowx3OlBls 2LVyShKrpAZfcNNjCXUtGKO9tAgDwsvpIGbrzFNAYgarfpC3jpoLON553St8AosB+OC/ D6ro+fECvkEc7RBm/LPAFu3gWpyHeFr0FsldZPWvtqfMA7D0pRCZu95i9pICEpcNGaXj Cn8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730945357; x=1731550157; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+XJ6HmFVVf2xmJmPPwMaXX7al+Tj25yJ5hDxjBV8Tlw=; b=gAL5utt0s+neEb1mw3k9UxTsiz1g2YtenvCJsn4idP3ocwHdSoYxE/x46XIqJ/m0Qu i1T4PuubSRo1DlXHPctAq0zsQZ7syrILagBGBvA5ZgLHN0pdYYo31M9VV8jod7p98L1v Umpkqv5W5Nb/mXR1JGJWZ8mUjCnV9u6KPoc59FB6SbiJSPBB8o5fyg4gGOtWnBYt2CWR YjieusobdULMpjlwOigAitVubUWaA/lhSrjCp66osTkqfAAHZ+yAPYXTgnMd2usU8VT8 aPkmlptUZxUelZq6uKnlUj0xogyi+PJG3ocjlfQ4SapHaL8gK9ZBs2uWveSz28DUF4st sxQQ== X-Forwarded-Encrypted: i=1; AJvYcCVM/0ONzGaRO2ENJq+7H67vfw7cQ0XYegbeuuNg6Lhf6Ag46VJQDY967Vs+ZFG2A9KAqF8bF9kz5V4bUwfWMug=@vger.kernel.org, AJvYcCVN58tDR8BFzbaZIIY7jPvmW9Hq54skw8OYkkvenGETu3D3lMmqKaFuBB9YVYWykXfvq5dbjw80FAFwzj8=@vger.kernel.org X-Gm-Message-State: AOJu0YwE/jEvq9cdok3R7erwXIX0Yex5MPcwED7Vj3hlzKtoo7BwvDeP j9WNQd1XF0DeQEWdh3brQs5k36+IkVmUVHCinLCA/w4E51W9b7+3 X-Google-Smtp-Source: AGHT+IG8DYPEyNFVaTuvEL6a2qxV0/VVZ2TCGsEQfMKevTpVFyfjmKFn0mwWwWUp0QInffG27sfgQw== X-Received: by 2002:a05:6a20:d808:b0:1d9:76a3:634 with SMTP id adf61e73a8af0-1dc12964e98mr574349637.42.1730945357324; Wed, 06 Nov 2024 18:09:17 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f98b3sm2549916a91.32.2024.11.06.18.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:09:16 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: alex.gaynor@gmail.com, benno.lossin@proton.me, gary@garyguo.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, me@kloenk.dev, a.hindborg@kernel.org, tmgross@umich.edu, boqun.feng@gmail.com, aliceryhl@google.com Cc: alistair23@gmail.com Subject: [PATCH 07/13] rust: helpers: Remove some page helpers Date: Thu, 7 Nov 2024 12:08:25 +1000 Message-ID: <20241107020831.1561063-8-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107020831.1561063-1-alistair.francis@wdc.com> References: <20241107020831.1561063-1-alistair.francis@wdc.com> 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 --- 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 b4032d277e722..ded5b816f3041 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 ae82e9c941afa..084468123416e 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 b3f2b8fbf87fc..52ebec9d71868 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 Sun Nov 24 05:29:58 2024 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85CDC19067A; Thu, 7 Nov 2024 02:09:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945364; cv=none; b=G0IeYUzt9Si1BH0FgO9YggSF73/DN/jHOs4tq0h5NFh8Pq7C+RLuyBw0O70LnEWuZLmOifMsCrZROQH51+e4T87aGe6YX+icrTeOlEen1vQXIH+dPrhLoY7PNzZWOHEadMA6Q3QXcT2ENNamSuxSQcZ735M6lCyVzVcF7sCPfHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945364; c=relaxed/simple; bh=qjxRgkKubWCYQkrvHROpBnMJrHerul6P0ykac64JUmU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T8Aiw0FIgY2SRvXzK+bHzr64J1qlnXmgn/WIvPHHnrSXhA2wbUYxyO4p6na10E0evBP4kTli+HWCeTCJM7rBeZTpqHmptqGXtpbNl3L//49GE+OIKagJHlCPOFgnQrXi7KJSfVq6z2mVjnI/oBBeo0eVppj+kfzAgEzuhAG6QYk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ghVr9z/B; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ghVr9z/B" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2e2dcf4b153so354995a91.1; Wed, 06 Nov 2024 18:09:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730945363; x=1731550163; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K3xgszKdmXv5sfVpE8qDh7k9LEDdMG+JDVoZYiQkKmg=; b=ghVr9z/B0UPhKhBttSqzrnFCwnJpyfeUn7Syomoo6IHXesoy21cy0OR9buJnpCmhAs k9fU5GkfWuw2UiY3zXvOdPcrz50vWm8amym9RypbUUXQSRrLVzl2Yz7zqWqztQkIc7ON BYmXSWgk/LomOZer1ODareKyiXIh0snLIbWwF7oqyQgFzAiz5bS5fZrcaYIIeOZeW5Ui ufEaNgsemPk8OlSZtfyH/QSCORakKFh5m/4IZEpeaHRrCx8POGaEbMnp+Uc4ijY+MOEK fxdQinuqaDcx/hITHDYfdS7I7J43rbSY14sC0wyPsqJORVC12YjSQmNdGOFF1hN6JF0n LTAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730945363; x=1731550163; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K3xgszKdmXv5sfVpE8qDh7k9LEDdMG+JDVoZYiQkKmg=; b=iUEq+nOwbctYIwFlQhpvSTOiRxe4Zzy6s7W4qCa2zkMpGp1rHO0tlSIJwwN8l7NP9w +CMiEtGgNagypNOcBZkttNFXnjoa+ylBX0nEvhnb/sT3DBJLeMwUHDzgUjD15Ie1hMsW pjzMwSrSzOtnDq6asop737cpuAgWfM5f5XTSfUS8Fk4nh2u8x7tsWCuUwJ1lf7eJ15El C3BcCPmhF1Sf71YtRyCrp9/lByWTDZ6PoVqoeMMnulE5734dgl2RSGRNlq8ObkL3Oy9t BHrxkNm+DK03TM6+9ITR1WDBHzpCVTZ1il1suQXPLLJNObe+IbdxZgzZgpSHNaPzjCl/ S+NQ== X-Forwarded-Encrypted: i=1; AJvYcCUUTtnVHUhO6tBXEaUmRpSv9lADTbZDZBXaEgGk5PfL2ok/JPXMxjz2qACxrgvNf+0GUvaDhCqr8eF+KSc=@vger.kernel.org, AJvYcCW0RaKYPP646lH0rb3cgImkpSGe8BiIlNBF4+E1AzuWU23UvrNN7ZsK1VCTq8yDISNgwTGFlWoFYOdUG6wj78Q=@vger.kernel.org X-Gm-Message-State: AOJu0Yyw+Zj9rjTsCXfN1iPT5dH0xJGfs6qkWD7GvK12da4YGJgynVyd GevPd05aHAyp8laU7VvkHbAOIfNvBbIgcEExBPVRdxW9k5yV064X X-Google-Smtp-Source: AGHT+IHmqdGbNvIKFonBqecHGKg3Y6Z/I5/bs+3uLSpsKKdBupDkxHpj5emo8FdIS6r5xt3bM1h15A== X-Received: by 2002:a17:90b:4e84:b0:2e8:f58e:27bb with SMTP id 98e67ed59e1d1-2e9a753b70fmr273600a91.8.1730945362776; Wed, 06 Nov 2024 18:09:22 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f98b3sm2549916a91.32.2024.11.06.18.09.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:09:22 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: alex.gaynor@gmail.com, benno.lossin@proton.me, gary@garyguo.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, me@kloenk.dev, a.hindborg@kernel.org, tmgross@umich.edu, boqun.feng@gmail.com, aliceryhl@google.com Cc: alistair23@gmail.com Subject: [PATCH 08/13] rust: helpers: Remove rbtree helper Date: Thu, 7 Nov 2024 12:08:26 +1000 Message-ID: <20241107020831.1561063-9-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107020831.1561063-1-alistair.francis@wdc.com> References: <20241107020831.1561063-1-alistair.francis@wdc.com> 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 --- 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 ded5b816f3041..e464dc1f56820 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 084468123416e..d389944186479 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 61ace53675c04..7f9ffde471da3 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -10,7 +10,6 @@ #include "bug.c" #include "build_assert.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 6d404b84a9b53..0000000000000 --- 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 Sun Nov 24 05:29:58 2024 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE06F80C02; Thu, 7 Nov 2024 02:09:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945370; cv=none; b=PkFhsY6rHa+RwhEu5u7W28MBYCwJJzzTmZSHghHUNNumnTrorKKTpMCWe2SlaiPJEorztL4X5oiJdf6RtYtrf8isrPeLKuVnUhgED8AZgRO/y6UngcUAHWgy0hZjA6ibjIu3A8/wdC2AhrAcKnqMBaWYetSolsCgo2/RBFfm60U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945370; c=relaxed/simple; bh=THALx6/SA7vgMB0fNthGERaMX3KtQjTrr06oy67fAKs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f2+bPnzYdn3/qsNn+Rcr7DqJf+ubWBTFfSYE66F1mkU9ZyGuxHLLgvLvxohBLGYFQlsxOch4+GngBvUslalT1SJEyQ+Vsg09F6hXTwUn1zM/8WL7LPplsg9SxFz8tW9FlY5MYb2VmmpTFL0ReMHWvIPTnjNz1WCKqdbtYPeSm0Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lSLMN9Rk; arc=none smtp.client-ip=209.85.215.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lSLMN9Rk" Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-7cd8803fe0aso356178a12.0; Wed, 06 Nov 2024 18:09:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730945368; x=1731550168; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yJCHg6qrJs7dLJIvcvqQ/vPlMx9LG52SK0oqQpnSpq8=; b=lSLMN9RkU1IPej1lxYN8vE54EE6Fxduruxqe/0CiGL+AvowIG0p5FALMPHx3OAcKZM o3o4utAbPFZWWH77gpVky45enNqvq5Ixh0Ole07z62N6BRsctrEBhucTMlivVKsEiekj jjkVWnWLtp704L7fimH4D7WEN4X0cdfVWbiYYvkm6iJ01bD/UF87lUo4mYLB6qIwciTN ENa1SNiHlOYlb4euMt3yBAv/nvvkDzXzPAmiNpOSqwqu8UHWfZE26jmfIhJ/1DMyIfus gM8XWrrstpLcnpdaEjEJckWxrTVKZRdkCDMk+9XX7S5N4Jy2EvQJH1SI0IDFbwa0d05/ CRMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730945368; x=1731550168; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yJCHg6qrJs7dLJIvcvqQ/vPlMx9LG52SK0oqQpnSpq8=; b=WsmicePS91v7BOYza0Bzg565UVMipFmddECz8HNlWWZ/xhnmIFmE0rzibDX4otGknl NWR5ujnbHmjC2wdhMQ+zVEZKq1kXbjhtbUFdHV6Rn8/LwQKZ8fiIAd2adYtbROr/oQsL mhrHcnsuA6jf/4jhyh5WbXNWh2Xk6kWA7Gkq996pRzcUgHbZZJ5YXBkugWWd3bi40UHr yYvVIyFAZa1OVRCoxJMKf/m48JMIyo3kwa4G46BRqo6IxnpEz/LEvPG+izB/Udbf15Hu 3tV+qskwBwyauEMZD26BHIir4UvrPF03ZZ/mWXjW+l+qvHd18kBq/gey8VLV0JrcxkmE NgXw== X-Forwarded-Encrypted: i=1; AJvYcCVZIQjUgVjRW2Vea3PKeB2+hClZ++4A/wF6WGfKN1tRZyHQjD15ltC8h/HAO5Ju39UZ4RDvrFCvTa+2zpm9JMU=@vger.kernel.org, AJvYcCX4bG7HQk57XrnWmq7b0u/oux/cc/iBPuDPqC1BNBIpSfu8nsSiXwUzyViTxPfnhgAOfn9ZiFMdoApsCUQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yznh01RzCE8lvc3u/CrTgl5UsdABVQ2cyrRzK7H4S6c/SZzSUbS acLWAi1faA5e7y9W0I4zm4MV7dYcnUlaOHv15thKuld9EfE8M15D X-Google-Smtp-Source: AGHT+IFLMcVJEIOuBfmHaFdH/TIIaN0pvetOd7shLa7fFrSkeovH2ekptGpT+dQ0JOMrwKIuXLm0nA== X-Received: by 2002:a17:90b:3c49:b0:2e2:ad11:bd36 with SMTP id 98e67ed59e1d1-2e9a766ad83mr239868a91.37.1730945367978; Wed, 06 Nov 2024 18:09:27 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f98b3sm2549916a91.32.2024.11.06.18.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:09:27 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: alex.gaynor@gmail.com, benno.lossin@proton.me, gary@garyguo.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, me@kloenk.dev, a.hindborg@kernel.org, tmgross@umich.edu, boqun.feng@gmail.com, aliceryhl@google.com Cc: alistair23@gmail.com Subject: [PATCH 09/13] rust: helpers: Remove some refcount helpers Date: Thu, 7 Nov 2024 12:08:27 +1000 Message-ID: <20241107020831.1561063-10-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107020831.1561063-1-alistair.francis@wdc.com> References: <20241107020831.1561063-1-alistair.francis@wdc.com> 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 --- 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 e464dc1f56820..9c40a867a64de 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 f47afc148ec36..cebdeebcfd08a 100644 --- a/rust/helpers/refcount.c +++ b/rust/helpers/refcount.c @@ -7,13 +7,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 Sun Nov 24 05:29:58 2024 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11C6380C02; Thu, 7 Nov 2024 02:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945375; cv=none; b=OhLGDHehqnqep+GPpfVO/5C17Uehm52Tae1mWX0HZ5P5+TG3YgkTVNjIGUmnUKDhp60jkZZwYJNpqyKcfoa+/1Bb1Yefo4oxl0ZpCnxvh7nSI9TsSX6aZh5SORClNJ4Q4qQ1JPABhukIhjZeJRSj/XGNIzvAwj56THmFvkrMTnY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945375; c=relaxed/simple; bh=Tc+qbROOF9FBTJbUdLKlSE5dyzIjPB+y2qE6X98QIAQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LBU5Zk3BnzB45P27eLeWE91TLo1KX83fnZhDVWQmZyAJgZqECOZy8vOXLNpMIqwl8+PyZ6aggBEt4AqseLy32iXz3SS7bmfVW+S4OuMgSXLkLQlKY4HoQixGcmlzqn/DJmHTstdsdpsOxXWBXxM7YZ/Yhe6NGRg2hbuBBegjThg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FrWjbV5Z; arc=none smtp.client-ip=209.85.215.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FrWjbV5Z" Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-7ee11ff7210so375195a12.1; Wed, 06 Nov 2024 18:09:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730945373; x=1731550173; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ym9ZGogDAflbJuvwnxTT22F8uqrqymxKBz2B20yPLJM=; b=FrWjbV5ZFXKoQZL6Tbq++ix5EzUS0pprH8TGhT7On+yoFcKk7uuuOndsCAotZIZt4Q yIhuojBrGqprszkhq9Dgzj6Y9PZMXqZJaOzLjHR8BcvRRg8mD+qpFYJwPeHx/WmbAIGm 9EyFRMYUuuJ0sbqh4ui6xSErVLGZmo4MRX6fU1mNiwI9B67yd3pX6jmdj7F+XPKBGYeT IVOgCc9olIjQyHlDW9/WLK/LQORrc7TZLJjaq/cmITka049wJwGku8nux5yJOEViyWXN JgI2NUsr4Qr+3y9bA3e/Xlv+EMICGOdkbROWYBjtuLUxvq1Quc8t4ZlV9nD/R1UCTMNA K0bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730945373; x=1731550173; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ym9ZGogDAflbJuvwnxTT22F8uqrqymxKBz2B20yPLJM=; b=hMHYj3mq+oAoFTi3YV3dpAREaYi+hD9lU2of3GF0gl4T/0/iuOhDvsvg0ssLDdQyt3 2e3gSQVpvHZJPhQCk19lY0PTwvhZbgec6cI4L7TBmYZSsUY2qc6UYAvz1JRvefn5kAkq VDOPQc6FN5hH1K9OT5VNygSE4aMTqjuJ/J8VUiDK6W3snsgsS/9KymZHaa+x+Ma/3SMA amo+XpAEegLgoMLkNMf/sVX8frFg9TU/+XhwfdxKSFKGWwOqU8SPc/i/yetTLw7PEOEr bloRRmFn4xGzktoT7bx+kwiMcpfh1oxkeg+zO+QCtidt+wlth/8U7Af2hVdV6Z+tMn1L o1WA== X-Forwarded-Encrypted: i=1; AJvYcCW7ZL6T+BHe2gKw1z9nNUleI+v9n8sw3mpndoGXp3bYID3ho7Gg1DNtsdbS0ixDdDkP6lMYFvSdYuUiCroDvEE=@vger.kernel.org, AJvYcCWJ/mk7XA44xF26DTtcocHEXtENQvYg1wQH3Ech9ESvBpcogqqIFM7I4f5/LDOTvpVefrtoHe0njn8CfU0=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/swd+Uh1R1V59ZCoOgkOz/kt+F5646UWR8Syxd+cuNilgXc0k BCUaKj+KgUBuJulRwaHpU5Tn5YajptDzzchRbHFv33LoFOxWg3X389cPpA== X-Google-Smtp-Source: AGHT+IFaCGPSOWvlki0vXU6yv7DWewU62mvecXCmuZ9B27hlwcpB9u8kU32ziOaI5DGCp7BEqt/nzQ== X-Received: by 2002:a17:90b:4c11:b0:2e2:e6bf:cd64 with SMTP id 98e67ed59e1d1-2e94c2a15e2mr30870329a91.5.1730945373244; Wed, 06 Nov 2024 18:09:33 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f98b3sm2549916a91.32.2024.11.06.18.09.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:09:32 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: alex.gaynor@gmail.com, benno.lossin@proton.me, gary@garyguo.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, me@kloenk.dev, a.hindborg@kernel.org, tmgross@umich.edu, boqun.feng@gmail.com, aliceryhl@google.com Cc: alistair23@gmail.com Subject: [PATCH 10/13] rust: helpers: Remove signal helper Date: Thu, 7 Nov 2024 12:08:28 +1000 Message-ID: <20241107020831.1561063-11-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107020831.1561063-1-alistair.francis@wdc.com> References: <20241107020831.1561063-1-alistair.francis@wdc.com> 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 --- rust/bindgen_static_functions | 2 ++ rust/bindings/bindings_helper.h | 1 + rust/helpers/helpers.c | 1 - rust/helpers/signal.c | 9 --------- 4 files changed, 3 insertions(+), 10 deletions(-) delete mode 100644 rust/helpers/signal.c diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index 9c40a867a64de..407dd091ddecd 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 d389944186479..0c2964db04076 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 7f9ffde471da3..2af11499da454 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -11,7 +11,6 @@ #include "build_assert.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 63c407f80c26b..0000000000000 --- a/rust/helpers/signal.c +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include -#include - -int rust_helper_signal_pending(struct task_struct *t) -{ - return signal_pending(t); -} --=20 2.47.0 From nobody Sun Nov 24 05:29:58 2024 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 209D380C02; Thu, 7 Nov 2024 02:09:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945380; cv=none; b=pKdqxkVYDBtCxvUX702nrXcl4xwvVvp448ZYRPmTCbY5n7ahVmfcneWESClI+7jMtHQGbebb+YZz8YmzzdMR7pJc4l7XVbv2w+yjWvXSEjLsz2DOtnqoBV25L+g37bQJpNi+848XnfcUcfrg8beL6CQI50XdeyHzKr1e+fvyuh4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945380; c=relaxed/simple; bh=bamIKhQGaYDy9tVbD7L6kZBTFXDMpDQUiSo7PCsaEVY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PRLyNPMRs6i1LRYo9sumBEIyQ4xe7csWNyKgBeNztXLjjfOIa+qSCClwde2+rtUzl+5Wfledj3FkoO88oJhQQ0wBE9ixvaD/4WdDgvFSIITR2UxHu43xou9o4ARUMEh8JFkig4FAGxvpKE5gTPTzxy2Jh6e56i90ykB2WEQldto= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lmzdGher; arc=none smtp.client-ip=209.85.216.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lmzdGher" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2e30116efc9so363716a91.2; Wed, 06 Nov 2024 18:09:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730945378; x=1731550178; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uRzuDEr7A4idPLy7mCCT05NiWbGj2K8HCIaGJ4K0ZiM=; b=lmzdGher0rkFBEUHzOu12sbbxs/gi6GCcHLvjmZ0WK+e6BtyiXjZX9cV6lZkBwZBkW ZpEHmXTs2dlzwFw5FJGRiZu1ocrXd+qugL3IGc1Je4c4YjZIbRjBzCj3AfK+ZB66YcNY h7AHnrOyMEVV+9oNRSnT45wDOTqHblXdXPN+9dU5kY4UzFg9eh3zFXiUQYxYf8YkZelN l0W9qzt/IYwXjaZCgKtueB8pRtFAt0cU/ia9b3w8jJPfAO2pJl4IHupeXq8Kvy8RI0R1 qQwTU2AjiP3o2n6MXrvuP8bKMJzHHdgKoR4HTfzEjeM9qtVsnmqk0H/RJBfTdhBIwG42 vOTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730945378; x=1731550178; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uRzuDEr7A4idPLy7mCCT05NiWbGj2K8HCIaGJ4K0ZiM=; b=xT/tUNHUQe50Ew0fmG0s5LXFWIamwlqLaGLvLkDSsoU7rFNAYywI/kTQdKZyFTofvQ 7EazyOzgyb/Osght9Fm6Mi8shmPl+raKwsYOCRL6UMB+HWTU1tFjTfJGdm1DJjTU8Yl6 wyB+maROpT0/Lc6TIosnjjZNVAGINhgNl6NSwMDoniDl9T9Cm3AMAVcMqv0J1P6KM7aI 9Vt1O3SGagfkiiYc9Qk8eU1G0Kk4DIYz9gmQ1LWs8h038VlJbxK/6lAUAINtS9s+cqm5 K90zFCizNEH8lLOPMHI4tjBh/bBuUkIZEAkZYU5xCAxKtBzHJxmPJOVe9x+jDjl4evsU p04Q== X-Forwarded-Encrypted: i=1; AJvYcCX4uhPW+OJ59NST7d9bAxU/QuhqY5+5C/ZCF2d7+me/mvkJIS1DiL5m4iVed7yrCwTW2r4H0C3qtKfkkoU=@vger.kernel.org, AJvYcCXJJ7pphBAC1kSl6kCIlE3RqZqpJRmIRvyEP0Iwqpbg6B1Frkwr7C9z7AeHPEl0UuXvWu87LesrJ2T4ZlRV+uo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw58MUutCiqCTclZgowlxaC6b5xj771kM/SA0lOrZ8E833U1M/v RMFEEJy4XyncMQ4CVZC6LjbsIjCk+KG6/botTYQLRY0DffwzNJApBv9L0w== X-Google-Smtp-Source: AGHT+IH9EkHWCEqxJIu4iMLeVR6O1tdOgBpUGX3NHXc2bMxEN2D2DyVLDXTNvkYt1Mo6/2fGRSqmzA== X-Received: by 2002:a17:90a:e154:b0:2e2:e148:3d30 with SMTP id 98e67ed59e1d1-2e8f107354amr47474173a91.23.1730945378421; Wed, 06 Nov 2024 18:09:38 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f98b3sm2549916a91.32.2024.11.06.18.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:09:38 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: alex.gaynor@gmail.com, benno.lossin@proton.me, gary@garyguo.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, me@kloenk.dev, a.hindborg@kernel.org, tmgross@umich.edu, boqun.feng@gmail.com, aliceryhl@google.com Cc: alistair23@gmail.com Subject: [PATCH 11/13] rust: helpers: Remove some spinlock helpers Date: Thu, 7 Nov 2024 12:08:29 +1000 Message-ID: <20241107020831.1561063-12-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107020831.1561063-1-alistair.francis@wdc.com> References: <20241107020831.1561063-1-alistair.francis@wdc.com> 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 --- rust/bindgen_static_functions | 3 +++ rust/helpers/spinlock.c | 10 ---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index 407dd091ddecd..0bbc358d03e61 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -20,3 +20,6 @@ --allowlist-function refcount_dec_and_test =20 --allowlist-function signal_pending + +--allowlist-function spin_lock +--allowlist-function spin_unlock diff --git a/rust/helpers/spinlock.c b/rust/helpers/spinlock.c index acc1376b833c7..fe85d6fd66016 100644 --- a/rust/helpers/spinlock.c +++ b/rust/helpers/spinlock.c @@ -12,13 +12,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); -} --=20 2.47.0 From nobody Sun Nov 24 05:29:58 2024 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8576779F6; Thu, 7 Nov 2024 02:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945385; cv=none; b=ouLg6I7SSUJCYsQ5PAX7k6+UAwVJqxt5QIh01v5qkIqXsFZ48L2PiiKsMS/qY8aGhIN6RouWpkYQqrGvgtlkK0n2gTj8r/wKhYxFOGTiTTjuKyome99Ji++rXEMyMDRD5gVtW7hSYT1vYTlHOxapyXeNRw8/wJFH7MmotZXjWzI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945385; c=relaxed/simple; bh=VwwQiqx75FPKc+KrOJumAj/W+xlGINorBGM0WEBiXm8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X6ukUiVQbqj3Ft009s82TvDq8xz3w+TTLH32C4kfCz+FJiqePIFmFsgRQ11HoyqoD3RxKZ/mfWqUzOehkqiv1w7M8b2/1Gqngbh+OyXa7wiqGQCgbdzgd6A8geGWBP73VgskgzgAR2sOg56ioieFHyjgV6wcyxKi49QVnF32taA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AWwlcjj3; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AWwlcjj3" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-2e91403950dso346672a91.3; Wed, 06 Nov 2024 18:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730945384; x=1731550184; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XxjO5kT9xqDjdNWGFnRQbGm5wL4XmvNh1k+h89GT8J8=; b=AWwlcjj36KJWo+uO8YaL2SXQQRqH8ex0nJIbbHnHT72DLIazfEACcIVBoQgiy5k+rV cTxCqD5ErYwiMLSB0Z4l2cjX09HPKZaYBG7tn605Ij+b9PiPfeShpMn32xHeaC9gCV9r Zwk+AXXnshUuep6amlOcuPuEr22U/YVmqBF5t9WfVtRgFHO7kmJy51BsShAToLkUkna9 uAwLWqOlieYNsSZdsioHKn2aoG3WW0wcVm32uI2ETQWeXq3Yvg+HlJheGUAqFm6UMKco BJ6/gs3b2EJC7Fe8aE4wcJ3TEKPHZUzcgP7yXeDqPFjiRH9iBXya4hqXXe+4+6EOKYDw BlNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730945384; x=1731550184; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XxjO5kT9xqDjdNWGFnRQbGm5wL4XmvNh1k+h89GT8J8=; b=rEz0jAwrEOtU6Hs42c79iTiBvWxrYGRyVj+w4nsMLDr9z3S9XaYkaHaODJFH6nm9vP UYR40QT7zBDjuSM1JNScVCUVYxgPvltRu2ncmPlFIS2AAarLt8IMkJ7HuMFjzmsAdYJG 3wZRyERfBQmi7vhUKEngWNlZ49teYQLD0cuBrtWPmTfm4HHLBd7TiNgpyyssfYVFyAkJ UsDGJQm18Yan5lyDO4VLUJBwUuDIzVez6/ByzxtlF47SclgZHbLgEUgPciFQPNXdJ9U3 cVRcHO2B6yhxJhI4mWgKMPAdfX9IjJUBwBZd0d+AnXnf8j8WB5oina1mfcHTPwLsu0O8 +pGg== X-Forwarded-Encrypted: i=1; AJvYcCVq7IjF2sJkw6q4K10SLJSJk9R8xZjO7DfK4rXtInWDGR5+LNDCP08L1T4dDTejBmwjN0fE9rBiJkz3SNW2BZQ=@vger.kernel.org, AJvYcCX+E3nMlvkbT1dUmiidt8T9tKyGlQoyvTDIJ/ODTcAZH+COS3bgCVbvwMaL4QsCBcEGt9bAvy7bcwxsY1I=@vger.kernel.org X-Gm-Message-State: AOJu0YxWNaWRLrc2dOqIzsW7EZPvEfr2U9QgIsg4CEOq9CghnRch4Gz/ o+hz1XXPa+JQq2EjfJYV7TWxVUWD5bpLQYxo0MMvB9FlqNMv/PPV X-Google-Smtp-Source: AGHT+IG5JhKhTZ2nL5vGnmSxNlVOw/ax+JU8vxj3OAVEHgqORyHBkKgFJUYthcI4/2ECoHVfHP8FSg== X-Received: by 2002:a17:90a:604b:b0:2e2:bb17:a322 with SMTP id 98e67ed59e1d1-2e8f11da738mr42285982a91.35.1730945383594; Wed, 06 Nov 2024 18:09:43 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f98b3sm2549916a91.32.2024.11.06.18.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:09:43 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: alex.gaynor@gmail.com, benno.lossin@proton.me, gary@garyguo.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, me@kloenk.dev, a.hindborg@kernel.org, tmgross@umich.edu, boqun.feng@gmail.com, aliceryhl@google.com Cc: alistair23@gmail.com Subject: [PATCH 12/13] rust: helpers: Remove some task helpers Date: Thu, 7 Nov 2024 12:08:30 +1000 Message-ID: <20241107020831.1561063-13-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107020831.1561063-1-alistair.francis@wdc.com> References: <20241107020831.1561063-1-alistair.francis@wdc.com> 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 --- 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 0bbc358d03e61..396e2eac88e5c 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -23,3 +23,6 @@ =20 --allowlist-function spin_lock --allowlist-function spin_unlock + +--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 0c2964db04076..1d1d921fd55e9 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/task.c b/rust/helpers/task.c index 7ac789232d11c..a3feb47a6c73f 100644 --- a/rust/helpers/task.c +++ b/rust/helpers/task.c @@ -7,13 +7,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 Sun Nov 24 05:29:58 2024 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84BD4199B8; Thu, 7 Nov 2024 02:09:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945391; cv=none; b=Hh1cwaN175/InnjNlWtDIc+ancF0S7LDhtTVhryZvgNqlCDtHIy35fPcs5gkBzrsxVuRAGXruU6SHaOcdGes8W5bOHJ5jN4eOgkQX42ImAW7eQEclf5wqdM+B9ACvExI6KYED2tbdsOHmmsq8EhntU2ps3zPXLRANgShRiAw1Tc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730945391; c=relaxed/simple; bh=syE8cZwDU96+7tIa5CPui+HF8wNNyg1P41xkOrVboHs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GHfbYrVgkTfz4/X67azZ23FZ27jypAoIEkFRqfOkiRkIIa7FkDT2fqk7w6eQtD0ctAyNn7LtzMXD0A3VfTT/0POz/RLcdLytyKK+N2cwB3c9tazQz7nXUXgBE0MWGCKY8kiQziI7COIcKllO+/vZhT1rcufyCrbBBV5p7ifPfOI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eKCS0T+v; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eKCS0T+v" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2e2cc47f1d7so384677a91.0; Wed, 06 Nov 2024 18:09:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730945389; x=1731550189; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KgxYLjSSYW2Ak/A3hPz/wNZip7cxIocJdeeQ6JKJEJQ=; b=eKCS0T+veHRI39dL6gRAnI4x7lGmxDS8UinJg2+ur3Gp3Oh6MXXnT4fB7I9XpdFbyq arI6+RMCKc7nEOKR9Y40xgf63NpvZSAFO7/nIhoI0QBZhNa0Mt9fqgHtCNMreALihnai JuIug68yZeWZd5W1DRYMsIfNdk0zYV6MO05NaRWueT9qp2HFgjzs6Lr6TgGRAvHMnNVG VKGnbCK+AydoXzmDLkQk1x4dHv8i/Zkx91devN/vTVPE9bTzWBgUhM9HUZXo6OYwnaJV YIiCaZIJFppXOqSNfFelGRevz87pY7yMtq7Tb5ginx6Xdzdp+VqLvuoglROSACIkA8PS XtuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730945389; x=1731550189; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KgxYLjSSYW2Ak/A3hPz/wNZip7cxIocJdeeQ6JKJEJQ=; b=wx8sVS2NrzvDKY3rtMVGoZ0T5wvE6COfUTkDctPWPAObMa4ITW2BYXDrXQCX67MNv3 1kXTnl0ctmkjzO7HOgCA24xbAYbRYsqlVr1PJj+ZnO1xzG7PYk6pdvNrFYpPf2PJYyTh 4PmJbcDTpRHAW/at3dtVW7vT7WUn8fUXg8mc5eNUKCjgfmyAUhkS0oceH7pnGhCCoVew Qv5Q4dPEQvRcTRIdTBfN7+qg+A68x1AwahIhu9ZxsPxnocEBhhLqP/5+uETo5oTPKFdH NpYPLtQR5nWhkRE9XnyO9QvYII6v1mNfgwI4n3fcbXzlI+YaMyKEq352D7N0I9ep58qi j7jw== X-Forwarded-Encrypted: i=1; AJvYcCUKZK59ofWNL9NFrFcEeB/1S5v7VgjqaKXoZ0pWRhVRmYKKQXPwQoweiH4mM4q12OmmCv7ZAGKe0ZUK4FQ/pVY=@vger.kernel.org, AJvYcCVObjkFGhinJL4JouaOL60Lpy1z4ZpqemxW+MsYghlIKn5WfN4/gsfIZw0etSMkSV8h9gJBmPehXH1zq0g=@vger.kernel.org X-Gm-Message-State: AOJu0YzGtF4aMrEQJT8SV3xt8hTrxKwFaKHdj1ftchIR+Ro27fmVBqA5 2XzR6Lo8H20jhL2isBGnNHn1wv5NEU66rjHkJtCOe76AlO13RONH X-Google-Smtp-Source: AGHT+IGeEkEOkIG/ktoKXUPcn2vTiYDT5t2Eh92LTMLlT9gT9dApjI9vpL+haMX7DpUkGaUHqrXYaA== X-Received: by 2002:a17:90b:3c0e:b0:2e2:b719:d582 with SMTP id 98e67ed59e1d1-2e9a4da8cdcmr2448298a91.14.1730945388846; Wed, 06 Nov 2024 18:09:48 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f98b3sm2549916a91.32.2024.11.06.18.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 18:09:48 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: alex.gaynor@gmail.com, benno.lossin@proton.me, gary@garyguo.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, me@kloenk.dev, a.hindborg@kernel.org, tmgross@umich.edu, boqun.feng@gmail.com, aliceryhl@google.com Cc: alistair23@gmail.com Subject: [PATCH 13/13] rust: helpers: Remove uaccess helpers Date: Thu, 7 Nov 2024 12:08:31 +1000 Message-ID: <20241107020831.1561063-14-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107020831.1561063-1-alistair.francis@wdc.com> References: <20241107020831.1561063-1-alistair.francis@wdc.com> 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 --- 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 396e2eac88e5c..4807fecb2f192 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -26,3 +26,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 1d1d921fd55e9..600ac0046a95f 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -23,6 +23,7 @@ #include #include #include +#include #include #include =20 diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 2af11499da454..e4e42e0ef946a 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. */ @@ -14,6 +13,5 @@ #include "slab.c" #include "spinlock.c" #include "task.c" -#include "uaccess.c" #include "wait.c" #include "workqueue.c" diff --git a/rust/helpers/uaccess.c b/rust/helpers/uaccess.c deleted file mode 100644 index f49076f813cd6..0000000000000 --- 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