Skip to content

Commit ad76d9b

Browse files
t-8chjwrdegoede
authored andcommitted
x86/platform/uv: Make kobj_type structure constant
Since commit ee6d3dd ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Take advantage of this to constify the structure definition to prevent modification at runtime. Signed-off-by: Thomas Weißschuh <[email protected]> Reviewed-by: Justin Ernst <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 881a103 commit ad76d9b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/platform/x86/uv_sysfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static const struct sysfs_ops hub_sysfs_ops = {
203203
.show = hub_type_show,
204204
};
205205

206-
static struct kobj_type hub_attr_type = {
206+
static const struct kobj_type hub_attr_type = {
207207
.release = hub_release,
208208
.sysfs_ops = &hub_sysfs_ops,
209209
.default_groups = uv_hub_groups,
@@ -356,7 +356,7 @@ static const struct sysfs_ops uv_port_sysfs_ops = {
356356
.show = uv_port_type_show,
357357
};
358358

359-
static struct kobj_type uv_port_attr_type = {
359+
static const struct kobj_type uv_port_attr_type = {
360360
.release = uv_port_release,
361361
.sysfs_ops = &uv_port_sysfs_ops,
362362
.default_groups = uv_port_groups,
@@ -528,7 +528,7 @@ static const struct sysfs_ops uv_pci_top_sysfs_ops = {
528528
.show = pci_top_type_show,
529529
};
530530

531-
static struct kobj_type uv_pci_top_attr_type = {
531+
static const struct kobj_type uv_pci_top_attr_type = {
532532
.release = uv_pci_top_release,
533533
.sysfs_ops = &uv_pci_top_sysfs_ops,
534534
};

0 commit comments

Comments
 (0)