Skip to content

Commit

Permalink
genirq/irqdesc: Make kobj_type structures constant
Browse files Browse the repository at this point in the history
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 definitions which prevents
modification at runtime.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230217-kobj_type-irq-v1-1-fedfacaf8cdb@weissschuh.net
  • Loading branch information
Thomas Weißschuh authored and Thomas Gleixner committed Feb 21, 2023
1 parent e6cc6f1 commit ce7980a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/irq/irqdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ static struct attribute *irq_attrs[] = {
};
ATTRIBUTE_GROUPS(irq);

static struct kobj_type irq_kobj_type = {
static const struct kobj_type irq_kobj_type = {
.release = irq_kobj_release,
.sysfs_ops = &kobj_sysfs_ops,
.default_groups = irq_groups,
Expand Down Expand Up @@ -335,7 +335,7 @@ postcore_initcall(irq_sysfs_init);

#else /* !CONFIG_SYSFS */

static struct kobj_type irq_kobj_type = {
static const struct kobj_type irq_kobj_type = {
.release = irq_kobj_release,
};

Expand Down

0 comments on commit ce7980a

Please sign in to comment.