summaryrefslogtreecommitdiff
path: root/rust/kernel
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 /rust/kernel
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 'rust/kernel')
-rw-r--r--rust/kernel/configfs.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/rust/kernel/configfs.rs b/rust/kernel/configfs.rs
index 466fb7f40762..2339c6467325 100644
--- a/rust/kernel/configfs.rs
+++ b/rust/kernel/configfs.rs
@@ -21,7 +21,6 @@
//!
//! ```ignore
//! use kernel::alloc::flags;
-//! use kernel::c_str;
//! use kernel::configfs_attrs;
//! use kernel::configfs;
//! use kernel::new_mutex;
@@ -50,7 +49,7 @@
//!
//! try_pin_init!(Self {
//! config <- configfs::Subsystem::new(
-//! c_str!("rust_configfs"), item_type, Configuration::new()
+//! c"rust_configfs", item_type, Configuration::new()
//! ),
//! })
//! }
@@ -66,7 +65,7 @@
//! 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)),
//! })
//! }
@@ -1000,7 +999,9 @@ macro_rules! configfs_attrs {
static [< $data:upper _ $name:upper _ATTR >]:
$crate::configfs::Attribute<$attr, $data, $data> =
unsafe {
- $crate::configfs::Attribute::new(c_str!(::core::stringify!($name)))
+ $crate::configfs::Attribute::new(
+ $crate::c_str!(::core::stringify!($name)),
+ )
};
)*