tty: serial: constify sunhv_ops structs
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Mon, 14 Dec 2015 23:37:57 +0000 (01:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Dec 2015 17:04:18 +0000 (12:04 -0500)
Constifies sunhv_ops structures in tty's serial
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: David S. Miller <davem@davemloft.net>
drivers/tty/serial/sunhv.c

index 064031870ba0d1b0bf09fd3bcb299d17dcaf76d5..f224e8a715d764ef583bd548e3ed2faebbd56741 100644 (file)
@@ -168,17 +168,17 @@ struct sunhv_ops {
        int (*receive_chars)(struct uart_port *port);
 };
 
-static struct sunhv_ops bychar_ops = {
+static const struct sunhv_ops bychar_ops = {
        .transmit_chars = transmit_chars_putchar,
        .receive_chars = receive_chars_getchar,
 };
 
-static struct sunhv_ops bywrite_ops = {
+static const struct sunhv_ops bywrite_ops = {
        .transmit_chars = transmit_chars_write,
        .receive_chars = receive_chars_read,
 };
 
-static struct sunhv_ops *sunhv_ops = &bychar_ops;
+static const struct sunhv_ops *sunhv_ops = &bychar_ops;
 
 static struct tty_port *receive_chars(struct uart_port *port)
 {