* [PATCH] tty: Make sysctl table const
@ 2024-12-13 19:35 Ricardo B. Marliere
0 siblings, 0 replies; only message in thread
From: Ricardo B. Marliere @ 2024-12-13 19:35 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby
Cc: Luis Felipe Hernandez, linux-kernel, linux-serial,
Thomas Weißschuh, Ricardo B. Marliere
Since commit 7abc9b53bd51 ("sysctl: allow registration of const struct
ctl_table"), the sysctl registration API allows for struct ctl_table to be
in read-only memory. Move tty_table to be declared at build time, instead
of having to be dynamically allocated at boot time.
Cc: Thomas Weißschuh <linux@weissschuh.net>
Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Ricardo B. Marliere <rbm@suse.com>
---
drivers/tty/tty_io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index dcb1769c3625cd0f7d1555260adfe6051139a305..0e84677712b4e1eb72f209c4d9c54a940b3a9041 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -3618,7 +3618,7 @@ void console_sysfs_notify(void)
sysfs_notify(&consdev->kobj, NULL, "active");
}
-static struct ctl_table tty_table[] = {
+static const struct ctl_table tty_table[] = {
{
.procname = "legacy_tiocsti",
.data = &tty_legacy_tiocsti,
---
base-commit: 535a07698b8b3e6f305673102d297262cae2360a
change-id: 20241213-sysctl_const-tty-67dfc1bc83b5
Best regards,
--
Ricardo B. Marliere <rbm@suse.com>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-12-13 19:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-13 19:35 [PATCH] tty: Make sysctl table const Ricardo B. Marliere
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®