* [PATCH] tty: constify tty_port_operations structs
@ 2015-12-14 23:53 Aya Mahfouz
0 siblings, 0 replies; only message in thread
From: Aya Mahfouz @ 2015-12-14 23:53 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Julia Lawall, linux-kernel
Constifies tty_port_operations structures in
the tty driver since they are not modified
after their initialization.
Detected and found using Coccinelle.
Suggested-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
drivers/tty/goldfish.c | 2 +-
drivers/tty/mxser.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c
index 0f82c0b..752232c 100644
--- a/drivers/tty/goldfish.c
+++ b/drivers/tty/goldfish.c
@@ -162,7 +162,7 @@ static int goldfish_tty_console_setup(struct console *co, char *options)
return 0;
}
-static struct tty_port_operations goldfish_port_ops = {
+static const struct tty_port_operations goldfish_port_ops = {
.activate = goldfish_tty_activate,
.shutdown = goldfish_tty_shutdown
};
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index 4c4a236..29851a4 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -2337,7 +2337,7 @@ static const struct tty_operations mxser_ops = {
.get_icount = mxser_get_icount,
};
-static struct tty_port_operations mxser_port_ops = {
+static const struct tty_port_operations mxser_port_ops = {
.carrier_raised = mxser_carrier_raised,
.dtr_rts = mxser_dtr_rts,
.activate = mxser_activate,
--
2.4.3
--
Kind Regards,
Aya Saif El-yazal Mahfouz
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-12-14 23:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-14 23:53 [PATCH] tty: constify tty_port_operations structs Aya Mahfouz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox