Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1710433

[PATCH 08/11] serial: cpm_uart: constify uart_ops structures

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Julia Lawall <Julia.Lawall@lip6.fr>
Newsgroups linux.kernel
Subject [PATCH 08/11] serial: cpm_uart: constify uart_ops structures
Date Sun, 13 Aug 2017 08:50:01 +0200
Message-ID <udUSJ-3DM-1@gated-at.bofh.it> (permalink)
References <udUSJ-3DM-3@gated-at.bofh.it>
X-Ironport-Av E=Sophos;i="5.41,367,1498514400"; d="scan'208";a="234287652"
X-Mailer git-send-email 1.9.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 25
Organization linux.* mail to news gateway
X-Original-Cc bhumirks@gmail.com, kernel-janitors@vger.kernel.org, Jiri Slaby <jslaby@suse.com>, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Sun, 13 Aug 2017 08:21:47 +0200
X-Original-Message-ID <1502605310-4314-9-git-send-email-Julia.Lawall@lip6.fr>
X-Original-References <1502605310-4314-1-git-send-email-Julia.Lawall@lip6.fr>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1710433

Show key headers only | View raw


These uart_ops structures are only stored in the ops field of a
uart_port structure and this fields is const, so the uart_ops
structures can also be const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

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

diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
index f6bcc19..9ac142c 100644
--- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
@@ -1123,7 +1123,7 @@ static void cpm_put_poll_char(struct uart_port *port,
 }
 #endif /* CONFIG_CONSOLE_POLL */
 
-static struct uart_ops cpm_uart_pops = {
+static const struct uart_ops cpm_uart_pops = {
 	.tx_empty	= cpm_uart_tx_empty,
 	.set_mctrl	= cpm_uart_set_mctrl,
 	.get_mctrl	= cpm_uart_get_mctrl,

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 08/11] serial: cpm_uart: constify uart_ops structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-08-13 08:50 +0200

csiph-web