Skip to contentSkip to conversation

tty: constify tty_port_operations structs

PATCH New Aya Mahfouz 1 participant 1 message Dec 14, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: constify tty_port_operations structs

Constifies tty_port_operations structures in
the tty driver since they are not modified
after their initialization.

Detected and found using Coccinelle.

---
 drivers/tty/goldfish.c | 2 +-
 drivers/tty/mxser.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/tty/goldfish.c +1 -1
index 0f82c0b..752232c 100644
@@ -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
 };
drivers/tty/mxser.c +1 -1
index 4c4a236..29851a4 100644
@@ -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,
Signature · 6 lines
2.4.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz