diff mbox series

tty: serial: msm_serial: Constify msm_uart_pops

Message ID 20201104235134.17793-1-rikard.falkeborn@gmail.com
State New
Headers show
Series tty: serial: msm_serial: Constify msm_uart_pops | expand

Commit Message

Rikard Falkeborn Nov. 4, 2020, 11:51 p.m. UTC
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.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/tty/serial/msm_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeffrey Hugo Nov. 5, 2020, 4:09 p.m. UTC | #1
On Wed, Nov 4, 2020 at 4:54 PM Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
>

> 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.

>

> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>


Reviewed-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
diff mbox series

Patch

diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index 87f005e5d2af..18e16159aabb 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -1525,7 +1525,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,