mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	linux-serial@vger.kernel.org,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org
Cc: Johan Hovold <johan@kernel.org>
Subject: Re: [PATCH 03/10] tty: Cleanup tty_port_set_active() bool parameter
Date: Thu, 5 Jan 2023 07:03:49 +0100	[thread overview]
Message-ID: <ba486888-1c79-6b62-0f2e-7f2ca60e4d41@kernel.org> (raw)
In-Reply-To: <20230104151531.73994-4-ilpo.jarvinen@linux.intel.com>

On 04. 01. 23, 16:15, Ilpo Järvinen wrote:
> Make callers pass true/false consistently for bool val.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

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

> ---
>   drivers/tty/amiserial.c          |  2 +-
>   drivers/tty/serial/serial_core.c |  4 ++--
>   drivers/tty/synclink_gt.c        |  6 +++---
>   drivers/tty/tty_port.c           | 10 +++++-----
>   4 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
> index f8cdce1626cb..460d33a1e70b 100644
> --- a/drivers/tty/amiserial.c
> +++ b/drivers/tty/amiserial.c
> @@ -1329,7 +1329,7 @@ static void rs_hangup(struct tty_struct *tty)
>   	rs_flush_buffer(tty);
>   	shutdown(tty, info);
>   	info->tport.count = 0;
> -	tty_port_set_active(&info->tport, 0);
> +	tty_port_set_active(&info->tport, false);
>   	info->tport.tty = NULL;
>   	wake_up_interruptible(&info->tport.open_wait);
>   }
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index f9564b1e3dfb..c881fefa3d97 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -1827,7 +1827,7 @@ static void uart_hangup(struct tty_struct *tty)
>   		spin_lock_irqsave(&port->lock, flags);
>   		port->count = 0;
>   		spin_unlock_irqrestore(&port->lock, flags);
> -		tty_port_set_active(port, 0);
> +		tty_port_set_active(port, false);
>   		tty_port_tty_set(port, NULL);
>   		if (uport && !uart_console(uport))
>   			uart_change_pm(state, UART_PM_STATE_OFF);
> @@ -1945,7 +1945,7 @@ static int uart_port_activate(struct tty_port *port, struct tty_struct *tty)
>   	 */
>   	ret = uart_startup(tty, state, 0);
>   	if (ret > 0)
> -		tty_port_set_active(port, 1);
> +		tty_port_set_active(port, true);
>   
>   	return ret;
>   }
> diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
> index 2b96bf0ecafb..81c94906f06e 100644
> --- a/drivers/tty/synclink_gt.c
> +++ b/drivers/tty/synclink_gt.c
> @@ -694,7 +694,7 @@ static void hangup(struct tty_struct *tty)
>   	info->port.count = 0;
>   	info->port.tty = NULL;
>   	spin_unlock_irqrestore(&info->port.lock, flags);
> -	tty_port_set_active(&info->port, 0);
> +	tty_port_set_active(&info->port, false);
>   	mutex_unlock(&info->port.mutex);
>   
>   	wake_up_interruptible(&info->port.open_wait);
> @@ -3169,7 +3169,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
>   
>   	if (filp->f_flags & O_NONBLOCK || tty_io_error(tty)) {
>   		/* nonblock mode is set or port is not enabled */
> -		tty_port_set_active(port, 1);
> +		tty_port_set_active(port, true);
>   		return 0;
>   	}
>   
> @@ -3226,7 +3226,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
>   	port->blocked_open--;
>   
>   	if (!retval)
> -		tty_port_set_active(port, 1);
> +		tty_port_set_active(port, true);
>   
>   	DBGINFO(("%s block_til_ready ready, rc=%d\n", tty->driver->name, retval));
>   	return retval;
> diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
> index 0c00d5bd6c88..469de3c010b8 100644
> --- a/drivers/tty/tty_port.c
> +++ b/drivers/tty/tty_port.c
> @@ -403,7 +403,7 @@ void tty_port_hangup(struct tty_port *port)
>   		set_bit(TTY_IO_ERROR, &tty->flags);
>   	port->tty = NULL;
>   	spin_unlock_irqrestore(&port->lock, flags);
> -	tty_port_set_active(port, 0);
> +	tty_port_set_active(port, false);
>   	tty_port_shutdown(port, tty);
>   	tty_kref_put(tty);
>   	wake_up_interruptible(&port->open_wait);
> @@ -518,14 +518,14 @@ int tty_port_block_til_ready(struct tty_port *port,
>   	 * the port has just hung up or is in another error state.
>   	 */
>   	if (tty_io_error(tty)) {
> -		tty_port_set_active(port, 1);
> +		tty_port_set_active(port, true);
>   		return 0;
>   	}
>   	if (filp == NULL || (filp->f_flags & O_NONBLOCK)) {
>   		/* Indicate we are open */
>   		if (C_BAUD(tty))
>   			tty_port_raise_dtr_rts(port);
> -		tty_port_set_active(port, 1);
> +		tty_port_set_active(port, true);
>   		return 0;
>   	}
>   
> @@ -588,7 +588,7 @@ int tty_port_block_til_ready(struct tty_port *port,
>   	port->blocked_open--;
>   	spin_unlock_irqrestore(&port->lock, flags);
>   	if (retval == 0)
> -		tty_port_set_active(port, 1);
> +		tty_port_set_active(port, true);
>   	return retval;
>   }
>   EXPORT_SYMBOL(tty_port_block_til_ready);
> @@ -695,7 +695,7 @@ void tty_port_close_end(struct tty_port *port, struct tty_struct *tty)
>   		wake_up_interruptible(&port->open_wait);
>   	}
>   	spin_unlock_irqrestore(&port->lock, flags);
> -	tty_port_set_active(port, 0);
> +	tty_port_set_active(port, false);
>   }
>   EXPORT_SYMBOL(tty_port_close_end);
>   

