]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
tty: constify tty_port_operations structs
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Mon, 14 Dec 2015 23:53:36 +0000 (01:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Feb 2016 07:31:08 +0000 (23:31 -0800)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/goldfish.c
drivers/tty/mxser.c

index 0f82c0b146f6d8eb0bdea4a92e4c8a4d72dd3332..752232c77503aaa05cf0b437aba6342b2a5741a0 100644 (file)
@@ -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
 };
index 9a0791e523b5f5a660de5051b3247397542bd496..2f12bb9f4336d761d0a5fba2f81cd4fb65a2bc45 100644 (file)
@@ -2336,7 +2336,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,