* [PATCH] irq: make kobj_type structures constant
@ 2023-02-17 3:16 Thomas Weißschuh
2023-02-21 14:03 ` [tip: irq/urgent] genirq/irqdesc: Make " tip-bot2 for Thomas Weißschuh
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Weißschuh @ 2023-02-17 3:16 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: linux-kernel, Thomas Weißschuh
Since commit ee6d3dd4ed48 ("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 to prevent
modification at runtime.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
kernel/irq/irqdesc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index fd0996274401..240e145e969f 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -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,
@@ -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,
};
---
base-commit: 3ac88fa4605ec98e545fb3ad0154f575fda2de5f
change-id: 20230217-kobj_type-irq-ea87ec34b6e1
Best regards,
--
Thomas Weißschuh <linux@weissschuh.net>
^ permalink raw reply [flat|nested] 2+ messages in thread* [tip: irq/urgent] genirq/irqdesc: Make kobj_type structures constant
2023-02-17 3:16 [PATCH] irq: make kobj_type structures constant Thomas Weißschuh
@ 2023-02-21 14:03 ` tip-bot2 for Thomas Weißschuh
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2023-02-21 14:03 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux, Thomas Gleixner, x86, linux-kernel, maz
The following commit has been merged into the irq/urgent branch of tip:
Commit-ID: ce7980ae9080f72f08d50355c4d9084d57aece63
Gitweb: https://git.kernel.org/tip/ce7980ae9080f72f08d50355c4d9084d57aece63
Author: Thomas Weißschuh <linux@weissschuh.net>
AuthorDate: Fri, 17 Feb 2023 03:16:25
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 21 Feb 2023 15:00:09 +01:00
genirq/irqdesc: Make kobj_type structures constant
Since commit ee6d3dd4ed48 ("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
---
kernel/irq/irqdesc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index fd09962..240e145 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -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,
@@ -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,
};
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-21 14:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-17 3:16 [PATCH] irq: make kobj_type structures constant Thomas Weißschuh
2023-02-21 14:03 ` [tip: irq/urgent] genirq/irqdesc: Make " tip-bot2 for Thomas Weißschuh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®