diff mbox series

[02/27] tty: mmc: sdio_uart: switch sdio_in() to return u8

Message ID 20231206073712.17776-3-jirislaby@kernel.org
State New
Headers show
Series tty: type unifications -- the last part | expand

Commit Message

Jiri Slaby Dec. 6, 2023, 7:36 a.m. UTC
sdio_in() returns a value returned from sdio_readb(). The latter returns
u8. So should the former. Therefore, switch sdio_in() return type to u8
and all its callers too.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org
---
 drivers/mmc/core/sdio_uart.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

Comments

Ulf Hansson Dec. 7, 2023, 2:09 p.m. UTC | #1
On Wed, 6 Dec 2023 at 08:37, Jiri Slaby (SUSE) <jirislaby@kernel.org> wrote:
>
> sdio_in() returns a value returned from sdio_readb(). The latter returns
> u8. So should the former. Therefore, switch sdio_in() return type to u8
> and all its callers too.
>
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: linux-mmc@vger.kernel.org

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

> ---
>  drivers/mmc/core/sdio_uart.c | 19 ++++++++-----------
>  1 file changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/mmc/core/sdio_uart.c b/drivers/mmc/core/sdio_uart.c
> index ef38dcd3a887..a05322f15771 100644
> --- a/drivers/mmc/core/sdio_uart.c
> +++ b/drivers/mmc/core/sdio_uart.c
> @@ -178,11 +178,9 @@ static inline void sdio_uart_release_func(struct sdio_uart_port *port)
>                 sdio_release_host(port->func);
>  }
>
> -static inline unsigned int sdio_in(struct sdio_uart_port *port, int offset)
> +static inline u8 sdio_in(struct sdio_uart_port *port, int offset)
>  {
> -       unsigned char c;
> -       c = sdio_readb(port->func, port->regs_offset + offset, NULL);
> -       return c;
> +       return sdio_readb(port->func, port->regs_offset + offset, NULL);
>  }
>
>  static inline void sdio_out(struct sdio_uart_port *port, int offset, int value)
> @@ -192,8 +190,8 @@ static inline void sdio_out(struct sdio_uart_port *port, int offset, int value)
>
>  static unsigned int sdio_uart_get_mctrl(struct sdio_uart_port *port)
>  {
> -       unsigned char status;
>         unsigned int ret;
> +       u8 status;
>
>         /* FIXME: What stops this losing the delta bits and breaking
>            sdio_uart_check_modem_status ? */
> @@ -354,14 +352,13 @@ static void sdio_uart_stop_rx(struct sdio_uart_port *port)
>         sdio_out(port, UART_IER, port->ier);
>  }
>
> -static void sdio_uart_receive_chars(struct sdio_uart_port *port,
> -                                   unsigned int *status)
> +static void sdio_uart_receive_chars(struct sdio_uart_port *port, u8 *status)
>  {
> -       unsigned int ch, flag;
> +       unsigned int flag;
>         int max_count = 256;
>
>         do {
> -               ch = sdio_in(port, UART_RX);
> +               u8 ch = sdio_in(port, UART_RX);
>                 flag = TTY_NORMAL;
>                 port->icount.rx++;
>
> @@ -449,8 +446,8 @@ static void sdio_uart_transmit_chars(struct sdio_uart_port *port)
>
>  static void sdio_uart_check_modem_status(struct sdio_uart_port *port)
>  {
> -       int status;
>         struct tty_struct *tty;
> +       u8 status;
>
>         status = sdio_in(port, UART_MSR);
>
> @@ -499,7 +496,7 @@ static void sdio_uart_check_modem_status(struct sdio_uart_port *port)
>  static void sdio_uart_irq(struct sdio_func *func)
>  {
>         struct sdio_uart_port *port = sdio_get_drvdata(func);
> -       unsigned int iir, lsr;
> +       u8 iir, lsr;
>
>         /*
>          * In a few places sdio_uart_irq() is called directly instead of
> --
> 2.43.0
>
diff mbox series

Patch

diff --git a/drivers/mmc/core/sdio_uart.c b/drivers/mmc/core/sdio_uart.c
index ef38dcd3a887..a05322f15771 100644
--- a/drivers/mmc/core/sdio_uart.c
+++ b/drivers/mmc/core/sdio_uart.c
@@ -178,11 +178,9 @@  static inline void sdio_uart_release_func(struct sdio_uart_port *port)
 		sdio_release_host(port->func);
 }
 
-static inline unsigned int sdio_in(struct sdio_uart_port *port, int offset)
+static inline u8 sdio_in(struct sdio_uart_port *port, int offset)
 {
-	unsigned char c;
-	c = sdio_readb(port->func, port->regs_offset + offset, NULL);
-	return c;
+	return sdio_readb(port->func, port->regs_offset + offset, NULL);
 }
 
 static inline void sdio_out(struct sdio_uart_port *port, int offset, int value)
@@ -192,8 +190,8 @@  static inline void sdio_out(struct sdio_uart_port *port, int offset, int value)
 
 static unsigned int sdio_uart_get_mctrl(struct sdio_uart_port *port)
 {
-	unsigned char status;
 	unsigned int ret;
+	u8 status;
 
 	/* FIXME: What stops this losing the delta bits and breaking
 	   sdio_uart_check_modem_status ? */
@@ -354,14 +352,13 @@  static void sdio_uart_stop_rx(struct sdio_uart_port *port)
 	sdio_out(port, UART_IER, port->ier);
 }
 
-static void sdio_uart_receive_chars(struct sdio_uart_port *port,
-				    unsigned int *status)
+static void sdio_uart_receive_chars(struct sdio_uart_port *port, u8 *status)
 {
-	unsigned int ch, flag;
+	unsigned int flag;
 	int max_count = 256;
 
 	do {
-		ch = sdio_in(port, UART_RX);
+		u8 ch = sdio_in(port, UART_RX);
 		flag = TTY_NORMAL;
 		port->icount.rx++;
 
@@ -449,8 +446,8 @@  static void sdio_uart_transmit_chars(struct sdio_uart_port *port)
 
 static void sdio_uart_check_modem_status(struct sdio_uart_port *port)
 {
-	int status;
 	struct tty_struct *tty;
+	u8 status;
 
 	status = sdio_in(port, UART_MSR);
 
@@ -499,7 +496,7 @@  static void sdio_uart_check_modem_status(struct sdio_uart_port *port)
 static void sdio_uart_irq(struct sdio_func *func)
 {
 	struct sdio_uart_port *port = sdio_get_drvdata(func);
-	unsigned int iir, lsr;
+	u8 iir, lsr;
 
 	/*
 	 * In a few places sdio_uart_irq() is called directly instead of