summaryrefslogtreecommitdiff
path: root/samples/rust
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-12 14:01:38 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-12 14:01:38 -0800
commit8c0901b6f9c807a6aa33dccedc548bf10c17a85c (patch)
tree084369782705aa0e471a2c40220d63b0625345b8 /samples/rust
parent136114e0abf03005e182d75761ab694648e6d388 (diff)
parent6363844fdbbb76afe1d44d678fe0746390204a5f (diff)
Merge tag 'configfs-for-v7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/a.hindborg/linux
Pull configfs updates from Andreas Hindborg: - Switch the configfs rust bindings to use c string literals provided by the compiler, rather than a macro - A follow up on constifying `configfs_item_operations`, applying the change to the configfs sample * tag 'configfs-for-v7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/a.hindborg/linux: samples: configfs: Constify struct configfs_item_operations and configfs_group_operations rust: configfs: replace `kernel::c_str!` with C-Strings
Diffstat (limited to 'samples/rust')
-rw-r--r--samples/rust/rust_configfs.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/samples/rust/rust_configfs.rs b/samples/rust/rust_configfs.rs
index 0ccc7553ef39..a1bd9db6010d 100644
--- a/samples/rust/rust_configfs.rs
+++ b/samples/rust/rust_configfs.rs
@@ -3,7 +3,6 @@
//! Rust configfs sample.
use kernel::alloc::flags;
-use kernel::c_str;
use kernel::configfs;
use kernel::configfs::configfs_attrs;
use kernel::new_mutex;
@@ -35,7 +34,7 @@ struct Configuration {
impl Configuration {
fn new() -> impl PinInit<Self, Error> {
try_pin_init!(Self {
- message: c_str!("Hello World\n"),
+ message: c"Hello World\n",
bar <- new_mutex!((KBox::new([0; PAGE_SIZE], flags::GFP_KERNEL)?, 0)),
})
}
@@ -61,7 +60,7 @@ impl kernel::InPlaceModule for RustConfigfs {
try_pin_init!(Self {
config <- configfs::Subsystem::new(
- c_str!("rust_configfs"), item_type, Configuration::new()
+ c"rust_configfs", item_type, Configuration::new()
),
})
}