Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752789AbbDDWFY (ORCPT ); Sat, 4 Apr 2015 18:05:24 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:55512 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752371AbbDDWFS (ORCPT ); Sat, 4 Apr 2015 18:05:18 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Sun, 05 Apr 2015 00:04:29 +0200 From: Stefan Agner To: Joe Perches Cc: Greg Kroah-Hartman , Jiri Slaby , linux-ia64@vger.kernel.org, kernel@stlinux.com, Nicolas Ferre , Timur Tabi , linux-kernel@vger.kernel.org, Pat Gefre , Laxman Dewangan , "Maciej W. Rozycki" , Daniel Walker , sparclinux@vger.kernel.org, Peter Korsgaard , Sonic Zhang , Alexandre Courbot , Russell King , Michal Simek , linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, Tobias Klauser , Stephen Warren , linux-arm-msm@vger.kernel.org, adi-buildroot-devel@lists.sourceforge.net, Thadeu Lima de Souza Cascardo , linux-tegra@vger.kernel.org, David Brown , =?UTF-8?Q?S=C3=B6ren_Brinkmann?= , Maxime Coquelin , Barry Song , Vineet Gupta , Patrice Chotard , Tony Prisk , Bryan Huntsman , Thierry Reding , =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , Srinivas Kandagatla , nios2-dev@lists.rocketboards.org, linuxppc-dev , "David S. Miller" Subject: Re: [PATCH] tty: serial: Add const to struct =?UTF-8?Q?uart=5Fops=20declarations?= In-Reply-To: <1428169665.2775.53.camel@perches.com> References: <1428169665.2775.53.camel@perches.com> Message-ID: User-Agent: Roundcube Webmail/1.1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5646 Lines: 140 Hi Joe, See comment below... On 2015-04-04 19:47, Joe Perches wrote: > These structs can be const, so make them const. > > Signed-off-by: Joe Perches > --- > > Done with: > sed -r -i -e 's/\bstruct\s+uart_ops\s+(\w+)\s*=\s*/const struct > uart_ops \1 = /g' drivers/tty/serial/*.c > > Compiled x86 only, not cross-compiled. Untested. > > drivers/tty/serial/21285.c | 2 +- > drivers/tty/serial/altera_jtaguart.c | 2 +- > drivers/tty/serial/altera_uart.c | 2 +- > drivers/tty/serial/amba-pl010.c | 2 +- > drivers/tty/serial/amba-pl011.c | 2 +- > drivers/tty/serial/apbuart.c | 2 +- > drivers/tty/serial/ar933x_uart.c | 2 +- > drivers/tty/serial/arc_uart.c | 2 +- > drivers/tty/serial/atmel_serial.c | 2 +- > drivers/tty/serial/bcm63xx_uart.c | 2 +- > drivers/tty/serial/bfin_sport_uart.c | 2 +- > drivers/tty/serial/bfin_uart.c | 2 +- > drivers/tty/serial/cpm_uart/cpm_uart_core.c | 2 +- > drivers/tty/serial/dz.c | 2 +- > drivers/tty/serial/efm32-uart.c | 2 +- > drivers/tty/serial/fsl_lpuart.c | 4 ++-- > drivers/tty/serial/icom.c | 2 +- > drivers/tty/serial/imx.c | 2 +- > drivers/tty/serial/ioc3_serial.c | 2 +- > drivers/tty/serial/ioc4_serial.c | 2 +- > drivers/tty/serial/ip22zilog.c | 2 +- > drivers/tty/serial/jsm/jsm_tty.c | 2 +- > drivers/tty/serial/lantiq.c | 2 +- > drivers/tty/serial/lpc32xx_hs.c | 2 +- > drivers/tty/serial/m32r_sio.c | 2 +- > drivers/tty/serial/max3100.c | 2 +- > drivers/tty/serial/men_z135_uart.c | 2 +- > drivers/tty/serial/meson_uart.c | 2 +- > drivers/tty/serial/mpc52xx_uart.c | 2 +- > drivers/tty/serial/mpsc.c | 2 +- > drivers/tty/serial/msm_serial.c | 2 +- > drivers/tty/serial/mux.c | 2 +- > drivers/tty/serial/mxs-auart.c | 2 +- > drivers/tty/serial/netx-serial.c | 2 +- > drivers/tty/serial/nwpserial.c | 2 +- > drivers/tty/serial/omap-serial.c | 2 +- > drivers/tty/serial/pch_uart.c | 2 +- > drivers/tty/serial/pmac_zilog.c | 2 +- > drivers/tty/serial/pnx8xxx_uart.c | 2 +- > drivers/tty/serial/pxa.c | 2 +- > drivers/tty/serial/sa1100.c | 2 +- > drivers/tty/serial/samsung.c | 2 +- > drivers/tty/serial/serial-tegra.c | 2 +- > drivers/tty/serial/serial_ks8695.c | 2 +- > drivers/tty/serial/serial_txx9.c | 2 +- > drivers/tty/serial/sh-sci.c | 2 +- > drivers/tty/serial/sirfsoc_uart.c | 2 +- > drivers/tty/serial/sn_console.c | 2 +- > drivers/tty/serial/sprd_serial.c | 2 +- > drivers/tty/serial/st-asc.c | 2 +- > drivers/tty/serial/sunhv.c | 2 +- > drivers/tty/serial/sunsab.c | 2 +- > drivers/tty/serial/sunsu.c | 2 +- > drivers/tty/serial/sunzilog.c | 2 +- > drivers/tty/serial/timbuart.c | 2 +- > drivers/tty/serial/uartlite.c | 2 +- > drivers/tty/serial/ucc_uart.c | 2 +- > drivers/tty/serial/vr41xx_siu.c | 2 +- > drivers/tty/serial/vt8500_serial.c | 2 +- > drivers/tty/serial/xilinx_uartps.c | 2 +- > drivers/tty/serial/zs.c | 2 +- > 61 files changed, 62 insertions(+), 62 deletions(-) > > --- a/drivers/tty/serial/efm32-uart.c > +++ b/drivers/tty/serial/efm32-uart.c > @@ -487,7 +487,7 @@ static int efm32_uart_verify_port(struct uart_port *port, > return ret; > } > > -static struct uart_ops efm32_uart_pops = { > +static const struct uart_ops efm32_uart_pops = { > .tx_empty = efm32_uart_tx_empty, > .set_mctrl = efm32_uart_set_mctrl, > .get_mctrl = efm32_uart_get_mctrl, > diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c > index 08ce76f..738b5c4 100644 > --- a/drivers/tty/serial/fsl_lpuart.c > +++ b/drivers/tty/serial/fsl_lpuart.c > @@ -1494,7 +1494,7 @@ static int lpuart_verify_port(struct uart_port > *port, struct serial_struct *ser) > return ret; > } > > -static struct uart_ops lpuart_pops = { > +static const const struct uart_ops lpuart_pops = { Something went wrong in this driver, const is twice... Probably because we have two struct uart_ops in one driver? > .tx_empty = lpuart_tx_empty, > .set_mctrl = lpuart_set_mctrl, > .get_mctrl = lpuart_get_mctrl, > @@ -1513,7 +1513,7 @@ static struct uart_ops lpuart_pops = { > .flush_buffer = lpuart_flush_buffer, > }; > > -static struct uart_ops lpuart32_pops = { > +static const const struct uart_ops lpuart32_pops = { > .tx_empty = lpuart32_tx_empty, > .set_mctrl = lpuart32_set_mctrl, > .get_mctrl = lpuart32_get_mctrl, > diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c > index 45fc323..3915443 100644 > --- a/drivers/tty/serial/icom.c > +++ b/drivers/tty/serial/icom.c > @@ -1287,7 +1287,7 @@ static void icom_config_port(struct uart_port > *port, int flags) > port->type = PORT_ICOM; > } > -- Stefan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/