From nobody Sun Nov 24 02:57:35 2024 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 35D7523AD; Fri, 8 Nov 2024 03:10:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035430; cv=none; b=eu6qxr6Es4UkS8O3h8jhmuoCJ8xytDzOcSN/UjvwqbWxRoaibDuYsdfmuoAEv9pWVx14kNytO74zbHTCzSJWEpok4zBWVfD2y89XqR33Sovkq4uoqHSINXpqUyc5cLsryESoTJtR67ZsEOwKG1ZMLAAOUPkRsA1YGeQ9F76uTLA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035430; c=relaxed/simple; bh=6SS1RZSKcjrsUA3ksNnohQWZW45NDTHeAxjvxDp4z/0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EJuylciSjgBx7lwYm0dlCSUqMvSEQB3YjzHS25hEnVM6qj4Uj4HtNw0kdbLhex4XnKKqrkP3RniRD096VYbG6XmdhsByy6tcHsSyUaZkl0JkDdzx1Vv26x5M97laK8h2xLau3T1GjtdeaT7Wy81zm5H6SgSc/kr11mCLOqdiZ9A= 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=DoeiEXZn; arc=none smtp.client-ip=209.85.210.170 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="DoeiEXZn" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-720d01caa66so1544569b3a.2; Thu, 07 Nov 2024 19:10:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731035428; x=1731640228; 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=eDQ0KADemnBAoSQ02FYC88DqCdRiw7yhsS4btgA76rM=; b=DoeiEXZnmwOGQjYPlysInjs6RZfg4oVG8hnBubzT8R7JMGfb7PYUQ70W8GvrC/6CG5 6nO/JW3q1PxoBcQcMUbl/hWeCKQU6jXxFdyKtE5wJTqWiMzOJ3qvHYM3U0+nDcd/lcPb NYy6xrY/MrHvns7A0fKOi66mT6cJiTzRE1JlJHaB3fKOYJgKn7RV7dLZ52JBuGBjfnE0 MGVKc4D37JM0i35DRNvoJyOnbWYnf14juCdctMfzuDdB233l2YFLijPgxsUivdK9H7za eNNi0Cxn5TqjLfIEbdc/jAz47sJhHwyiWgNi3jYGk9u74eUORt2vLqVLgRFsBD9Yt/SA keRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731035428; x=1731640228; 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=eDQ0KADemnBAoSQ02FYC88DqCdRiw7yhsS4btgA76rM=; b=PlljV3st6Zdp6wMOe+9bpiio1SKzMEA744hIxZR6RBPtF7sDLSY4nD8LfmPoWcRYQY +axijL2+DMeiVFnGGRug3l9+qyJDRSmoUmq3ym8UKBkoMdnZKY9zlKSVFJL0c7/PYpgi YkNXjkvjCHaSmz2PqITDa7OosJVAKr/5mCPNJj8+p9Lob0xHbu81uEhsiNWPergyAppC s9QTJQfhHe+YRJl097loObNUnLscBGqxo77lNKZCmHGQfmIZJ/CQNz9yR1W/dPihvAmM 5F4e5paodjbJdbTwMaWNcCwuQm3RjayPcJTAz34GaWdN8SDOCIEknohir66mCVptyC3L O5BA== X-Forwarded-Encrypted: i=1; AJvYcCWH4lAaMTta1jFnkFCJ4/5Y7nKzpZb4vuJgFlgvN7oEPRLBt292eqs5H0XcGuiul6EwAgIGvM+OnHKajvGwX98=@vger.kernel.org, AJvYcCXhPBPpiJeIXxdLKACsiXiU3E8lDkBLOKTTvxLaU3hY6d08AsS7NWclHZVXGQbkxnaAZbfx75Zb3KavLMA=@vger.kernel.org X-Gm-Message-State: AOJu0Yys5oPo1ze9JTuu4cIGdUxBq8Y99l16xL7ksn1LPCz/bIXvF2Cw S8p1ROB+KwW4NqHixtOX8UVctaK+Tcmmey8wa0Du5ktB/6o4o1K2 X-Google-Smtp-Source: AGHT+IEtnE0rnqVeBGWEQ/ndWnfZf8Wqrd13sgNHYHGDNOrnwqftRron+Wn5XT7hBhNEJhOFw6bG/A== X-Received: by 2002:a05:6a00:99b:b0:71e:4930:162c with SMTP id d2e1a72fcca58-72413297235mr1696240b3a.6.1731035428181; Thu, 07 Nov 2024 19:10:28 -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 d2e1a72fcca58-724079aa86dsm2589816b3a.127.2024.11.07.19.10.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 19:10:27 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: a.hindborg@kernel.org, boqun.feng@gmail.com, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, rust-for-linux@vger.kernel.org, me@kloenk.dev, benno.lossin@proton.me, aliceryhl@google.com, tmgross@umich.edu, linux-kernel@vger.kernel.org, alex.gaynor@gmail.com, ojeda@kernel.org, gary@garyguo.net Cc: alistair23@gmail.com Subject: [PATCH v2 01/11] rust: bindings: Support some inline static functions Date: Fri, 8 Nov 2024 13:10:02 +1000 Message-ID: <20241108031012.335203-2-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241108031012.335203-1-alistair.francis@wdc.com> References: <20241108031012.335203-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 | 37 ++++++++++++++++++++++++++++++++--- rust/bindgen_static_functions | 6 ++++++ rust/bindings/lib.rs | 4 ++++ rust/exports.c | 1 + 5 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 rust/bindgen_static_functions diff --git a/rust/.gitignore b/rust/.gitignore index d3829ffab80b..741a18023801 100644 --- a/rust/.gitignore +++ b/rust/.gitignore @@ -1,10 +1,12 @@ # SPDX-License-Identifier: GPL-2.0 =20 bindings_generated.rs +bindings_generated_static.rs bindings_helpers_generated.rs doctests_kernel_generated.rs doctests_kernel_generated_kunit.c uapi_generated.rs exports_*_generated.h +extern.c doc/ test/ diff --git a/rust/Makefile b/rust/Makefile index 6daaa4dc21db..431edc73e893 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -10,14 +10,17 @@ always-$(CONFIG_RUST) +=3D exports_core_generated.h # for Rust only, thus there is no header nor prototypes. obj-$(CONFIG_RUST) +=3D helpers/helpers.o CFLAGS_REMOVE_helpers/helpers.o =3D -Wmissing-prototypes -Wmissing-declara= tions +CFLAGS_REMOVE_extern.o =3D -Wmissing-prototypes -Wmissing-declarations -Wd= iscarded-qualifiers =20 always-$(CONFIG_RUST) +=3D libmacros.so no-clean-files +=3D libmacros.so =20 -always-$(CONFIG_RUST) +=3D bindings/bindings_generated.rs bindings/binding= s_helpers_generated.rs -obj-$(CONFIG_RUST) +=3D bindings.o kernel.o +always-$(CONFIG_RUST) +=3D bindings/bindings_generated.rs bindings/binding= s_helpers_generated.rs \ + bindings/bindings_generated_static.rs +obj-$(CONFIG_RUST) +=3D bindings.o kernel.o extern.o always-$(CONFIG_RUST) +=3D exports_helpers_generated.h \ - exports_bindings_generated.h exports_kernel_generated.h + exports_bindings_generated.h exports_bindings_static_generated.h \ + exports_kernel_generated.h =20 always-$(CONFIG_RUST) +=3D uapi/uapi_generated.rs obj-$(CONFIG_RUST) +=3D uapi.o @@ -274,6 +277,21 @@ quiet_cmd_bindgen =3D BINDGEN $@ -o $@ -- $(bindgen_c_flags_final) -DMODULE \ $(bindgen_target_cflags) $(bindgen_target_extra) =20 +quiet_cmd_bindgen_static =3D BINDGEN $@ + cmd_bindgen_static =3D \ + $(BINDGEN) $< $(bindgen_target_flags) \ + --use-core --with-derive-default --ctypes-prefix core::ffi --no-layout-t= ests \ + --no-debug '.*' --enable-function-attribute-detection \ + --experimental --wrap-static-fns \ + --wrap-static-fns-path $(src)/extern.c \ + $(bindgen_static_functions) \ + -o $@ -- $(bindgen_c_flags_final) -DMODULE \ + $(bindgen_target_cflags) $(bindgen_target_extra) + +$(src)/extern.c: $(obj)/bindings/bindings_generated_static.rs \ + $(src)/bindings/bindings_helper.h + @sed -i 's|rust/bindings|bindings|g' $@ + $(obj)/bindings/bindings_generated.rs: private bindgen_target_flags =3D \ $(shell grep -Ev '^#|^$$' $(src)/bindgen_parameters) $(obj)/bindings/bindings_generated.rs: private bindgen_target_extra =3D ; \ @@ -282,6 +300,15 @@ $(obj)/bindings/bindings_generated.rs: $(src)/bindings= /bindings_helper.h \ $(src)/bindgen_parameters FORCE $(call if_changed_dep,bindgen) =20 +$(obj)/bindings/bindings_generated_static.rs: private bindgen_target_flags= =3D \ + $(shell grep -Ev '^#|^$$' $(src)/bindgen_parameters) +$(obj)/bindings/bindings_generated_static.rs: private bindgen_static_funct= ions =3D \ + $(shell grep -Ev '^#|^$$' $(src)/bindgen_static_functions) +$(obj)/bindings/bindings_generated_static.rs: $(src)/bindings/bindings_hel= per.h \ + $(src)/bindgen_static_functions \ + $(src)/bindgen_parameters FORCE + $(call if_changed_dep,bindgen_static) + $(obj)/uapi/uapi_generated.rs: private bindgen_target_flags =3D \ $(shell grep -Ev '^#|^$$' $(src)/bindgen_parameters) $(obj)/uapi/uapi_generated.rs: $(src)/uapi/uapi_helper.h \ @@ -325,6 +352,9 @@ $(obj)/exports_helpers_generated.h: $(obj)/helpers/help= ers.o FORCE $(obj)/exports_bindings_generated.h: $(obj)/bindings.o FORCE $(call if_changed,exports) =20 +$(obj)/exports_bindings_static_generated.h: $(obj)/extern.o FORCE + $(call if_changed,exports) + $(obj)/exports_kernel_generated.h: $(obj)/kernel.o FORCE $(call if_changed,exports) =20 @@ -400,6 +430,7 @@ $(obj)/build_error.o: $(src)/build_error.rs $(obj)/comp= iler_builtins.o FORCE $(obj)/bindings.o: $(src)/bindings/lib.rs \ $(obj)/compiler_builtins.o \ $(obj)/bindings/bindings_generated.rs \ + $(obj)/bindings/bindings_generated_static.rs \ $(obj)/bindings/bindings_helpers_generated.rs FORCE +$(call if_changed_rule,rustc_library) =20 diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions new file mode 100644 index 000000000000..1f24360daeb3 --- /dev/null +++ b/rust/bindgen_static_functions @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 + +# Don't generate structs +--blocklist-type '.*' + +--allowlist-function blk_mq_rq_to_pdu diff --git a/rust/bindings/lib.rs b/rust/bindings/lib.rs index d6da3011281a..c991bcf607ec 100644 --- a/rust/bindings/lib.rs +++ b/rust/bindings/lib.rs @@ -34,6 +34,10 @@ mod bindings_raw { env!("OBJTREE"), "/rust/bindings/bindings_generated.rs" )); + include!(concat!( + env!("OBJTREE"), + "/rust/bindings/bindings_generated_static.rs" + )); } =20 // When both a directly exposed symbol and a helper exists for the same fu= nction, diff --git a/rust/exports.c b/rust/exports.c index 587f0e776aba..288958d2ebea 100644 --- a/rust/exports.c +++ b/rust/exports.c @@ -18,6 +18,7 @@ #include "exports_core_generated.h" #include "exports_helpers_generated.h" #include "exports_bindings_generated.h" +#include "exports_bindings_static_generated.h" #include "exports_kernel_generated.h" =20 // For modules using `rust/build_error.rs`. --=20 2.47.0 From nobody Sun Nov 24 02:57:35 2024 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.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 8B81186250; Fri, 8 Nov 2024 03:10:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035436; cv=none; b=r79aGGouEFVRCtBeoWgY9BdOVVJ8ovAScqq45wWaOv6tLdu81bam0lGW51T3h6ILBJo0JhYQI/BQydYL6QFDZjw9qloaYEOHMATSVpwTxnGAix5mIpguiEjJpso1QdBgM8+KzA9vIlIK8f8sJnCupGcyn8Mcyxuzim0UPZcbu2s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035436; c=relaxed/simple; bh=WghlnAOSQzh0tLET1EFta8yXK3KowjJJNyX13wL1r7g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QBkDEzFGWY0TawCFhaYC2CWmIIWhVN3yP1mkTM3ogW1bmYJ1uJ1ajyqrDaainJyFIBtY5WvDadYWv0vIGJjGn9yJkrGXaak39xFCMMbE44QL/SpkOeXrBHBfTKqc3JiddNuMjlMI0pZbSyrjFdMSxiZ7ggLPGR7ZNSUVTM3zsmg= 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=ecetJbNB; arc=none smtp.client-ip=209.85.210.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="ecetJbNB" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-720d14c8dbfso1511395b3a.0; Thu, 07 Nov 2024 19:10:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731035434; x=1731640234; 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=ORYNcgG6Ifk3psthlMW5Uyr0pn/PRohTUyRYk2R1thI=; b=ecetJbNBgDyAR0vdPTSg65GJNwls4+NGoSy7ZGorF9RWi8YfJm7/8Fdnz2IWHB08JC cHzIG22JT1dyzxnZj1QeLxqFC2Rb4O2ItQoogvrcckplgvGiZACX2In1dYDIwPQShvax dygsmO5eOJzeCXbh8S/4zGglUmhJzgqxuwRaqspGmB5PvQGF3XTObCVgIFbYNAT2xKxL NemfgzkjGxpvsvCYt1n053Ww6tucJkd8CFOa2nghgnjdVZXSKt2rSunC+vI0JMNwIK39 +OyjmWoGqkDwDchTi1S9QPBTVE04O+Yjp+wbFi+QNzVEr+tB8/+cdLMUCLD2RHtUYuSA TaqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731035434; x=1731640234; 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=ORYNcgG6Ifk3psthlMW5Uyr0pn/PRohTUyRYk2R1thI=; b=F5njmiQbg2euU5RofC1iJnfwkedqoRxCyVBAPQzlbCLrCZKMecFBCr6GDbZsAqOILm goR9WRLcmD3KHio0qZtbCH618CS0a8CXN2E/ziS1p7jz8a/zk/ZSxkPZmzLhCvcMyvL8 z5DTG8+T1ozIXbLxWu89yOPTXgEsSb8xyx3cId3G5JvtE6W4dFXXmHta8cE00sIdFV3E Mz5OT/xC3iTQvGaprTk6paOSdE0NF2p+b6zEyDa9gttNrEiXHfTIgDw3kPhbO2LzwDQB TTqXeDPiR/LyIz+YfgGVSVjAa+9MqTJhh3GGiqxphuBWswF8JP6u/qDla+lUmZmuIRaS QBYQ== X-Forwarded-Encrypted: i=1; AJvYcCUtjikfqzoJnt96/gRs23AI9uUFrr1GYPG+wrOYMJgpHoyDhJ1l1jJ+0r+sc/nao2G41wb94a9ba7yZRYh+SA4=@vger.kernel.org, AJvYcCUuxNPSh6Y9cvOh92Vhb/ALwi9MRA+kZgHzw0v97zKsjHkQq+13N8cvY22r0L72WbH5pnlyFqj79XJP/fA=@vger.kernel.org X-Gm-Message-State: AOJu0Yzeh7iiQgyLQYNfDoSHcrnHl0lNXeFDJ/OvLYE/j41K3qijJ/wI 8iU4WZDe87+egOl7iRaWi/cybodgzdqvmGAs6gXTedAVOLN/N7en X-Google-Smtp-Source: AGHT+IG/tsc8aqtowY57l4TlPxG5PQLRzQ4wphercEhISUtvJBk5y3JNAGZAE3F3yf4BUT+ovJgn/w== X-Received: by 2002:a05:6a00:2354:b0:71e:60fc:ad11 with SMTP id d2e1a72fcca58-72413354230mr2066620b3a.16.1731035433669; Thu, 07 Nov 2024 19:10: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 d2e1a72fcca58-724079aa86dsm2589816b3a.127.2024.11.07.19.10.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 19:10:33 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: a.hindborg@kernel.org, boqun.feng@gmail.com, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, rust-for-linux@vger.kernel.org, me@kloenk.dev, benno.lossin@proton.me, aliceryhl@google.com, tmgross@umich.edu, linux-kernel@vger.kernel.org, alex.gaynor@gmail.com, ojeda@kernel.org, gary@garyguo.net Cc: alistair23@gmail.com Subject: [PATCH v2 02/11] rust: helpers: Remove blk helper Date: Fri, 8 Nov 2024 13:10:03 +1000 Message-ID: <20241108031012.335203-3-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241108031012.335203-1-alistair.francis@wdc.com> References: <20241108031012.335203-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 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 Sun Nov 24 02:57:35 2024 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 3367F12FB0A; Fri, 8 Nov 2024 03:10:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035441; cv=none; b=cQZGNDv6zviiwADoCU2I5Hyf5y07w8VuQsD0Q2uJZWN1Qj2lsOznqBoSjhZPhfnVikQa+AF2rBkvRDvx1LDRkphrJ9NXBwtjudrPrWaAulsNiuutddyNd6pnkRVa/yn5WmnRRGmCZqfJnA0Eeoz7udVpobFldSk68t164QWHrYc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035441; c=relaxed/simple; bh=voURl+v4AufVsUEZnibjLaXGHqewNPS2mz4xrJ6/0Cc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D+pcAxNYtN1Ux1PswFqeI6uzS7976bqSt33h+EiWSJLaLfq0cbpgzBacPP1ua9AMT8o60x2zEgYp908Iy3mdPZwMfnq4gI8DM7T69+ydAJvn5kitIxpJUunP5ct/QBOCStJrw5lJJ5yzGxsXZPJSbT6cZyvLY6IO80EQxfey+Q4= 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=C7yWMvbj; arc=none smtp.client-ip=209.85.210.175 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="C7yWMvbj" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-71e8235f0b6so1404786b3a.3; Thu, 07 Nov 2024 19:10:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731035439; x=1731640239; 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=z1Xw5cwPrydNafUpiElmyYrhOsR7tL9HwNtv3+nykpc=; b=C7yWMvbjubzsaMb/sAX0R/EJ6zahkZjbxR7gBT6gA5b8q6zOJ0bex+wEQi99M3xxku 0A7Guz1aI1RTqDBGhfBG4B4EJw7MWJuv2M5TvqJ47+lPPARqo35vDPxC3UAq81fTWjOS OSKT1TUWPfTyZwpDwWKh3xTlo0lYJL4n6wv+R9CRIeuCVnZyxuN8sUrm0hBmJTDchv3e B7VMX60TQocdOeOHTOqdID4j7P6763opB4he+s/uN76Fjnna3zPtItk65QCYiPt9xhzD Ppr9KTFWTk2FiuMu2Wxh1E3lrvPqFOf5UCt8oLzQ6b1NKThX6ZGi3VaLrQi7eoCU3lGY RNvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731035439; x=1731640239; 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=z1Xw5cwPrydNafUpiElmyYrhOsR7tL9HwNtv3+nykpc=; b=oi+VaMzaI5Cu0j+ua3pahrx7swqchesMmi06c8XChVDuHeBFbj5OdcCKcj2f4jDX6Y CUByuNAAUd6cpYtt1aML7CvODoNl9a/R4flQa6nnANISePhP9Wws8GfWshR9KIHHb2Ed SfjpePV1S8rVnfrOhNtJMZHjljVtOv5uM/ZWXaLNsgydFWMMkiAt5bFu9ddJ8UKnU/oH VYHMVQJyJkcbuf6vG0+DjVhpG2zrLAqRVrySuNISBif1SpdKh9Nxf2wY+8n425D1U1sV XKV9cGhwJCHdt0vttU9IjHfO/X9fNlSY/ImxdJxGDsKRROPqR7eZGvhhy3XTdLs6p0az HCgA== X-Forwarded-Encrypted: i=1; AJvYcCU38mn2dlRiaa7xHZHqz2bLx2Z+BcBIw+Pz/vI1ahoFWFYP/3nBqUwjX9XCFVD0Z6CGy5dKSqgdurTKW5d5WoQ=@vger.kernel.org, AJvYcCWjk8Gao1K/7gt7/Xta2Wku0xzBqMJXS1Cd3880i90b0gkI2ytWwmUe0piZ01kN2PcKOUQ82MHGV4YIoYw=@vger.kernel.org X-Gm-Message-State: AOJu0YxmX754lVuuRjdC4FEgaXuephhx+hs3APOS0FJR9RFBT0ELv3/A +gr9EQbA7fpxqw9T+UbFdT9aHsBKeHfLniVP2uWkJ/61YVC3hPyu X-Google-Smtp-Source: AGHT+IFcqI+OHOaWqbMesiycnnQUvNi3qr0ecHFWhui8qlqALB8YErjjPpTNGyewx35c8aVwWCxsPw== X-Received: by 2002:a05:6a00:1399:b0:71e:6743:7599 with SMTP id d2e1a72fcca58-7241329f565mr1831341b3a.7.1731035439138; Thu, 07 Nov 2024 19:10:39 -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 d2e1a72fcca58-724079aa86dsm2589816b3a.127.2024.11.07.19.10.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 19:10:38 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: a.hindborg@kernel.org, boqun.feng@gmail.com, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, rust-for-linux@vger.kernel.org, me@kloenk.dev, benno.lossin@proton.me, aliceryhl@google.com, tmgross@umich.edu, linux-kernel@vger.kernel.org, alex.gaynor@gmail.com, ojeda@kernel.org, gary@garyguo.net Cc: alistair23@gmail.com Subject: [PATCH v2 03/11] rust: helpers: Remove err helper Date: Fri, 8 Nov 2024 13:10:04 +1000 Message-ID: <20241108031012.335203-4-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241108031012.335203-1-alistair.francis@wdc.com> References: <20241108031012.335203-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 | 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 Sun Nov 24 02:57:35 2024 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (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 BE08914012; Fri, 8 Nov 2024 03:10:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035447; cv=none; b=TrKDbCxqAv7CjyOXtVH1bctuUmkSBJjyd9LTgNcjp6UvPlnguaflg2Oaw5M9kSC6JWCOjQARAzeKU1uLPQlDtCjPWe4xn/x2nOfeCeXZP7FjScJMBTDFsuYaRIJIK171tMoEhHyYmIGFIdqLX6MOeZn3rNCnwrXm+d73Pa88ADk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035447; c=relaxed/simple; bh=yP+w2bIbx0jpu3IgHoJIbwZnAFDYB4H/m+UNc/5sQys=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R4WwZPYnal08KwCOrfdkI/V70uLJyIzfx/Txnn1hBwZBkOJG59N8lE4gqJ8CEm0AD4ZZFUGzY1WbbrHuxU53a112pX3CPW6D9YagvNwEBv/JG9YNTnZMyQYTcZT6eB45+c2ISLc6jZaLuH8+MeALWI44wOSi0kuHYtOCP56kj2I= 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=V0jfPCmS; arc=none smtp.client-ip=209.85.215.180 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="V0jfPCmS" Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-7ea76a12c32so1251226a12.1; Thu, 07 Nov 2024 19:10:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731035445; x=1731640245; 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=Dak959r0naMwShkPeyiVoRPjJUPhzBzMV2GYLTEL2tg=; b=V0jfPCmSv2/SqXBsBQpjQ6UetM5OBaal3f24waafw/Hnrko0IlsBSNTG4XGdNjh0eK OXynQcCVsnICD/OOGhZ4CSbqyYz9a5wOo7+avs9HqsRLDG5+Q1X0HZSF6ifMtEmENpwI kRTWh/6CdIG2uTjza3e16p1kcFdMujFAouzVctDtYgq3tgryNHd51bWGMf09/rNzCrn6 nUXegEBW1YwOFR8UxmCPEo7o71miCA45BPApFnjesl+EBOqpevYgkeVd8hnmY+97qjWY RkpjBEL+wNKp+hxzgNQZ9lk5hHY3lL3YKX8vk91b0Sr4zZJX49w8qRCrYumhGvf7BG0+ ECUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731035445; x=1731640245; 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=Dak959r0naMwShkPeyiVoRPjJUPhzBzMV2GYLTEL2tg=; b=Cd7YuxAUqPqTSdgIbr9o5cgWJdsGSiy8Fd1Qh3GUDuLtfyrfTvfKpQQOMlH8uYakp5 O0gFKxADcBtjHcouFCRYq3cOcA+t1OBFvjEbAFIWVa9CuZwIi0IQHO8fgdEN5EVMnHkh QXKFS9fSO+IbjcNRWk6sQPfPYzObUN+mW3qDiKt7NwuVeRpDPfqUurm2qakvRScXrCA5 NEVs0W6RTZNoyknpjxL1/1jUTS5rLOP3NvqxhWmJVKvgSXYdECL9XXXFADx1un7JT5BE lOpMMSBFi0IXqngmdRxXV4IS1BgE+SFrIYo1SVbza3vp4hfSOhCZbcmUbRgwuAIw+FWl QI5Q== X-Forwarded-Encrypted: i=1; AJvYcCUHgj66iTWgOAqnHeU360BIMfVpfDxoWVJR6OIfWq66kgiKnNoK6YkZXf6NJkJmcbXWo7P9ue4QVt1tzZ0=@vger.kernel.org, AJvYcCVoQdf84BEOhjXi8PJv7JBaOdgXGQTYtoEQVakiXV2tduEY/wPCD38ySuMtEjDPaTX5Duz3U7+keSVP7NgNmDg=@vger.kernel.org X-Gm-Message-State: AOJu0YyiwZ780ghG1xPYvGpBPYg+USHZWdkZQlmYqYaj7KLC/FBC6xpL fxtbBubXLkGgQBNS1AyIDqoiR3AF50MCzcX/zo4wqCRMcs8+xOVf X-Google-Smtp-Source: AGHT+IFcUIT0POr5B7JfJVlZ++rskg3e/7kDof73MLNDtDVSQL1dQP1NYRW0zA0ObwGbPjIiDaoiyw== X-Received: by 2002:a05:6a20:a12a:b0:1db:e4c3:99f0 with SMTP id adf61e73a8af0-1dc22b597c2mr1910362637.32.1731035444881; Thu, 07 Nov 2024 19:10:44 -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 d2e1a72fcca58-724079aa86dsm2589816b3a.127.2024.11.07.19.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 19:10:44 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: a.hindborg@kernel.org, boqun.feng@gmail.com, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, rust-for-linux@vger.kernel.org, me@kloenk.dev, benno.lossin@proton.me, aliceryhl@google.com, tmgross@umich.edu, linux-kernel@vger.kernel.org, alex.gaynor@gmail.com, ojeda@kernel.org, gary@garyguo.net Cc: alistair23@gmail.com Subject: [PATCH v2 04/11] rust: helpers: Remove kunit helper Date: Fri, 8 Nov 2024 13:10:05 +1000 Message-ID: <20241108031012.335203-5-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241108031012.335203-1-alistair.francis@wdc.com> References: <20241108031012.335203-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 | 8 -------- 3 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 rust/helpers/kunit.c diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions index 0269efa83c61..b4032d277e72 100644 --- a/rust/bindgen_static_functions +++ b/rust/bindgen_static_functions @@ -9,3 +9,5 @@ --allowlist-function ERR_PTR --allowlist-function IS_ERR --allowlist-function PTR_ERR + +--allowlist-function kunit_get_current_test diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 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 Sun Nov 24 02:57:35 2024 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (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 0A71219309B; Fri, 8 Nov 2024 03:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035452; cv=none; b=pIwOse2zTWXpcRew/VmBJyjOHZkBF75Ywjr5ASRCYBABXJS25u2R/4EKQP8nZqYypls6wYWwtQAY7UBZzoLdntDYj777Qw6ab98N/UqIde5JlVwIAEIwcN2IX8j5yQDRG1zLIMTiN85RPYZ9XhCf/s20k3Gv+bUl8ttyKVjccK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035452; c=relaxed/simple; bh=+vqxO1GXcIVdrjHp8T5/6AWrkGDb0PY8YJ8HRS59Iag=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f878SMRCtrBWRLhmqq1O8/TqmLiDjNkCRgZaJPNIMbh6jyxv0gsbrERjlDJ+oWmrCvYcxSTD4D3oErjELlmDwKn7AQREfrvVf011+PuZjBCNKIZ3mKQ5Bu4bGSfjyiHu1vPBUL52HBMpIHo/xHB8il7ZQgxLIef63/euw/N/tFw= 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=mx9xbjac; arc=none smtp.client-ip=209.85.215.182 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="mx9xbjac" Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-7ee020ec76dso1318526a12.3; Thu, 07 Nov 2024 19:10:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731035450; x=1731640250; 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=30GkkVZhKrnsambHP9iDZ8ayA2V/oCtZtM0dOqtjVM8=; b=mx9xbjacV6e+Efq6qazBziLGenUPhOjbtjk9t9NpJkzPvT9/hGb8Ze3aamUKcREkD7 THhKNM2G+92LgXwbmWmK9F5KG8sqInurA+j0cq+X0AKmUvv7Mzubpr6cPClBpSlv8c4e C1eGHBP6FuyCP6W6tRYqEhoEsy52x0BF6R/J3QU+xwu6RtqLmhaCBNf0lmyGOa5OEaAa E/FPc/1Qi6xxWPB94X1hKkosZSvk/xzjepu8KOoL/blHvDgc6Q79f6Q2qfdo+oqrYrpI +aTOLs4mLYHsljAHtCO6W5QuVa1zNMTyboKEyKCHAmTlW7XnVKlAgKSeQxv+X8qtofFV Lt4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731035450; x=1731640250; 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=30GkkVZhKrnsambHP9iDZ8ayA2V/oCtZtM0dOqtjVM8=; b=Fdw2SBx5M33pdH0H/kzgutP6kExuYCnV7GjIotkYK1eKBUNuJZnluvRhwZ3w7cXQe+ 6m5RMOHFK2zSa9DY3bX5rZhFzVGqEZTQjabOWooo7ovQZGtKxRfR+F14JCC+yoThOoR3 mE9zldAOtXtbHj+GB5IFu1KUjYjr1K4ksSxl41fR44aUknMP2OP+Q/qAvkFtPIB4FIjL VXgrQSX2ecoNNbIvB0zamOfMBaIunpvWdY8vfM/m2dsJ9fyu9OXfbAACpUug/70B5/mB VA73npHKvWhjWg3Tejor+FolYjJ/eBO8nDr0GtS8wUC/Ke5RbuN6ISZ2BuDOJ+3tRyWs XFeg== X-Forwarded-Encrypted: i=1; AJvYcCVySE9zC1OdISsFUAki9bP+jwAqwmKr02pLIQ+6rbdZcQLsYdQYpXEbeqSQI6Y07Wdc+feqSD1JnSsGP1s=@vger.kernel.org, AJvYcCXkkj2aBi87DZZfLuwZ4Ta3dRTPdgtnBJs6wdWM3097Tz0ngrPmARbZ6q9TlihbZ6XV02RMQxxSUI+BH6m8ERg=@vger.kernel.org X-Gm-Message-State: AOJu0Yy4A9I6GxeqR0cHxP6an73Qgfo14llH0gXoVFuLAmqP/46nzQbI Soaz54YypSUP0O64BKgA1j9oppgJjIW0XrL+rSma/1gOpJd9e/29 X-Google-Smtp-Source: AGHT+IHZ4aebn5/pBNtZAWuSot5EIpR7gcBfFm58mQh1NQHtwjnwfh0uS/EciecTrjvhpDC3hBZyew== X-Received: by 2002:a05:6300:6f81:b0:1db:eef0:ce9e with SMTP id adf61e73a8af0-1dc229d3f2bmr1213476637.22.1731035450316; Thu, 07 Nov 2024 19:10:50 -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 d2e1a72fcca58-724079aa86dsm2589816b3a.127.2024.11.07.19.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 19:10:49 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: a.hindborg@kernel.org, boqun.feng@gmail.com, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, rust-for-linux@vger.kernel.org, me@kloenk.dev, benno.lossin@proton.me, aliceryhl@google.com, tmgross@umich.edu, linux-kernel@vger.kernel.org, alex.gaynor@gmail.com, ojeda@kernel.org, gary@garyguo.net Cc: alistair23@gmail.com Subject: [PATCH v2 05/11] rust: helpers: Remove some page helpers Date: Fri, 8 Nov 2024 13:10:06 +1000 Message-ID: <20241108031012.335203-6-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241108031012.335203-1-alistair.francis@wdc.com> References: <20241108031012.335203-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 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 a80783fcbe04..791172b0ddeb 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 Sun Nov 24 02:57:35 2024 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.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 77D9884A4E; Fri, 8 Nov 2024 03:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035457; cv=none; b=DBOL6euk88tU9TzcZo7RATRYeoaEn6mF0T52cvq3wINUHP4zg5PkCUvLC2FoprXg7DowFNZRIMWl5+BEiAuigUKvvnzxYxXyuWzyPKhA0Prq3LGyZRG9rPRUEnSo8pvcOHvU7MwghabzP+5GNP6qLJrLVjdY2d5TOcgSQ8VaUEY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035457; c=relaxed/simple; bh=XHU8/ODWMZ1NjzgXc7i9MMFi/+BqzU5+MPyr7GxXJq0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KmDjXutbOuHRnwpLAO3zubjOE1ASBtaZ80i03bTJkZVeCtBU4XkIvzQ3rq3CwPxA4x3KRFqKeMmmDpnkYpqYdKy3eubI8F5aaJ0gRLn04RFOiyFuUF/9drfKPP3A4PsHV40O2th7RI7cU0qEf2+4KCL98k2n0IR7CR8Ws/n3VzM= 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=CDm2s+mq; arc=none smtp.client-ip=209.85.210.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="CDm2s+mq" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-7205b6f51f3so1332069b3a.1; Thu, 07 Nov 2024 19:10:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731035456; x=1731640256; 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=7W810QjWHqZypyHcMoY3+O2exDYtcEpIPUCTDvnWNXc=; b=CDm2s+mqQ7lasP7rLuJr33ZIkVE8zFRlWdCfCn24p/8Mx2Zxb8zEB/POwQUjnjvH0M m/7GIla2zC0lTKyVNcg8PvSqzp7a6lY9KtP3sbukWo7H5VfdR2W68JqybKSWWUQxnGRi j77VE6bQgMCwKHJxBSZB/5loix14b5PBG9lsT+2MDax60u+JfNw5h1xDbNnt419ItZDy AOVNqYYqdMzh0O75AH+GlVqyXvMyuoJR2tV2MCGLfy4vL9yS1vQ+B+N6HoCyj2IWKaGz 0I6CEDcG+coo9wtye8zaQSJOvCSo96uh9nEFMI2yrxXXdgzjmFEkT04kjg3rNWmIuZZ5 tfxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731035456; x=1731640256; 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=7W810QjWHqZypyHcMoY3+O2exDYtcEpIPUCTDvnWNXc=; b=IZT5leQ+eGjE0kiq4/S/KKdocZuyUfdefpj82Jh2UyGj+zNw2kg+YQuEDaCE8TUzPi lQI5N4c7t+w7tGEbEggW3o02R/Oq4X2ptA61OgLZFrvLivwAGIqTnqYI+HAyk1O8Pjpx yxqBHZXUgDOp+Kc5r056Q0Q7mktsOybH0ZTue6QkoOdpQKBdZk03hCWQ6T0S1/uZAZcM cY/S632C+KHgdtiNXzmTPpRow7HIHs+CXiTKPRUSlypcZXCk3HAzZkg7K//YF7k8NKco Qo0CCJuVkhFQkRCgo7x5xoKvMnwNcOTCRwTSgyrFhKhkCw5i8fVPb8cTVTtgoxBCkGeZ Momg== X-Forwarded-Encrypted: i=1; AJvYcCVtS6aHKY2TkIKGu8k0cYUE6sB6itn2ZG6OGNhRTsXLcn6/yhylIJ/Gw+DMktWBTUmfRT2iJc07aQNzWzbtR7k=@vger.kernel.org, AJvYcCXV/pkRQIIf2RupnxIIZqZhsumQv7RGs7E+CyCbqcUmtx7DgaEmtrwS4ZBAZNIh22MRCMQsCGMFAlP1Uew=@vger.kernel.org X-Gm-Message-State: AOJu0Yz6C0lCNblFc0cAHkJJHMOrqxXVkLXbQOJHiMP+HFwrkrXkVhg6 uXHVR5tBt0TRgxJbx7hU7G1kdssraVbTSxohXa20rieEaaWaoV35 X-Google-Smtp-Source: AGHT+IFKkh3pnwbDvEmRTuULYMe19zxAg+Z+o+UL6MzTj7bwWrPblcUCQr5KQqGXafEiUkiOOHMNIw== X-Received: by 2002:a05:6a00:6caa:b0:71e:427a:68de with SMTP id d2e1a72fcca58-72413382fe6mr2090283b3a.24.1731035455806; Thu, 07 Nov 2024 19:10:55 -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 d2e1a72fcca58-724079aa86dsm2589816b3a.127.2024.11.07.19.10.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 19:10:55 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: a.hindborg@kernel.org, boqun.feng@gmail.com, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, rust-for-linux@vger.kernel.org, me@kloenk.dev, benno.lossin@proton.me, aliceryhl@google.com, tmgross@umich.edu, linux-kernel@vger.kernel.org, alex.gaynor@gmail.com, ojeda@kernel.org, gary@garyguo.net Cc: alistair23@gmail.com Subject: [PATCH v2 06/11] rust: helpers: Remove rbtree helper Date: Fri, 8 Nov 2024 13:10:07 +1000 Message-ID: <20241108031012.335203-7-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241108031012.335203-1-alistair.francis@wdc.com> References: <20241108031012.335203-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 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 791172b0ddeb..2914bfba6bdf 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 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 Sun Nov 24 02:57:35 2024 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (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 E5A1784A4E; Fri, 8 Nov 2024 03:11:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035463; cv=none; b=R2q4FmsYxKpJUqb6i2sUombOvp7k0NhHVxsSVsFB0IBajRyGV1jXKPPTEXMbCy2kx6IHyg7SeAQxsscpbcX/dyBQUrGlJRIFdCP/RX2Oo+pRpN5AFXj+ENfJ7Av9apDUyFNReys0tTWC7DSoHJx/qMW25yPH7oAUcy53PNIj0yg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035463; c=relaxed/simple; bh=ZyGG/JolgOiTLRyymXoaXdc90HntT4LlCnkm9urXYnU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ka3jzfUCDN9KENU+yIzlThvgPOO+ZFrxuq4lh/WSnjHgw4XmKjCUf9Bz5keWQsqgM5eF7uHtZab0p1vJkKjhAZwCm6crdGxpkZzUZ0p/mAXRU1XqWl4ASynUriY7YGnZsHtiVmuul0eXdf4S/268SERAfBMQAlJoRIhgX6gnwho= 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=Ac1PZynl; arc=none smtp.client-ip=209.85.210.172 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="Ac1PZynl" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-720d01caa66so1544941b3a.2; Thu, 07 Nov 2024 19:11:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731035461; x=1731640261; 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=0Z81DIwGRLuwATR87Q7SlHrRTHasRWbetKZP18xxS2k=; b=Ac1PZynlaHCuAP4QNh7TuSfU6g3EeZJROV2+cgIRB7NL0+fgBbftytQHTUXeNpF4Ys UMg0xWMT00lGZ+g/9xx03vEiUQdMz3c2QJ7M+W1dX3b8keX1n65XylYFCZiT6Uayb899 Ry6hLk0IOdNKhtZG3VmI1gdB0MX/a4ZsWuUgEXxaN+UW4GK21nmREVMe4SeV+GMkTWhz jxjlva/OSV7fWELS87l/yw/ybApndLJQC8pccjRg/+3JB5dNiSHfwsMFufzSm8ykqS8p EzEaWAa2z3XUtaFxHrzy5MZhyfc448S8TF2/3leeMiDSJ+iO7Yao++j7OP/lQA1Tr4rm nlyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731035461; x=1731640261; 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=0Z81DIwGRLuwATR87Q7SlHrRTHasRWbetKZP18xxS2k=; b=fAAYGaXpfJ8Yh7zPYNfwVFo6c94Qa7aGxu6Kts32CMaH+WZjjRCJDKjSlXYXJl8OyM FvVHxxOq7JazwsazuHxbHMgPgJGjl2osRvMV3OTkb2jCCYoNQNqxNk0mO3s6dIDqrZKA +ZbS2lSCHbBC4GSySnm+3ainJ0tHvLRXErLtElC87CWwjaGuSg6pW3wY10OUUmUFMQ6r gyTCg8FpFXEzaZLHXJAaZ6r85+CT5aUyk7YSy7vtlf3EwbF7OH1gpMzWWJ+272Pf+sEI dIPHa0uqLx2+yz16L41BdFXMxpR3Bv9bcBOxOVTytTMZTzXv5SGwU/dIBVyL1CS4ilmg Ma7w== X-Forwarded-Encrypted: i=1; AJvYcCUqyVy8QQLSuoSrCb0xgR/BoAl/aixnpc8RP4OVXI6uUVCwtjshWxMllwcQ2dCxlB8FQ75GwTeD6RgYCyM=@vger.kernel.org, AJvYcCXbBr6BzwncLEEYs1MTDUfuGKbCVCfFG5IzUVHflpIt8A2+NnW0Dgu096LdJ1cup2fx8FHUa2FJNG7FdgWz4v0=@vger.kernel.org X-Gm-Message-State: AOJu0YyoM9xIQuLdScDDAgT48TLIG2/B1ZtudPpSrPWSqCs1JbKbEAqC YbGNxwO8veNCUmwC/XWr0qgqqcEl2pvbq8/C2Cny6TvWMGi64/SZ X-Google-Smtp-Source: AGHT+IFg8AbwQ2kdS6FYFn0V0ALEjFXzhM0pq/V5eJ12742S8j8hZTtL3Nm+bXB9HuGq4pGUOY1D2g== X-Received: by 2002:a05:6a20:2444:b0:1db:ddba:8795 with SMTP id adf61e73a8af0-1dc22b576aamr2049699637.36.1731035461249; Thu, 07 Nov 2024 19:11: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 d2e1a72fcca58-724079aa86dsm2589816b3a.127.2024.11.07.19.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 19:11:00 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: a.hindborg@kernel.org, boqun.feng@gmail.com, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, rust-for-linux@vger.kernel.org, me@kloenk.dev, benno.lossin@proton.me, aliceryhl@google.com, tmgross@umich.edu, linux-kernel@vger.kernel.org, alex.gaynor@gmail.com, ojeda@kernel.org, gary@garyguo.net Cc: alistair23@gmail.com Subject: [PATCH v2 07/11] rust: helpers: Remove some refcount helpers Date: Fri, 8 Nov 2024 13:10:08 +1000 Message-ID: <20241108031012.335203-8-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241108031012.335203-1-alistair.francis@wdc.com> References: <20241108031012.335203-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 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 Sun Nov 24 02:57:35 2024 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 A2EC2126BF7; Fri, 8 Nov 2024 03:11:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035469; cv=none; b=SwPXxwQ+f521cXj9wt/lZ1/CLrF8+zwVNY7qj0ezIUPe/6pWlG0YZc4FPdP+A8Pb8s+05Em9aN7lRjTrnkB8533VI0tVxhZ2CgOF25ElB9EwI+NcpkBBtuwe71BFuVnlbWAr1V1YNqX04jdYxmDC8zK+oVZFNIEK03wCHZQirnk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035469; c=relaxed/simple; bh=npe1jkvpMh4HvUoyz7ySyGRM6GfvyvBo4NnMRHnU2YQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Kavh1gmjeBEJbpryD28w8I+Xp1uR/+vYd6bkgd/P5nOE0FRIWaChzJX4Tx1xpfSPg7Au9q3QDGh8LLv2shXz/pZ+PMCiF2RejG3QyQ5VhKu1eG8ZFykwqgM8Mk7oomO7I62gppMUi9J5tXwQXazXUJ+aOF0OD0itMaCTN+99/Kw= 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=eeiPRGlY; arc=none smtp.client-ip=209.85.210.175 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="eeiPRGlY" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-7240fa50694so754302b3a.1; Thu, 07 Nov 2024 19:11:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731035467; x=1731640267; 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=DI3J7NX+EFeBQ3/CmP6MkbNoUruh4iSKST6ssLs0YN8=; b=eeiPRGlYJcuAPqRsDA5/nmucK6yI7CrBrfDg279m+wciVix612nK39GekMQjJzG/Om VmROtR+VMlMrtxIvNdfuTWSNTfqOfv0y6ZzwZWT3mDQ/Lwk8HmG1d7wOUDr//v8uCg8p 4wwdJfFiX7hdOHWrJraMQbDji+bfsjV9lEqqnJt+FTsfeuU0nng0+I1DTrOzeJPCcQtd g/7J27+FzEBXZUoJmuqTDsMMqjZs+yyNzq8ll1aW0IzyrPuFfgVyr2y4G5Ias3JyuDI3 8oJJQlG/H8tgV7UHjAow7njV/zbKgWGqehtjW12sQDJq/zh30SWsEInSdohE2rLHJlyV x7lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731035467; x=1731640267; 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=DI3J7NX+EFeBQ3/CmP6MkbNoUruh4iSKST6ssLs0YN8=; b=o2+wbIiJc7Z704aOLuAaGJVgsk9KbPacB4ITwARzSVkV3cvR5ySO2uHLRcXkvzcjBv gNZOYUcoKEEKDTieSJMrWgTjso5wZC8TU0McAxYsWvCDd3LX2x6SfqNJVdPPl6LLbsaB yjcHumZfMbW+vWbsopBXTj21dz6LBo74uVf/M9k3oq7+zUSC29bwlz1qxXtcFkBCEiAo E78u9KtYXsaWxQPFzQR8sztVNKwHmG26EpG+Wmdv9krX1mZJw2sfa9LNsVeXacgE1SRr sXGWV91A1XQmgBTuOeuCT1BSlngB/vLH8eYZX3UHxOyJswMK1UrDNkKzzgJEvL6Tzfmi 2iNA== X-Forwarded-Encrypted: i=1; AJvYcCVnkdfYNjiXhVA/L8Q6528lcvGbOWiUS+G4oGgGHEUNmBfv36XgNy0tGPzINXI7urqj5CMS9ETn47jwXB8=@vger.kernel.org, AJvYcCXs2hV2IlFJlASTwkQBvh28wiEbNf0KgNEoX4NqdoyI9NDTeHbAx6DdQWxZc1js9B3rSKLcOEkQmPoqYgicqzs=@vger.kernel.org X-Gm-Message-State: AOJu0YwMWm/oxO6L3ipA5lUan9l3eYO/Dho11Zbzv6H6KHbMK5T2NrAn GMiWFc+1XQrBx/JrIarZTMtrzQ6LXsBHWmVQrbifMEfqLASMHFXWzduakV8u X-Google-Smtp-Source: AGHT+IGq0+KeV64pPCqGG4gyGcqgysk3OwC/+7hJH+IcSmZWeZVVC2NAob+dfX8a9+fxohkQUY5PQg== X-Received: by 2002:a05:6a20:3d89:b0:1db:d9fe:c442 with SMTP id adf61e73a8af0-1dc229df6c2mr1674477637.23.1731035466928; Thu, 07 Nov 2024 19:11: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 d2e1a72fcca58-724079aa86dsm2589816b3a.127.2024.11.07.19.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 19:11:06 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: a.hindborg@kernel.org, boqun.feng@gmail.com, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, rust-for-linux@vger.kernel.org, me@kloenk.dev, benno.lossin@proton.me, aliceryhl@google.com, tmgross@umich.edu, linux-kernel@vger.kernel.org, alex.gaynor@gmail.com, ojeda@kernel.org, gary@garyguo.net Cc: alistair23@gmail.com Subject: [PATCH v2 08/11] rust: helpers: Remove signal helper Date: Fri, 8 Nov 2024 13:10:09 +1000 Message-ID: <20241108031012.335203-9-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241108031012.335203-1-alistair.francis@wdc.com> References: <20241108031012.335203-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 | 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 2914bfba6bdf..ec26d18c5d88 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 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 Sun Nov 24 02:57:35 2024 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (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 4EEA9188733; Fri, 8 Nov 2024 03:11:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035474; cv=none; b=CF74cch+Vf+NltU+k75IDj0zWJ6YkAMDjqoxuGpCG42ZxZM6vujTSkbyzSNg15C6dI+8qjFuT93EuzgyRHVN50j3EfDlibhG0IiIy98C0rfZdELrn3ACH28RztgpxqC+NZB6+LGVKTWeEcuy0EvprWN/JwM14BX/SF1S+HdwdAw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035474; c=relaxed/simple; bh=7Wx11O+Io3/SGr81bR0dmfT3JEbAjknvURxJuu1f6Pk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QWlymrHmIF1I2VijR6nqtDY56KtEZcYfX4zsa+Grt0bB65ZtS0t9yIu5MKF3KzcJHfia0oln9eVgB72ljZIwfHFZZLhkbGV98pCtg7TsUnBaJG555sgwv2gH16+7XY47OJ+4F3YSJVckZzTjdDJR945Q3FKbl7unSLGrjrxuyVU= 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=CHbXTsP4; arc=none smtp.client-ip=209.85.215.176 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="CHbXTsP4" Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-7eda47b7343so1201860a12.0; Thu, 07 Nov 2024 19:11:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731035473; x=1731640273; 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=kJO07Fzt7h82Pu5SZ4QeV4i5wfjDN4Fpn4ZRTrNMHdc=; b=CHbXTsP4OUTMN8uWAOxMQyb7rvhnelqGVVpD47SU+2wnznWzgmL3rKlSGlYwmHiuzG UDqqHgsZZL9qRnO8adlmmFA3L8WNbBFMHTZRYVSlx1lkgtSNpgua+L1ZcIHLJRDokrpI X+a6O9Zy+LDiM6uoul4I+a7gNge5CupgsgfvhHAdRxnvWVW0pqHfTv/LOxMsBvckSfow YIsBiGiqOHCVKGOmuyuEqYs7e8rVKgFftKtzT/khiwXSQ6ciRY6wsrFE2li0OOmAXaPm iZ4lEvNsF5Fb6ilbat4XwO5A9qWIwsDMNOW+vAYVpCKXkiQ6k52xOcJdWq6LptPG/AVC IZcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731035473; x=1731640273; 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=kJO07Fzt7h82Pu5SZ4QeV4i5wfjDN4Fpn4ZRTrNMHdc=; b=k1T2XEcDpBGn8NDXm9dCZvtnlYPc9UBlicFWqjr5InHf1QgoMmGHZAm8lkS+h2S3iQ aadw4RNN0gxEPa7aW724vL6l86qAOZgraYr7sPBkSv8zLpY0jSo+K/pbnVSABKFr7xW1 PtfScDFZ7NSPINujdmZA43Fw1RSCrEqv5/Ne01hT/MStNSQt+qHTIA96t5rZTX5tDu7p E39wiOiW7MMrtK4n2KPhHYcbcEKBvVXI/K3jFxLIHItyxRkPcQ+1I56mlcfNR1nhK9hH XS5PSRFN9KGvmPft3YLs1RQ9RbutUkBsPNYZM6VJTbpu6au4XvRN10ktgOUddWHDiXiT Iskg== X-Forwarded-Encrypted: i=1; AJvYcCWx68kfTHll7ue8gC4efxZnduQuLyocPAvBzbkHqtieO9erkjZP135xwNoPLmh//ZSyUIWEEFOK+exefaMUCv0=@vger.kernel.org, AJvYcCXWJiS2PzzzSsFfS2ZXsxZBieZzQ9iNIaBEjPgUCEpsjqOI5REPB2L0q/QXv/JcUQ/IcQRUqQU53xmxJ6Q=@vger.kernel.org X-Gm-Message-State: AOJu0Ywtk0ySt0aQhw30twFTgcvUcmdEBGn3DLdoD7OWGR8AitqGGs6A XufDqvGxD42+bwtbgrgBj0OsuKvKc+ye6IWO+4rT2XYFU+8Ji5F8 X-Google-Smtp-Source: AGHT+IFMTbcsHQ45ek/dOvAbgYhUMxZ9BujD8lfbvnmr+A8VKyrRypgX+l6rtrMPmJJLzIL2sZFyNA== X-Received: by 2002:a05:6a20:9c91:b0:1db:eff5:f841 with SMTP id adf61e73a8af0-1dc22a42548mr2053865637.27.1731035472453; Thu, 07 Nov 2024 19:11: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 d2e1a72fcca58-724079aa86dsm2589816b3a.127.2024.11.07.19.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 19:11:11 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: a.hindborg@kernel.org, boqun.feng@gmail.com, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, rust-for-linux@vger.kernel.org, me@kloenk.dev, benno.lossin@proton.me, aliceryhl@google.com, tmgross@umich.edu, linux-kernel@vger.kernel.org, alex.gaynor@gmail.com, ojeda@kernel.org, gary@garyguo.net Cc: alistair23@gmail.com Subject: [PATCH v2 09/11] rust: helpers: Remove some spinlock helpers Date: Fri, 8 Nov 2024 13:10:10 +1000 Message-ID: <20241108031012.335203-10-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241108031012.335203-1-alistair.francis@wdc.com> References: <20241108031012.335203-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 | 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 Sun Nov 24 02:57:35 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 B70A113A24A; Fri, 8 Nov 2024 03:11:18 +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=1731035480; cv=none; b=SgxTtkLhfC2J4TzlXPVJ+aLdgD35+IdhdVvxoAgM2eJaHICeiLwZLgkbgyXz1RRGph+9smol1hCFQKUlU2R4tKqlsTCs26nPwNBuVyfEwwIuPhkt6/UFoHLnekhyBmzJC6wdPjseO0eN/cen5A6fgQd3fvORHILf0iYFmKggrNA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035480; c=relaxed/simple; bh=SO0ihzkyb/8u5w8iQc3Yi8QNQKkH80XypPcmX383Vsg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=muoFhX8WUd9bRkworaxu46knpdJqr63m2Tn8mdZczq19YBVaSKsRNMZCohXq2trL/L3JSfCUOpLDW/2I6cQoZT4xmt+zN578krwgqrP0nn202GRWpaLY2nn2t/QX9VQFAPr5SS0mru2LZWbMmYqZF1a/ut0w9OmZGMB/VcBg2Ro= 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=Aa3ZGQpT; 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="Aa3ZGQpT" Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-7d4f85766f0so1228755a12.2; Thu, 07 Nov 2024 19:11:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731035478; x=1731640278; 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=FuJaxUrBc7TRYuZFnJWfuScCYx5fEJD+n5myQuS5ElU=; b=Aa3ZGQpTWc+ytSA8FU0Ms2f1++twf4jI7+FE6FLGOX/9H8z+eEEcyS5LbgHfTzAbNJ b2uyRQ/w0MNDlUqDxsIIQfJooNelu/EbhDOwPKo0/JS/6Bk1s8kaof8+v+z3717DzjQZ iGbP5W9vVWCLUIi9OKUjwMOXoSHB7Mtu46e2qZ8BdkuBjz/TWBOxnCDlXLWiwP2mobGA 7SlpSzxywf0rtU0J6zlDGvuZsBIYmVzeiz/g+Kp2wPi7wYVBwdtY17xiTeEj85m498sY iRfDQlNIJduH1xQM4A64XLiLLaj3gxbaZ1WkUHGcawjmZtRwgU/VNU2otjKS5fY/G2Ih be6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731035478; x=1731640278; 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=FuJaxUrBc7TRYuZFnJWfuScCYx5fEJD+n5myQuS5ElU=; b=U8ihCGR3x+zysFuUuYL6QkxxU63yFA3nMw3DasCAiNmVsXmdoEt+/O7TB1+W1YcyGx bnCzFL1h3fF6Qn5RZlxw7ZexSVLDW8jUbhr/bb1W1ZCxduuRaY+Vva1rAq5Cvkm0rTJU vLwPbxvhc1p79uqu7BdxVYPlD5n3FVotYxgGH7q2v0VbYZeMrHTC0rwJwUrDsyl5ezKk VbUyKEUdRcIhPrE3yBzGEDso8IEkUCx5tKRUtIG9YbV6TKDXvOcQ6KfwQPOcOehLcxwK SEa7JDJzF8kLcJ9uUQIQHo3woQvDHvBelnAH1sDYhmZC3zu4fZ2ATC7r89hiqxCb2Atv CI6g== X-Forwarded-Encrypted: i=1; AJvYcCXDBDtxiRYO13Wbo+eIxp7scFhAu8uPMfrLILXQ+L8cqMfSg5wTDSXh8zw8X2gXxHeRxxyl3dbGNdmbVAE=@vger.kernel.org, AJvYcCXR7mIUhKZu6GPSDzDJCpFmREXz1H72Ha/gHKqY2FL9pCR8nWw620dU+kkaMaO5Zzx516u8kPq8Adl9BIaI34w=@vger.kernel.org X-Gm-Message-State: AOJu0YxiyRXFKBoi2jzzjTd7UX/2xgUbW5TLRrtiYfAOfap553TgOVjJ fZrou7SqcazIFSO9toqXHtqTRX0+Xtfx18jIGfH96YKQT1ehXAT0 X-Google-Smtp-Source: AGHT+IGgC+6I7Emn1GjiFWxF10vSSuDCH8uOSU2KcXANEDn34Q3cV0UJql0OiWOnDN/V3SkB+T7hpQ== X-Received: by 2002:a05:6a21:3418:b0:1d9:261c:5943 with SMTP id adf61e73a8af0-1dc2296b919mr1723644637.10.1731035478006; Thu, 07 Nov 2024 19:11:18 -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 d2e1a72fcca58-724079aa86dsm2589816b3a.127.2024.11.07.19.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 19:11:17 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: a.hindborg@kernel.org, boqun.feng@gmail.com, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, rust-for-linux@vger.kernel.org, me@kloenk.dev, benno.lossin@proton.me, aliceryhl@google.com, tmgross@umich.edu, linux-kernel@vger.kernel.org, alex.gaynor@gmail.com, ojeda@kernel.org, gary@garyguo.net Cc: alistair23@gmail.com Subject: [PATCH v2 10/11] rust: helpers: Remove some task helpers Date: Fri, 8 Nov 2024 13:10:11 +1000 Message-ID: <20241108031012.335203-11-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241108031012.335203-1-alistair.francis@wdc.com> References: <20241108031012.335203-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 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 ec26d18c5d88..eec195a21fb8 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 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 Sun Nov 24 02:57:35 2024 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.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 290C31991DA; Fri, 8 Nov 2024 03:11:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035485; cv=none; b=cxO9165wPIt1n6QVNgs9J6yHOG42oUrt9nfXWYe3hScsc13k5gvtUbWkfyJje3/osXHJKXCs0THlXaS/KiPSL6VJyhjUwsnP3FvNiN7FcVc9Mq7vghmFMQ8k7zUBm6XbfzHmMg/WBEk6kh/sS896RdrVHtptyZovk6nNSgpT3bg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731035485; c=relaxed/simple; bh=g19ESF38XnPNOgAGwCMocaUk/c09aizfAjeVo3XURuk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oCXfCJ0P7/VV/4XJQevHONMet27UPvvPr3jVkrMMZv6eC1+w8A1mDR5TCGI909FPjDzx7ZjDdDl1tJXbkTRH7lhI00emiJP4SvzrwukkxjvzcpgGG4y1Rf3hFdbXA3j8tnZraU5JpAsnGBJff2RakpZQ0oD+APFl1K04f4MXDGg= 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=OQTZCL1F; arc=none smtp.client-ip=209.85.210.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="OQTZCL1F" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-7240fa50694so754502b3a.1; Thu, 07 Nov 2024 19:11:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731035483; x=1731640283; 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=5p13tT/thphBZ+1rHR3C3p72SA4taa7/M0quBz0qbaQ=; b=OQTZCL1FPM+VeIMRi7h0BglM9XA/WyQvO+p+xH+DozZW7dzrTR9rLdPLf7eLjFZ5Vw 4g82cYl/VN+ixm1QNxsQydo1KhEVKNbq1kf4vmoOGrrRJ7MGhWMC7qYiqCsi6Dwoonzd i/b/GhuguZYFQsZqiXPHLJGNdmJQnr5nNgb8oXA/p56NQQRcno38WBgOruDmN0J3MRNL 3EY82pnCqJXCdDMWgoC4eVFBny8ujK3M1Jt/n3Iu0yJWkDmH9EPPUSiKeOEjR0AypLxg uUrXvEHsxa3FSo8O1blf2Yvd/22aW3vJVMSiucc5SaMoL6C6Rkc/KfD61oCTTv8omJ8J EJCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731035483; x=1731640283; 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=5p13tT/thphBZ+1rHR3C3p72SA4taa7/M0quBz0qbaQ=; b=HRXi0utd3fkTAPtj/2U8VmyyjeQpK895iHYlcYbEPUpFiRdRu5rOiWVIoffmtMODUX b84zKd+CGpEktX89un7xfXhuJ+jHyR5mHpVD1IHJNtajEI8AZLZ4MgEbkcyWteYxFPYc 931Evbxh8ntak7xQq8NoTLPakTJ28lxKxo52DTGprSZi39Xf9b3ODyOFttc8Vte/Hy6j mEWEKgVG5W9b4qHxOSOVntM/1jMA1anmz/SiYGUasHgXpymxgBMj9wNCUMQU3Hl4WBjr TSK8ESiq3nReR4OFzGhGnBryn1d0S77yoO4msiDYRrSWclWlsxoeXMtSC7owiH2N7RXi eu8Q== X-Forwarded-Encrypted: i=1; AJvYcCWxhNYqpnCUGGbiQnnbHmPexZMUPvAXeLXMGgMh6KAWQEZEo4Ybi/NyFdvxW9Q1mLtvh5NeGauJesxDTLg=@vger.kernel.org, AJvYcCXxFtspPqONWf5fgmn8Jr7UEBvsNqNgFoQoy/HTf1gDjAwTKVtTELc5NYmKMqVIs33pttuQgqHe3n8P396IxWE=@vger.kernel.org X-Gm-Message-State: AOJu0Yxz/abG9nmCXIqJREOrlf0E9/tTI5l4aJ56p0yCK/gPqq+4/GGo sZhkTeyVH86o9Cc0ftIckuH2IG6wq8qjzoOF51HLU/yljuP/sYvr X-Google-Smtp-Source: AGHT+IF9Nt8wFTnf1z18NanbCXUbHNaI7X9rfNZcbQStZX/zykuP7aqknZr8bwt6fX9Sr//WwdVgXw== X-Received: by 2002:a05:6a20:6a23:b0:1db:92a9:4cd8 with SMTP id adf61e73a8af0-1dc228df523mr2026274637.6.1731035483359; Thu, 07 Nov 2024 19:11:23 -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 d2e1a72fcca58-724079aa86dsm2589816b3a.127.2024.11.07.19.11.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 19:11:22 -0800 (PST) From: Alistair Francis X-Google-Original-From: Alistair Francis To: a.hindborg@kernel.org, boqun.feng@gmail.com, bjorn3_gh@protonmail.com, alistair.francis@wdc.com, rust-for-linux@vger.kernel.org, me@kloenk.dev, benno.lossin@proton.me, aliceryhl@google.com, tmgross@umich.edu, linux-kernel@vger.kernel.org, alex.gaynor@gmail.com, ojeda@kernel.org, gary@garyguo.net Cc: alistair23@gmail.com Subject: [PATCH v2 11/11] rust: helpers: Remove uaccess helpers Date: Fri, 8 Nov 2024 13:10:12 +1000 Message-ID: <20241108031012.335203-12-alistair.francis@wdc.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241108031012.335203-1-alistair.francis@wdc.com> References: <20241108031012.335203-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 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 eec195a21fb8..a850c21c432c 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 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