]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tty: serial: constify uart_ops structures
authorBhumika Goyal <bhumirks@gmail.com>
Wed, 25 Jan 2017 17:48:52 +0000 (23:18 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jan 2017 08:23:36 +0000 (09:23 +0100)
Declare uart_ops structures as const as they are only stored in the ops
field of an uart_port structure. This field is of type const, so
uart_ops structures having this property can be made const too.

File size details before and after patching.
First line of every .o file shows the file size before patching
and second line shows the size after patching.

   text    data     bss     dec     hex filename

   2977     456      64    3497     da9 drivers/tty/serial/amba-pl010.o
   3169     272      64    3505     db1 drivers/tty/serial/amba-pl010.o

   3109     456       0    3565     ded drivers/tty/serial/efm32-uart.o
   3301     272       0    3573     df5 drivers/tty/serial/efm32-uart.o

  10668     753       1   11422    2c9e drivers/tty/serial/icom.o
  10860     561       1   11422    2c9e drivers/tty/serial/icom.o

  23904     408       8   24320    5f00 drivers/tty/serial/ioc3_serial.o
  24088     224       8   24320    5f00 drivers/tty/serial/ioc3_serial.o

  10516     560       4   11080    2b48 drivers/tty/serial/ioc4_serial.o
  10709     368       4   11081    2b49 drivers/tty/serial/ioc4_serial.o

   7853     648    1216    9717    25f5 drivers/tty/serial/mpsc.o
   8037     456    1216    9709    25ed drivers/tty/serial/mpsc.o

  10248     456       0   10704    29d0 drivers/tty/serial/omap-serial.o
  10440     272       0   10712    29d8 drivers/tty/serial/omap-serial.o

   8122     532    1984   10638    298e drivers/tty/serial/pmac_zilog.o
   8306     340    1984   10630    2986 drivers/tty/serial/pmac_zilog.o

   3808     456       0    4264    10a8 drivers/tty/serial/pxa.o
   4000     264       0    4264    10a8 drivers/tty/serial/pxa.o

  21781    3864       0   25645    642d drivers/tty/serial/serial-tegra.o
  22037    3608       0   25645    642d drivers/tty/serial/serial-tegra.o

   2481     456      96    3033     bd9 drivers/tty/serial/sprd_serial.o
   2673     272      96    3041     be1 drivers/tty/serial/sprd_serial.o

   5534     300     512    6346    18ca drivers/tty/serial/vr41xx_siu.o
   5630     204     512    6346    18ca drivers/tty/serial/vr41xx_siu.o

   6730    1576     128    8434    20f2 drivers/tty/serial/vt8500_serial.o
   6986    1320     128    8434    20f2 drivers/tty/serial/vt8500_serial.o

Cross compiled for mips architecture.

   3005     488       0    3493     da5 drivers/tty/serial/pnx8xxx_uart.o
   3189     304       0    3493     da5 drivers/tty/serial/pnx8xxx_uart.o

   4272     196    1056    5524    1594 drivers/tty/serial/dz.o
   4368     100    1056    5524    1594 drivers/tty/serial/dz.o

   6551     144      16    6711    1a37 drivers/tty/serial/ip22zilog.o
   6647      48      16    6711    1a37 drivers/tty/serial/ip22zilog.o

   9612     428    1520   11560    2d28 drivers/tty/serial/serial_txx9.o
   9708     332    1520   11560    2d28 drivers/tty/serial/serial_txx9.o

   4156     296      16    4468    1174 drivers/tty/serial/ar933x_uart.o
   4252     200      16    4468    1174 drivers/tty/serial/ar933x_uart.o

Cross compiled for arm archiecture.

  11716    1780      44   13540    34e4 drivers/tty/serial/sirfsoc_uart.o
  11808    1688      44   13540    34e4 drivers/tty/serial/sirfsoc_uart.o

  13352     596      56   14004    36b4 drivers/tty/serial/amba-pl011.o
  13444     504      56   14004    36b4 drivers/tty/serial/amba-pl011.o

Cross compiled for sparc architecture.

   4664     528      32    5224    1468 drivers/tty/serial/sunhv.o
   4848     344      32    5224    1468 drivers/tty/serial/sunhv.o

   8080     332      28    8440    20f8 drivers/tty/serial/sunzilog.o
   8184     228      28    8440    20f8 drivers/tty/serial/sunzilog.o

Cross compiled for ia64 architecture.

  10226     549     472   11247    2bef drivers/tty/serial/sn_console.o
  10414     365     472   11251    2bf3 drivers/tty/serial/sn_console.o

The files drivers/tty/serial/zs.o, drivers/tty/serial/lpc32xx_hs.o and
drivers/tty/serial/lantiq.o did not compile.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 files changed:
drivers/tty/serial/amba-pl010.c
drivers/tty/serial/amba-pl011.c
drivers/tty/serial/ar933x_uart.c
drivers/tty/serial/dz.c
drivers/tty/serial/efm32-uart.c
drivers/tty/serial/icom.c
drivers/tty/serial/ioc3_serial.c
drivers/tty/serial/ioc4_serial.c
drivers/tty/serial/ip22zilog.c
drivers/tty/serial/lantiq.c
drivers/tty/serial/lpc32xx_hs.c
drivers/tty/serial/mpsc.c
drivers/tty/serial/omap-serial.c
drivers/tty/serial/pmac_zilog.c
drivers/tty/serial/pnx8xxx_uart.c
drivers/tty/serial/pxa.c
drivers/tty/serial/serial-tegra.c
drivers/tty/serial/serial_txx9.c
drivers/tty/serial/sirfsoc_uart.c
drivers/tty/serial/sn_console.c
drivers/tty/serial/sprd_serial.c
drivers/tty/serial/sunhv.c
drivers/tty/serial/sunzilog.c
drivers/tty/serial/vr41xx_siu.c
drivers/tty/serial/vt8500_serial.c
drivers/tty/serial/zs.c

index 5d41d5b92619ad32512e83311e302652bae94969..f2f25107510980ca8625f8a5658fc79739a85219 100644 (file)
@@ -554,7 +554,7 @@ static int pl010_verify_port(struct uart_port *port, struct serial_struct *ser)
        return ret;
 }
 
