mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
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
This commit is contained in:
@@ -158,7 +158,7 @@ static void simple_child_release(struct config_item *item)
|
||||
kfree(to_simple_child(item));
|
||||
}
|
||||
|
||||
static struct configfs_item_operations simple_child_item_ops = {
|
||||
static const struct configfs_item_operations simple_child_item_ops = {
|
||||
.release = simple_child_release,
|
||||
};
|
||||
|
||||
@@ -215,7 +215,7 @@ static void simple_children_release(struct config_item *item)
|
||||
kfree(to_simple_children(item));
|
||||
}
|
||||
|
||||
static struct configfs_item_operations simple_children_item_ops = {
|
||||
static const struct configfs_item_operations simple_children_item_ops = {
|
||||
.release = simple_children_release,
|
||||
};
|
||||
|
||||
@@ -223,7 +223,7 @@ static struct configfs_item_operations simple_children_item_ops = {
|
||||
* Note that, since no extra work is required on ->drop_item(),
|
||||
* no ->drop_item() is provided.
|
||||
*/
|
||||
static struct configfs_group_operations simple_children_group_ops = {
|
||||
static const struct configfs_group_operations simple_children_group_ops = {
|
||||
.make_item = simple_children_make_item,
|
||||
};
|
||||
|
||||
@@ -292,7 +292,7 @@ static struct configfs_attribute *group_children_attrs[] = {
|
||||
* Note that, since no extra work is required on ->drop_item(),
|
||||
* no ->drop_item() is provided.
|
||||
*/
|
||||
static struct configfs_group_operations group_children_group_ops = {
|
||||
static const struct configfs_group_operations group_children_group_ops = {
|
||||
.make_group = group_children_make_group,
|
||||
};
|
||||
|
||||
|
||||
@@ -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()
|
||||
),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user