Skip to contentSkip to conversation

tty: serial: constify sunhv_ops structs

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

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

PATCH 1/1 tty: serial: constify sunhv_ops structs

Constifies sunhv_ops structures in tty's serial
driver since they are not modified after their
initialization.

Detected and found using Coccinelle.

---
 drivers/tty/serial/sunhv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/tty/serial/sunhv.c +3 -3
index 0640318..f224e8a 100644
@@ -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)
 {
Signature · 6 lines
2.4.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz