Skip to contentSkip to conversation

tty: serial: msm_serial: Constify msm_uart_pops

PATCH Applied Rikard Falkeborn 3 participants 3 messages Nov 4, 2020 – Dec 29, 2020

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

PATCH 1/1 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.

---
 drivers/tty/serial/msm_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/msm_serial.c +1 -1
index 87f005e5d2af..18e16159aabb 100644
@@ -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,
Signature · 1 line
2.29.2
#2 lore raw
In reply to Rikard Falkeborn
This patch was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

Quoted 8 lines · On Thu, 5 Nov 2020 00:51:34 +0100 you 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.

---
 drivers/tty/serial/msm_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- tty: serial: msm_serial: Constify msm_uart_pops

    https://git.kernel.org/qcom/c/0d66442dfdbd

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html