linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Jiri Slaby <jslaby@suse.cz>
Cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] tty: serial: mpc52xx_uart: make rx/tx hooks return unsigned
Date: Sun, 3 Apr 2022 08:36:07 -0700	[thread overview]
Message-ID: <20220403153607.GA3644508@roeck-us.net> (raw)
In-Reply-To: <20220224111028.20917-2-jslaby@suse.cz>

On Thu, Feb 24, 2022 at 12:10:24PM +0100, Jiri Slaby wrote:
> All these return bitmasks, so it makes more sense to return unsigned --
> this is what a reader and also all the callers expect.
> 
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>

With this patch in place:

drivers/tty/serial/mpc52xx_uart.c:static unsigned int mpc52xx_psc_raw_tx_rdy(struct uart_port *port)
drivers/tty/serial/mpc52xx_uart.c:static int mpc512x_psc_raw_tx_rdy(struct uart_port *port)
                                         ^^^
drivers/tty/serial/mpc52xx_uart.c:static int mpc5125_psc_raw_tx_rdy(struct uart_port *port)
                                         ^^^

Same for other functions. This results in lots of compile errors.

Guenter

> ---
>  drivers/tty/serial/mpc52xx_uart.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c
> index 2704dc988e4a..8a6958377764 100644
> --- a/drivers/tty/serial/mpc52xx_uart.c
> +++ b/drivers/tty/serial/mpc52xx_uart.c
> @@ -83,11 +83,11 @@ static irqreturn_t mpc5xxx_uart_process_int(struct uart_port *port);
>  
>  struct psc_ops {
>  	void		(*fifo_init)(struct uart_port *port);
> -	int		(*raw_rx_rdy)(struct uart_port *port);
> -	int		(*raw_tx_rdy)(struct uart_port *port);
> -	int		(*rx_rdy)(struct uart_port *port);
> -	int		(*tx_rdy)(struct uart_port *port);
> -	int		(*tx_empty)(struct uart_port *port);
> +	unsigned int	(*raw_rx_rdy)(struct uart_port *port);
> +	unsigned int	(*raw_tx_rdy)(struct uart_port *port);
> +	unsigned int	(*rx_rdy)(struct uart_port *port);
> +	unsigned int	(*tx_rdy)(struct uart_port *port);
> +	unsigned int	(*tx_empty)(struct uart_port *port);
>  	void		(*stop_rx)(struct uart_port *port);
>  	void		(*start_tx)(struct uart_port *port);
>  	void		(*stop_tx)(struct uart_port *port);
> @@ -203,34 +203,34 @@ static void mpc52xx_psc_fifo_init(struct uart_port *port)
>  	out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask);
>  }
>  
> -static int mpc52xx_psc_raw_rx_rdy(struct uart_port *port)
> +static unsigned int mpc52xx_psc_raw_rx_rdy(struct uart_port *port)
>  {
>  	return in_be16(&PSC(port)->mpc52xx_psc_status)
>  	    & MPC52xx_PSC_SR_RXRDY;
>  }
>  
> -static int mpc52xx_psc_raw_tx_rdy(struct uart_port *port)
> +static unsigned int mpc52xx_psc_raw_tx_rdy(struct uart_port *port)
>  {
>  	return in_be16(&PSC(port)->mpc52xx_psc_status)
>  	    & MPC52xx_PSC_SR_TXRDY;
>  }
>  
>  
> -static int mpc52xx_psc_rx_rdy(struct uart_port *port)
> +static unsigned int mpc52xx_psc_rx_rdy(struct uart_port *port)
>  {
>  	return in_be16(&PSC(port)->mpc52xx_psc_isr)
>  	    & port->read_status_mask
>  	    & MPC52xx_PSC_IMR_RXRDY;
>  }
>  
> -static int mpc52xx_psc_tx_rdy(struct uart_port *port)
> +static unsigned int mpc52xx_psc_tx_rdy(struct uart_port *port)
>  {
>  	return in_be16(&PSC(port)->mpc52xx_psc_isr)
>  	    & port->read_status_mask
>  	    & MPC52xx_PSC_IMR_TXRDY;
>  }
>  
> -static int mpc52xx_psc_tx_empty(struct uart_port *port)
> +static unsigned int mpc52xx_psc_tx_empty(struct uart_port *port)
>  {
>  	u16 sts = in_be16(&PSC(port)->mpc52xx_psc_status);
>  
> @@ -1365,7 +1365,7 @@ static const struct uart_ops mpc52xx_uart_ops = {
>  /* Interrupt handling                                                       */
>  /* ======================================================================== */
>  
> -static inline int
> +static inline unsigned int
>  mpc52xx_uart_int_rx_chars(struct uart_port *port)
>  {
>  	struct tty_port *tport = &port->state->port;
> -- 
> 2.35.1
> 

  reply	other threads:[~2022-04-03 15:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24 11:10 [PATCH 0/5] tty: serial: various cleanups Jiri Slaby
2022-02-24 11:10 ` [PATCH 1/5] tty: serial: mpc52xx_uart: make rx/tx hooks return unsigned Jiri Slaby
2022-04-03 15:36   ` Guenter Roeck [this message]
2022-02-24 11:10 ` [PATCH 2/5] tty: serial: serial_txx9: remove info print from init Jiri Slaby
2022-02-24 11:10 ` [PATCH 3/5] tty: serial: serial_txx9: remove struct uart_txx9_port Jiri Slaby
2022-02-24 11:10 ` [PATCH 4/5] tty: serial: amba-pl010: use more uart_port pointers Jiri Slaby
2022-02-24 11:10 ` [PATCH 5/5] tty: serial: lpc32xx_hs: use serial_lpc32xx_stop_tx() helper Jiri Slaby
2022-02-25  9:39 ` [PATCH 0/5] tty: serial: various cleanups Greg KH

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=20220403153607.GA3644508@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --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;
as well as URLs for NNTP newsgroup(s).