tty: serial: msm_serial: Constify msm_uart_pops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Wed, 4 Nov 2020 23:51:34 +0000 (00:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Nov 2020 16:16:36 +0000 (17:16 +0100)
The only usage of msm_uart_pops is to assign its address to the ops
field in the uart_port struct, which is a pointer to const. Make it
const to allow the compiler to put it in read-only memory.

Reviewed-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20201104235134.17793-1-rikard.falkeborn@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/msm_serial.c

index ec31a80..770c182 100644 (file)
@@ -1524,7 +1524,7 @@ static void msm_poll_put_char(struct uart_port *port, unsigned char c)
 }
 #endif
 
-static struct uart_ops msm_uart_pops = {
+static const struct uart_ops msm_uart_pops = {
        .tx_empty = msm_tx_empty,
        .set_mctrl = msm_set_mctrl,
        .get_mctrl = msm_get_mctrl,