-static struct uart_ops amba_pl010_pops = {
+static const struct uart_ops amba_pl010_pops = {
        .tx_empty       = pl010_tx_empty,
        .set_mctrl      = pl010_set_mctrl,
        .get_mctrl      = pl010_get_mctrl,
index 812347245d3f36aee895b6e29ac0960fccb95839..963c2e5feedd22b157c23e40fb11b63bf2763fc7 100644 (file)
@@ -2114,7 +2114,7 @@ static int pl011_verify_port(struct uart_port *port, struct serial_struct *ser)
        return ret;
 }
 
-static struct uart_ops amba_pl011_pops = {
+static const struct uart_ops amba_pl011_pops = {
        .tx_empty       = pl011_tx_empty,
        .set_mctrl      = pl011_set_mctrl,
        .get_mctrl      = pl011_get_mctrl,
index 73137f4aac2005f3322e37617b7f84c0e9cca930..decc7f3c1ab2053bebe85b5653caf2fa356e40b6 100644 (file)
@@ -493,7 +493,7 @@ static int ar933x_uart_verify_port(struct uart_port *port,
        return 0;
 }
 
-static struct uart_ops ar933x_uart_ops = {
+static const struct uart_ops ar933x_uart_ops = {
        .tx_empty       = ar933x_uart_tx_empty,
        .set_mctrl      = ar933x_uart_set_mctrl,
        .get_mctrl      = ar933x_uart_get_mctrl,
index c121f16a973f5e7069fbc334624dd537964a4f53..ff465ff43577427164413e201b4c415075e35d2a 100644 (file)
@@ -739,7 +739,7 @@ static int dz_verify_port(struct uart_port *uport, struct serial_struct *ser)
        return ret;
 }
 
-static struct uart_ops dz_ops = {
+static const struct uart_ops dz_ops = {
        .tx_empty       = dz_tx_empty,
        .get_mctrl      = dz_get_mctrl,
        .set_mctrl      = dz_set_mctrl,
index 195acc868763b711e8c3334c354cd86a90286a40..ebd8569f9ad5da126b2ff15985943e630135925a 100644 (file)
@@ -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,
index d83783cfbade63bfb945b2d1f7d3afdd0f9c7149..fe92d74f4ea5f1b2cab50342ffa4140df6189130 100644 (file)
@@ -1286,7 +1286,7 @@ static void icom_config_port(struct uart_port *port, int flags)
        port->type = PORT_ICOM;
 }
 
-static struct uart_ops icom_ops = {
+static const struct uart_ops icom_ops = {
        .tx_empty = icom_tx_empty,
        .set_mctrl = icom_set_mctrl,
        .get_mctrl = icom_get_mctrl,
index 27b5fefac17167ae4565e7dc43f1dc942c0ec275..2a61dd6b40094d48c2a39b84ffe028cf0f1379ff 100644 (file)
@@ -1873,7 +1873,7 @@ static int ic3_request_port(struct uart_port *port)
 }
 
 /* Associate the uart functions above - given to serial core */
-static struct uart_ops ioc3_ops = {
+static const struct uart_ops ioc3_ops = {
        .tx_empty = ic3_tx_empty,
        .set_mctrl = ic3_set_mctrl,
        .get_mctrl = ic3_get_mctrl,
index 3be051abb2a26a2b0608fc02f478ce91d6a2f8ac..6ad26f802b511b0e5d78afd6bfa50ed349c60cc5 100644 (file)
@@ -2596,7 +2596,7 @@ static int ic4_request_port(struct uart_port *port)
 
 /* Associate the uart functions above - given to serial core */
 
-static struct uart_ops ioc4_ops = {
+static const struct uart_ops ioc4_ops = {
        .tx_empty       = ic4_tx_empty,
        .set_mctrl      = ic4_set_mctrl,
        .get_mctrl      = ic4_get_mctrl,
index 991e6dce916e4d15e03d1f6f1da4694fc0f682e4..7ddddb4c3844bef807094b4b69849d01702d8ee5 100644 (file)
@@ -930,7 +930,7 @@ static int ip22zilog_verify_port(struct uart_port *port, struct serial_struct *s
        return -EINVAL;
 }
 
-static struct uart_ops ip22zilog_pops = {
+static const struct uart_ops ip22zilog_pops = {
        .tx_empty       =       ip22zilog_tx_empty,
        .set_mctrl      =       ip22zilog_set_mctrl,
        .get_mctrl      =       ip22zilog_get_mctrl,
index 5961bb47b8e50df73762ab7d457c77021156b082..22df94f107e5415f03a5b0c44983e39b3eb7b03d 100644 (file)
@@ -557,7 +557,7 @@ lqasc_verify_port(struct uart_port *port,
        return ret;
 }
 
-static struct uart_ops lqasc_pops = {
+static const struct uart_ops lqasc_pops = {
        .tx_empty =     lqasc_tx_empty,
        .set_mctrl =    lqasc_set_mctrl,
        .get_mctrl =    lqasc_get_mctrl,
index 7eb04ae71cc876c2fcd3f4826feb29f6d01b11cc..cea57ff32c33cc2d2cc10e927cf7eec7d6c60759 100644 (file)
@@ -645,7 +645,7 @@ static int serial_lpc32xx_verify_port(struct uart_port *port,
        return ret;
 }
 
-static struct uart_ops serial_lpc32xx_pops = {
+static const struct uart_ops serial_lpc32xx_pops = {
        .tx_empty       = serial_lpc32xx_tx_empty,
        .set_mctrl      = serial_lpc32xx_set_mctrl,
        .get_mctrl      = serial_lpc32xx_get_mctrl,
index 4a3021bcc859566b02e69a7425dafbb2c905560b..1a60a2063e758f46dee89380d99e84bf4f3e78b6 100644 (file)
@@ -1670,7 +1670,7 @@ static void mpsc_put_poll_char(struct uart_port *port,
 }
 #endif
 
-static struct uart_ops mpsc_pops = {
+static const struct uart_ops mpsc_pops = {
        .tx_empty       = mpsc_tx_empty,
        .set_mctrl      = mpsc_set_mctrl,
        .get_mctrl      = mpsc_get_mctrl,
index 3bbc4b5b6245e9d43a5c1dfe4d4d3df9f6cf98b6..6c6f82ad8d5cb63982fc35c9047e64a8a18135a0 100644 (file)
@@ -1450,7 +1450,7 @@ serial_omap_config_rs485(struct uart_port *port, struct serial_rs485 *rs485)
        return 0;
 }
 
-static struct uart_ops serial_omap_pops = {
+static const struct uart_ops serial_omap_pops = {
        .tx_empty       = serial_omap_tx_empty,
        .set_mctrl      = serial_omap_set_mctrl,
        .get_mctrl      = serial_omap_get_mctrl,
index b24b0556f5a853c7ac742620a4bfafcb918f9af9..0da52947e59e0f7deec59244ad31f473be36349a 100644 (file)
@@ -1379,7 +1379,7 @@ static void pmz_poll_put_char(struct uart_port *port, unsigned char c)
 
 #endif /* CONFIG_CONSOLE_POLL */
 
-static struct uart_ops pmz_pops = {
+static const struct uart_ops pmz_pops = {
        .tx_empty       =       pmz_tx_empty,
        .set_mctrl      =       pmz_set_mctrl,
        .get_mctrl      =       pmz_get_mctrl,
index 7a3bb9cf1f2e33052c6766e53f066aab402791da..dab2668d3879ed4fa73de8bc860ab09bdbb1019c 100644 (file)
@@ -631,7 +631,7 @@ pnx8xxx_verify_port(struct uart_port *port, struct serial_struct *ser)
        return ret;
 }
 
-static struct uart_ops pnx8xxx_pops = {
+static const struct uart_ops pnx8xxx_pops = {
        .tx_empty       = pnx8xxx_tx_empty,
        .set_mctrl      = pnx8xxx_set_mctrl,
        .get_mctrl      = pnx8xxx_get_mctrl,
index 75952811c0daf77b259f6ebad8e07a4653a9ba50..905631df1f8bab497af24f6932689acdf6face9f 100644 (file)
@@ -762,7 +762,7 @@ static struct console serial_pxa_console = {
 #define PXA_CONSOLE    NULL
 #endif
 
-static struct uart_ops serial_pxa_pops = {
+static const struct uart_ops serial_pxa_pops = {
        .tx_empty       = serial_pxa_tx_empty,
        .set_mctrl      = serial_pxa_set_mctrl,
        .get_mctrl      = serial_pxa_get_mctrl,
index 731ac35acb3125a2dcee3a6dbeaee93fb2963de2..d92a150c8733611ef9ddec62336268ff9d6456f8 100644 (file)
@@ -1191,7 +1191,7 @@ static const char *tegra_uart_type(struct uart_port *u)
        return TEGRA_UART_TYPE;
 }
 
-static struct uart_ops tegra_uart_ops = {
+static const struct uart_ops tegra_uart_ops = {
        .tx_empty       = tegra_uart_tx_empty,
        .set_mctrl      = tegra_uart_set_mctrl,
        .get_mctrl      = tegra_uart_get_mctrl,
index f80312eed4fda6d501ac1bbcbf0d88250eea38bf..f80fead6c5fc11c4dd50faa328c92ed25ec1e0fb 100644 (file)
@@ -845,7 +845,7 @@ serial_txx9_type(struct uart_port *port)
        return "txx9";
 }
 
-static struct uart_ops serial_txx9_pops = {
+static const struct uart_ops serial_txx9_pops = {
        .tx_empty       = serial_txx9_tx_empty,
        .set_mctrl      = serial_txx9_set_mctrl,
        .get_mctrl      = serial_txx9_get_mctrl,
index b186c9c4f850cc169b27bc7a2ee75127407c5ab9..e03282d92b5997c0caece212114550d3fadb82c1 100644 (file)
@@ -1061,7 +1061,7 @@ static void sirfsoc_uart_config_port(struct uart_port *port, int flags)
        }
 }
 
-static struct uart_ops sirfsoc_uart_ops = {
+static const struct uart_ops sirfsoc_uart_ops = {
        .tx_empty       = sirfsoc_uart_tx_empty,
        .get_mctrl      = sirfsoc_uart_get_mctrl,
        .set_mctrl      = sirfsoc_uart_set_mctrl,
index d4692d888e9da84dd730721dcb949403ccc957e5..9e0e6586c6987e3d22fdc73c9694858bfa1e5e77 100644 (file)
@@ -380,7 +380,7 @@ static void snp_config_port(struct uart_port *port, int flags)
 
 /* Associate the uart functions above - given to serial core */
 
-static struct uart_ops sn_console_ops = {
+static const struct uart_ops sn_console_ops = {
        .tx_empty = snp_tx_empty,
        .set_mctrl = snp_set_mctrl,
        .get_mctrl = snp_get_mctrl,
index 699447aa8b4344ecbfc721fae03154ea6480df6c..d98e3dc4838e637b34d3e3984c9570c656fa37b3 100644 (file)
@@ -498,7 +498,7 @@ static int sprd_verify_port(struct uart_port *port,
        return 0;
 }
 
-static struct uart_ops serial_sprd_ops = {
+static const struct uart_ops serial_sprd_ops = {
        .tx_empty = sprd_tx_empty,
        .get_mctrl = sprd_get_mctrl,
        .set_mctrl = sprd_set_mctrl,
index 99ef5c6e47669a4c32a19ce614c52189bf251f62..73abd89c0108dc793159fe10d2567970de7d70ef 100644 (file)
@@ -370,7 +370,7 @@ static int sunhv_verify_port(struct uart_port *port, struct serial_struct *ser)
        return -EINVAL;
 }
 
-static struct uart_ops sunhv_pops = {
+static const struct uart_ops sunhv_pops = {
        .tx_empty       = sunhv_tx_empty,
        .set_mctrl      = sunhv_set_mctrl,
        .get_mctrl      = sunhv_get_mctrl,
index 8b6ace3410292f407f9974552db4b8ef1a4d51c6..252cea49c068fdde1ec4e43b11f850c31e606558 100644 (file)
@@ -1046,7 +1046,7 @@ static void sunzilog_put_poll_char(struct uart_port *port,
 }
 #endif /* CONFIG_CONSOLE_POLL */
 
-static struct uart_ops sunzilog_pops = {
+static const struct uart_ops sunzilog_pops = {
        .tx_empty       =       sunzilog_tx_empty,
        .set_mctrl      =       sunzilog_set_mctrl,
        .get_mctrl      =       sunzilog_get_mctrl,
index 485de53c5d75341e4c936f6c3d51d38a44251fb1..439057e8107a10ef04ee81e65976efa7a4d028e4 100644 (file)
@@ -681,7 +681,7 @@ static int siu_verify_port(struct uart_port *port, struct serial_struct *serial)
        return 0;
 }
 
-static struct uart_ops siu_uart_ops = {
+static const struct uart_ops siu_uart_ops = {
        .tx_empty       = siu_tx_empty,
        .set_mctrl      = siu_set_mctrl,
        .get_mctrl      = siu_get_mctrl,
index 6b85adce0ac9d13b4d2dece11a5e694db7899159..435a6f3260bed8f066091fed8cb0539c0be15364 100644 (file)
@@ -592,7 +592,7 @@ static void vt8500_put_poll_char(struct uart_port *port, unsigned char c)
 }
 #endif
 
-static struct uart_ops vt8500_uart_pops = {
+static const struct uart_ops vt8500_uart_pops = {
        .tx_empty       = vt8500_tx_empty,
        .set_mctrl      = vt8500_set_mctrl,
        .get_mctrl      = vt8500_get_mctrl,
index eeefd76a30da9c0f42700267fdec035ac7fad494..d32bd499d684582f8ca1eec70b672fd26f6fc9c9 100644 (file)
@@ -1045,7 +1045,7 @@ static int zs_verify_port(struct uart_port *uport, struct serial_struct *ser)
 }
 
 
-static struct uart_ops zs_ops = {
+static const struct uart_ops zs_ops = {
        .tx_empty       = zs_tx_empty,
        .set_mctrl      = zs_set_mctrl,
        .get_mctrl      = zs_get_mctrl,