-- 
js
suse labs


  reply	other threads:[~2023-01-05  6:04 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 15:15 [PATCH 00/10] tty/serial: bool conversions and cleanups Ilpo Järvinen
2023-01-04 15:15 ` [PATCH 01/10] tty: Cleanup tty_port_set_initialized() bool parameter Ilpo Järvinen
2023-01-05  6:03   ` Jiri Slaby
2023-01-05  7:23   ` Samuel Iglesias Gonsálvez
2023-01-04 15:15 ` [PATCH 02/10] tty: Cleamup tty_port_set_suspended() " Ilpo Järvinen
2023-01-05  6:03   ` Jiri Slaby
2023-01-04 15:15 ` [PATCH 03/10] tty: Cleanup tty_port_set_active() " Ilpo Järvinen
2023-01-05  6:03   ` Jiri Slaby [this message]
2023-01-04 15:15 ` [PATCH 04/10] tty: moxa: Make local var storing tty_port_initialized() bool Ilpo Järvinen
2023-01-05  6:04   ` Jiri Slaby
2023-01-04 15:15 ` [PATCH 05/10] serial: Convert uart_{,port_}startup() init_hw param to bool Ilpo Järvinen
2023-01-05  6:05   ` Jiri Slaby
2023-01-05  8:48     ` Ilpo Järvinen
2023-01-05  9:12     ` Johan Hovold
2023-01-04 15:15 ` [PATCH 06/10] tty: Convert ->carrier_raised() and callchains " Ilpo Järvinen
2023-01-05  6:13   ` Jiri Slaby
2023-01-04 15:15 ` [PATCH 07/10] tty: Convert ->dtr_rts() to take bool argument Ilpo Järvinen
2023-01-05  6:19   ` Jiri Slaby
2023-01-05  8:51     ` Ilpo Järvinen
2023-01-04 15:15 ` [PATCH 08/10] tty/serial: Make ->dcd_change()+uart_handle_dcd_change() status bool Ilpo Järvinen
2023-01-05  6:21   ` Jiri Slaby
2023-01-05  9:11   ` Rodolfo Giometti
2023-01-04 15:15 ` [PATCH 09/10] serial: Make uart_handle_cts_change() status param bool Ilpo Järvinen
2023-01-05  6:23   ` Jiri Slaby
2023-01-05  8:55     ` Ilpo Järvinen
2023-01-05  9:25     ` Johan Hovold
2023-01-04 15:15 ` [PATCH 10/10] tty: Return bool from tty_termios_hw_change() Ilpo Järvinen
2023-01-05  6:28   ` Jiri Slaby
2023-01-05  9:27   ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba486888-1c79-6b62-0f2e-7f2ca60e4d41@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome