From 6594d9c2d1ddc54375d8742403bd1bd8edecb2d3 Mon Sep 17 00:00:00 2001 From: Ayush Tiwari Date: Tue, 19 Mar 2024 00:36:25 +0530 Subject: [PATCH] staging: greybus: Constify gb_audio_module_type Constify static struct kobj_type gb_audio_module_type to prevent modification of data shared across many instances and to address the checkpatch warning that "gb_audio_module_type" should be const. The "gb_audio_module_type" struct is only used in one place: err = kobject_init_and_add(&m->kobj, &gb_audio_module_type, NULL, ... so checkpatch is correct that it can be made const. Signed-off-by: Ayush Tiwari Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/ZfiQsZBrHfImIJfc@ayush-HP-Pavilion-Gaming-Laptop-15-ec0xxx Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/audio_manager_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c index 5f9dcbdbc191..4a4dfb42f50f 100644 --- a/drivers/staging/greybus/audio_manager_module.c +++ b/drivers/staging/greybus/audio_manager_module.c @@ -144,7 +144,7 @@ static struct attribute *gb_audio_module_default_attrs[] = { }; ATTRIBUTE_GROUPS(gb_audio_module_default); -static struct kobj_type gb_audio_module_type = { +static const struct kobj_type gb_audio_module_type = { .sysfs_ops = &gb_audio_module_sysfs_ops, .release = gb_audio_module_release, .default_groups = gb_audio_module_default_groups,