Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: serial: msm_serial: Constify msm_uart_pops

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>

authored by

Rikard Falkeborn and committed by
Greg Kroah-Hartman
0d66442d 439c7183

+1 -1
+1 -1
drivers/tty/serial/msm_serial.c
··· 1524 1524 } 1525 1525 #endif 1526 1526 1527 - static struct uart_ops msm_uart_pops = { 1527 + static const struct uart_ops msm_uart_pops = { 1528 1528 .tx_empty = msm_tx_empty, 1529 1529 .set_mctrl = msm_set_mctrl, 1530 1530 .get_mctrl = msm_get_mctrl,