[v2,05/13] serial: Convert uart_{,port_}startup() init_hw param to bool

Message ID 20230110120226.14972-6-ilpo.jarvinen@linux.intel.com
State New
Headers
Series tty/serial: bool conversions and cleanups |

Commit Message

Ilpo Järvinen Jan. 10, 2023, 12:02 p.m. UTC
  Convert init_hw parameter in uart_startup() and uart_port_startup() to
bool as code treats them like bool.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/serial_core.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Comments

Jiri Slaby Jan. 11, 2023, 5:53 a.m. UTC | #1
On 10. 01. 23, 13:02, Ilpo Järvinen wrote:
> Convert init_hw parameter in uart_startup() and uart_port_startup() to
> bool as code treats them like bool.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

> ---
>   drivers/tty/serial/serial_core.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index c881fefa3d97..f7074ac02801 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -182,7 +182,7 @@ static void uart_port_dtr_rts(struct uart_port *uport, int raise)
>    * will be serialised by the per-port mutex.
>    */
>   static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
> -		int init_hw)
> +			     bool init_hw)
>   {
>   	struct uart_port *uport = uart_port_check(state);
>   	unsigned long flags;
> @@ -254,7 +254,7 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
>   }
>   
>   static int uart_startup(struct tty_struct *tty, struct uart_state *state,
> -		int init_hw)
> +			bool init_hw)
>   {
>   	struct tty_port *port = &state->port;
>   	int retval;
> @@ -997,7 +997,7 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port,
>   			uart_change_speed(tty, state, NULL);
>   		}
>   	} else {
> -		retval = uart_startup(tty, state, 1);
> +		retval = uart_startup(tty, state, true);
>   		if (retval == 0)
>   			tty_port_set_initialized(port, true);
>   		if (retval > 0)
> @@ -1165,7 +1165,7 @@ static int uart_do_autoconfig(struct tty_struct *tty, struct uart_state *state)
>   		 */
>   		uport->ops->config_port(uport, flags);
>   
> -		ret = uart_startup(tty, state, 1);
> +		ret = uart_startup(tty, state, true);
>   		if (ret == 0)
>   			tty_port_set_initialized(port, true);
>   		if (ret > 0)
> @@ -1943,7 +1943,7 @@ static int uart_port_activate(struct tty_port *port, struct tty_struct *tty)
>   	/*
>   	 * Start up the serial port.
>   	 */
> -	ret = uart_startup(tty, state, 0);
> +	ret = uart_startup(tty, state, false);
>   	if (ret > 0)
>   		tty_port_set_active(port, true);
>
  

Patch

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index c881fefa3d97..f7074ac02801 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -182,7 +182,7 @@  static void uart_port_dtr_rts(struct uart_port *uport, int raise)
  * will be serialised by the per-port mutex.
  */
 static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
-		int init_hw)
+			     bool init_hw)
 {
 	struct uart_port *uport = uart_port_check(state);
 	unsigned long flags;
@@ -254,7 +254,7 @@  static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
 }
 
 static int uart_startup(struct tty_struct *tty, struct uart_state *state,
-		int init_hw)
+			bool init_hw)
 {
 	struct tty_port *port = &state->port;
 	int retval;
@@ -997,7 +997,7 @@  static int uart_set_info(struct tty_struct *tty, struct tty_port *port,
 			uart_change_speed(tty, state, NULL);
 		}
 	} else {
-		retval = uart_startup(tty, state, 1);
+		retval = uart_startup(tty, state, true);
 		if (retval == 0)
 			tty_port_set_initialized(port, true);
 		if (retval > 0)
@@ -1165,7 +1165,7 @@  static int uart_do_autoconfig(struct tty_struct *tty, struct uart_state *state)
 		 */
 		uport->ops->config_port(uport, flags);
 
-		ret = uart_startup(tty, state, 1);
+		ret = uart_startup(tty, state, true);
 		if (ret == 0)
 			tty_port_set_initialized(port, true);
 		if (ret > 0)
@@ -1943,7 +1943,7 @@  static int uart_port_activate(struct tty_port *port, struct tty_struct *tty)
 	/*
 	 * Start up the serial port.
 	 */
-	ret = uart_startup(tty, state, 0);
+	ret = uart_startup(tty, state, false);
 	if (ret > 0)
 		tty_port_set_active(port, true);