2017-08-13 06:47:29

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 00/11] constify uart_ops structures

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.

---

drivers/tty/serial/21285.c | 2 +-
drivers/tty/serial/apbuart.c | 2 +-
drivers/tty/serial/cpm_uart/cpm_uart_core.c | 2 +-
drivers/tty/serial/m32r_sio.c | 2 +-
drivers/tty/serial/meson_uart.c | 2 +-
drivers/tty/serial/mpc52xx_uart.c | 2 +-
drivers/tty/serial/mux.c | 2 +-
drivers/tty/serial/owl-uart.c | 2 +-
drivers/tty/serial/sunsab.c | 2 +-
drivers/tty/serial/sunsu.c | 2 +-
drivers/tty/serial/ucc_uart.c | 2 +-
11 files changed, 11 insertions(+), 11 deletions(-)


2017-08-13 06:47:35

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 04/11] serial: sunsu: constify uart_ops structures

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 <[email protected]>

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

diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c
index 5380407..95d34d7 100644
--- a/drivers/tty/serial/sunsu.c
+++ b/drivers/tty/serial/sunsu.c
@@ -958,7 +958,7 @@ static void sunsu_config_port(struct uart_port *port, int flags)
return uart_config[type].name;
}

-static struct uart_ops sunsu_pops = {
+static const struct uart_ops sunsu_pops = {
.tx_empty = sunsu_tx_empty,
.set_mctrl = sunsu_set_mctrl,
.get_mctrl = sunsu_get_mctrl,

2017-08-13 06:47:33

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 02/11] serial: owl: constify uart_ops structures

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 <[email protected]>

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

diff --git a/drivers/tty/serial/owl-uart.c b/drivers/tty/serial/owl-uart.c
index 683b054..b9c85936 100644
--- a/drivers/tty/serial/owl-uart.c
+++ b/drivers/tty/serial/owl-uart.c
@@ -473,7 +473,7 @@ static void owl_uart_config_port(struct uart_port *port, int flags)
}
}

