summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorDanilo Krummrich <dakr@kernel.org>2025-03-07 23:49:45 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-13 13:01:46 +0100
commite64a79b9a57fdb58282cdf6f3c25b6c6d3160557 (patch)
tree957202277797b88d971cbbdcc036d58b222cc733 /samples
parent0a798a23bbabd5544c616af3a6ef988e6c5f53c0 (diff)
downloadlinux-e64a79b9a57fdb58282cdf6f3c25b6c6d3160557.tar.gz
linux-e64a79b9a57fdb58282cdf6f3c25b6c6d3160557.tar.bz2
linux-e64a79b9a57fdb58282cdf6f3c25b6c6d3160557.zip
rust: treewide: switch to the kernel `Vec` type
commit 58eff8e872bd04ccb3adcf99aec7334ffad06cfd upstream. Now that we got the kernel `Vec` in place, convert all existing `Vec` users to make use of it. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Reviewed-by: Gary Guo <gary@garyguo.net> Signed-off-by: Danilo Krummrich <dakr@kernel.org> Link: https://lore.kernel.org/r/20241004154149.93856-20-dakr@kernel.org [ Converted `kasan_test_rust.rs` too, as discussed. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'samples')
-rw-r--r--samples/rust/rust_minimal.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/rust/rust_minimal.rs b/samples/rust/rust_minimal.rs
index 2a9eaab62d1c..4aaf117bf8e3 100644
--- a/samples/rust/rust_minimal.rs
+++ b/samples/rust/rust_minimal.rs
@@ -13,7 +13,7 @@ module! {
}
struct RustMinimal {
- numbers: Vec<i32>,
+ numbers: KVec<i32>,
}
impl kernel::Module for RustMinimal {
@@ -21,7 +21,7 @@ impl kernel::Module for RustMinimal {
pr_info!("Rust minimal sample (init)\n");
pr_info!("Am I built-in? {}\n", !cfg!(MODULE));
- let mut numbers = Vec::new();
+ let mut numbers = KVec::new();
numbers.push(72, GFP_KERNEL)?;
numbers.push(108, GFP_KERNEL)?;
numbers.push(200, GFP_KERNEL)?;