-static struct uart_ops owl_uart_ops = {
+static const struct uart_ops owl_uart_ops = {
.set_mctrl = owl_uart_set_mctrl,
.get_mctrl = owl_uart_get_mctrl,
.tx_empty = owl_uart_tx_empty,

2017-08-13 06:47:59

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 11/11] serial: mux: constify uart_ops structures

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 <[email protected]>

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

diff --git a/drivers/tty/serial/mux.c b/drivers/tty/serial/mux.c
index 8a4be4b..940ea40 100644
--- a/drivers/tty/serial/mux.c
+++ b/drivers/tty/serial/mux.c
@@ -427,7 +427,7 @@ static int mux_console_setup(struct console *co, char *options)
#define MUX_CONSOLE NULL
#endif

-static struct uart_ops mux_pops = {
+static const struct uart_ops mux_pops = {
.tx_empty = mux_tx_empty,
.set_mctrl = mux_set_mctrl,
.get_mctrl = mux_get_mctrl,

2017-08-13 06:47:32

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 03/11] serial: sunsab: constify uart_ops structures

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 <[email protected]>

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

diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c
index b5e3195..653a076 100644
--- a/drivers/tty/serial/sunsab.c
+++ b/drivers/tty/serial/sunsab.c
@@ -819,7 +819,7 @@ static int sunsab_verify_port(struct uart_port *port, struct serial_struct *ser)
return -EINVAL;
}

-static struct uart_ops sunsab_pops = {
+static const struct uart_ops sunsab_pops = {
.tx_empty = sunsab_tx_empty,
.set_mctrl = sunsab_set_mctrl,
.get_mctrl = sunsab_get_mctrl,

2017-08-13 06:48:21

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 10/11] serial: mpc52xx: constify uart_ops structures

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 <[email protected]>

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

diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c
index 4cacaad..791c4c7 100644
--- a/drivers/tty/serial/mpc52xx_uart.c
+++ b/drivers/tty/serial/mpc52xx_uart.c
@@ -1347,7 +1347,7 @@ static u8 mpc5125_psc_get_mr1(struct uart_port *port)
}


-static struct uart_ops mpc52xx_uart_ops = {
+static const struct uart_ops mpc52xx_uart_ops = {
.tx_empty = mpc52xx_uart_tx_empty,
.set_mctrl = mpc52xx_uart_set_mctrl,
.get_mctrl = mpc52xx_uart_get_mctrl,

2017-08-13 06:48:37

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 09/11] serial: m32r_sio: constify uart_ops structures

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 <[email protected]>

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

diff --git a/drivers/tty/serial/m32r_sio.c b/drivers/tty/serial/m32r_sio.c
index 218b711..5b3bd95 100644
--- a/drivers/tty/serial/m32r_sio.c
+++ b/drivers/tty/serial/m32r_sio.c
@@ -854,7 +854,7 @@ static void m32r_sio_config_port(struct uart_port *port, int unused)
return 0;
}

-static struct uart_ops m32r_sio_pops = {
+static const struct uart_ops m32r_sio_pops = {
.tx_empty = m32r_sio_tx_empty,
.set_mctrl = m32r_sio_set_mctrl,
.get_mctrl = m32r_sio_get_mctrl,

2017-08-13 06:48:55

by Julia Lawall

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

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 <[email protected]>

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

2017-08-13 06:49:13

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 07/11] serial: apbuart: constify uart_ops structures

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 <[email protected]>

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

diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
index 75eb083..dd60ed9 100644
--- a/drivers/tty/serial/apbuart.c
+++ b/drivers/tty/serial/apbuart.c
@@ -325,7 +325,7 @@ static int apbuart_verify_port(struct uart_port *port,
return ret;
}

-static struct uart_ops grlib_apbuart_ops = {
+static const struct uart_ops grlib_apbuart_ops = {
.tx_empty = apbuart_tx_empty,
.set_mctrl = apbuart_set_mctrl,
.get_mctrl = apbuart_get_mctrl,

2017-08-13 06:49:29

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 06/11] serial: 21285: constify uart_ops structures

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 <[email protected]>

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

diff --git a/drivers/tty/serial/21285.c b/drivers/tty/serial/21285.c
index 9b208bd..804632b 100644
--- a/drivers/tty/serial/21285.c
+++ b/drivers/tty/serial/21285.c
@@ -334,7 +334,7 @@ static int serial21285_verify_port(struct uart_port *port, struct serial_struct
return ret;
}

-static struct uart_ops serial21285_ops = {
+static const struct uart_ops serial21285_ops = {
.tx_empty = serial21285_tx_empty,
.get_mctrl = serial21285_get_mctrl,
.set_mctrl = serial21285_set_mctrl,

2017-08-13 06:49:45

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 05/11] serial: uuc_uart: constify uart_ops structures

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 <[email protected]>

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

diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
index 481eb29..55b7027 100644
--- a/drivers/tty/serial/ucc_uart.c
+++ b/drivers/tty/serial/ucc_uart.c
@@ -1085,7 +1085,7 @@ static int qe_uart_verify_port(struct uart_port *port,
*
* Details on these functions can be found in Documentation/serial/driver
*/
-static struct uart_ops qe_uart_pops = {
+static const struct uart_ops qe_uart_pops = {
.tx_empty = qe_uart_tx_empty,
.set_mctrl = qe_uart_set_mctrl,
.get_mctrl = qe_uart_get_mctrl,

2017-08-13 06:50:09

by Julia Lawall

[permalink] [raw]
Subject: [PATCH 01/11] serial: meson: constify uart_ops structures

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 <[email protected]>

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

diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 42e4a4c..07c0f98 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -424,7 +424,7 @@ static void meson_uart_config_port(struct uart_port *port, int flags)
}
}

-static struct uart_ops meson_uart_ops = {
+static const struct uart_ops meson_uart_ops = {
.set_mctrl = meson_uart_set_mctrl,
.get_mctrl = meson_uart_get_mctrl,
.tx_empty = meson_uart_tx_empty,

2017-08-14 03:12:45

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 03/11] serial: sunsab: constify uart_ops structures

From: Julia Lawall <[email protected]>
Date: Sun, 13 Aug 2017 08:21:42 +0200

> 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 <[email protected]>

Acked-by: David S. Miller <[email protected]>

2017-08-14 03:12:53

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 04/11] serial: sunsu: constify uart_ops structures

From: Julia Lawall <[email protected]>
Date: Sun, 13 Aug 2017 08:21:43 +0200

> 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 <[email protected]>

Acked-by: David S. Miller <[email protected]>

2017-08-15 14:44:48

by Timur Tabi

[permalink] [raw]
Subject: Re: [PATCH 05/11] serial: uuc_uart: constify uart_ops structures

On 8/13/17 1:21 AM, Julia Lawall wrote:
> 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<[email protected]>

Acked-by: Timur Tabi <[email protected]>