Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp38020420rwd; Wed, 12 Jul 2023 01:42:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlGyk8aNC5cn4giKE63ZiGhnq7a+uu724X0nZUIWmiHGSO4quk2BbpkPrqiZQ2JGHUtoYqs8 X-Received: by 2002:a17:906:77c3:b0:992:ef60:aadd with SMTP id m3-20020a17090677c300b00992ef60aaddmr1892339ejn.13.1689151344555; Wed, 12 Jul 2023 01:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689151344; cv=none; d=google.com; s=arc-20160816; b=YsZ0T/n26bUOLqWsyBGNWnyZETkaefXRjrCliUtIF9dM0Vna+zo/frDJ8Lp+j7NABA 48gIVZURpOxJdS6psJkwCdR02x+WVlf6R5aWuViETPjZwuAaDgn1Fk4k9ZJ60spyh096 MOxvN8CBs0y6VLQJMXKloxeh3hHG2tOgIIFc6rRPsovSaQC5fxtWlCrGV+3cLm0qO0+K Hl6/I/nheEAt7pyiDOeM7mTwlhfMgv2OPalPTMUDxmTADV7ax93RD2BLubPlyFEeVs2+ UTZ4spFFAch+w6mJ/gGgoRTl+vc+KDwEuNGJxkQe5AXZy/+J7Dv1AATUNuIstU69DZ3G rrKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cf4WelLyRShHBL5OuoWZlBNPBHnE88Dz9YHWGVWF8SU=; fh=+nUPXxtudl8of3CLhBprUyO3RGaXO/cUv5kboPxIvoY=; b=nxYiH7jqfcc1HpU7mINLAfBYz0NAdAaormqw3rQJKxbQI4+9AXRuI4ApODqTqS4d2c moXEuUDYaAVBBC7gmKlf3K+uuy2zQWFrmqkCsMrqBgpA+2gBV6xjdSS+d54Up85B461d YTXqv1Lk1dLQkBCBIlrXwtGN/Xw1i0IagbPGUTJfo+Do2jgGQYJcYV/T4Dcdu6HHC3Sp Syjl2TtcGpSDEd3siTOsEmPoP2TqQvj1V4JpLTWJBYtqOeVLE1aKI7v1H1XWqNXgq+bZ rLaaYVjZsuc2uI+twa1PhwBNhpQhXbkYSDXQUA7zN9qlK6s4SxP0XBwPwLdZiYRA09MQ 1wbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SBF0x1hW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k20-20020a17090627d400b00992b55d152esi4163751ejc.242.2023.07.12.01.42.00; Wed, 12 Jul 2023 01:42:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SBF0x1hW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232559AbjGLIY1 (ORCPT + 99 others); Wed, 12 Jul 2023 04:24:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233005AbjGLIX3 (ORCPT ); Wed, 12 Jul 2023 04:23:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A06D468B; Wed, 12 Jul 2023 01:19:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E7AB1616EE; Wed, 12 Jul 2023 08:18:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A89DC433C9; Wed, 12 Jul 2023 08:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689149922; bh=EEDkBWFl67zoqQz2m6m34DP9qxoyKZS78gow73gj2zc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SBF0x1hW+EqtxMgDJotZlaE7TYgUP4QUnvaTk6LGsdNKkf49nWqf38q0oasOEQ186 Biv+sn1PUjSeWrcXEgK7/s7HDv+ua6wyOIs0K9USQi/rBgiQyfXVKgOriwikvBr0xY TX+Dou/Gmyglh8oPn4KgIQWI5gSbEsdoZ+YYRYlyIHfNJo6eOOgiSFhlPIVPiESAVS X+dg1kFT7cpUJydcFKG+GuRy+jHcg3wKGNWuShfzGA3YLyc8/MFJSrRYZKeBNArKle iauNkyYWGYMwVQU05W/LfreQDcErM7Ly4hG+AJGA11lyEvSn3UnXpSuYNIdktexTji f4YKALgGKUVPA== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Tobias Klauser , Russell King , Vineet Gupta , Richard Genoud , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Alexander Shiyan , Baruch Siach , "Maciej W. Rozycki" , Taichi Sugaya , Takao Orito , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Kevin Cernekee , Krzysztof Kozlowski , Alim Akhtar , Laxman Dewangan , Thierry Reding , Jonathan Hunter , Palmer Dabbelt , Paul Walmsley , Orson Zhai , Baolin Wang , Chunyan Zhang , Patrice Chotard , Maxime Coquelin , Alexandre Torgue , Hammer Hsieh Subject: [PATCH 10/10] serial: drivers: switch ch and flag to u8 Date: Wed, 12 Jul 2023 10:18:11 +0200 Message-ID: <20230712081811.29004-11-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712081811.29004-1-jirislaby@kernel.org> References: <20230712081811.29004-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that the serial layer explicitly expects 'u8' for flags and characters, propagate this type to drivers' (RX) routines. Note that amba-pl011's, clps711x's and st-asc's 'ch' are left unchanged because 'ch' contains not only a character, but whole status. Signed-off-by: Jiri Slaby (SUSE) Cc: Tobias Klauser Cc: Russell King Cc: Vineet Gupta Cc: Richard Genoud Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Claudiu Beznea Cc: Alexander Shiyan Cc: Baruch Siach Cc: "Maciej W. Rozycki" Cc: Taichi Sugaya Cc: Takao Orito Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: Kevin Cernekee Cc: Krzysztof Kozlowski Cc: Alim Akhtar Cc: Laxman Dewangan Cc: Thierry Reding Cc: Jonathan Hunter Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Orson Zhai Cc: Baolin Wang Cc: Chunyan Zhang Cc: Patrice Chotard Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: Hammer Hsieh --- drivers/tty/serial/21285.c | 3 ++- drivers/tty/serial/8250/8250_port.c | 3 +-- drivers/tty/serial/altera_jtaguart.c | 2 +- drivers/tty/serial/altera_uart.c | 2 +- drivers/tty/serial/amba-pl010.c | 3 ++- drivers/tty/serial/amba-pl011.c | 3 ++- drivers/tty/serial/apbuart.c | 3 ++- drivers/tty/serial/arc_uart.c | 2 +- drivers/tty/serial/atmel_serial.c | 2 +- drivers/tty/serial/clps711x.c | 3 ++- drivers/tty/serial/digicolor-usart.c | 3 +-- drivers/tty/serial/dz.c | 2 +- drivers/tty/serial/ip22zilog.c | 2 +- drivers/tty/serial/max3100.c | 3 ++- drivers/tty/serial/max310x.c | 3 ++- drivers/tty/serial/mcf.c | 2 +- drivers/tty/serial/milbeaut_usio.c | 3 +-- drivers/tty/serial/mxs-auart.c | 3 +-- drivers/tty/serial/omap-serial.c | 4 ++-- drivers/tty/serial/pxa.c | 2 +- drivers/tty/serial/rp2.c | 4 ++-- drivers/tty/serial/sa1100.c | 3 ++- drivers/tty/serial/samsung_tty.c | 3 ++- drivers/tty/serial/sb1250-duart.c | 3 ++- drivers/tty/serial/sc16is7xx.c | 3 ++- drivers/tty/serial/sccnxp.c | 3 +-- drivers/tty/serial/serial-tegra.c | 7 +++---- drivers/tty/serial/serial_txx9.c | 3 +-- drivers/tty/serial/sifive.c | 2 +- drivers/tty/serial/sprd_serial.c | 5 +++-- drivers/tty/serial/st-asc.c | 2 +- drivers/tty/serial/stm32-usart.c | 5 ++--- drivers/tty/serial/sunplus-uart.c | 2 +- drivers/tty/serial/zs.c | 3 ++- 34 files changed, 53 insertions(+), 48 deletions(-) diff --git a/drivers/tty/serial/21285.c b/drivers/tty/serial/21285.c index 185462fd959c..d756fcc884cb 100644 --- a/drivers/tty/serial/21285.c +++ b/drivers/tty/serial/21285.c @@ -117,7 +117,8 @@ static void serial21285_stop_rx(struct uart_port *port) static irqreturn_t serial21285_rx_chars(int irq, void *dev_id) { struct uart_port *port = dev_id; - unsigned int status, ch, flag, rxs, max_count = 256; + unsigned int status, rxs, max_count = 256; + u8 ch, flag; status = *CSR_UARTFLG; while (!(status & 0x10) && max_count--) { diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 16aeb1420137..0533e75adca9 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1706,8 +1706,7 @@ static void serial8250_enable_ms(struct uart_port *port) void serial8250_read_char(struct uart_8250_port *up, u16 lsr) { struct uart_port *port = &up->port; - unsigned char ch; - char flag = TTY_NORMAL; + u8 ch, flag = TTY_NORMAL; if (likely(lsr & UART_LSR_DR)) ch = serial_in(up, UART_RX); diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c index 9f843d1cee40..6203ca1de769 100644 --- a/drivers/tty/serial/altera_jtaguart.c +++ b/drivers/tty/serial/altera_jtaguart.c @@ -110,8 +110,8 @@ static void altera_jtaguart_set_termios(struct uart_port *port, static void altera_jtaguart_rx_chars(struct uart_port *port) { - unsigned char ch; unsigned long status; + u8 ch; while ((status = readl(port->membase + ALTERA_JTAGUART_DATA_REG)) & ALTERA_JTAGUART_DATA_RVALID_MSK) { diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c index 9ce3d24af536..a9c41942190c 100644 --- a/drivers/tty/serial/altera_uart.c +++ b/drivers/tty/serial/altera_uart.c @@ -201,8 +201,8 @@ static void altera_uart_set_termios(struct uart_port *port, static void altera_uart_rx_chars(struct uart_port *port) { - unsigned char ch, flag; unsigned short status; + u8 ch, flag; while ((status = altera_uart_readl(port, ALTERA_UART_STATUS_REG)) & ALTERA_UART_STATUS_RRDY_MSK) { diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c index a98fae2ca422..b5a7404cbacb 100644 --- a/drivers/tty/serial/amba-pl010.c +++ b/drivers/tty/serial/amba-pl010.c @@ -112,7 +112,8 @@ static void pl010_enable_ms(struct uart_port *port) static void pl010_rx_chars(struct uart_port *port) { - unsigned int status, ch, flag, rsr, max_count = 256; + unsigned int status, rsr, max_count = 256; + u8 ch, flag; status = readb(port->membase + UART01x_FR); while (UART_RX_DATA(status) && max_count--) { diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index c5c3f4674459..8bddc7470bcc 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -307,9 +307,10 @@ static void pl011_write(unsigned int val, const struct uart_amba_port *uap, */ static int pl011_fifo_to_tty(struct uart_amba_port *uap) { - unsigned int ch, flag, fifotaken; + unsigned int ch, fifotaken; int sysrq; u16 status; + u8 flag; for (fifotaken = 0; fifotaken != 256; fifotaken++) { status = pl011_read(uap, REG_FR); diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c index 915ee4b0d594..372db052573d 100644 --- a/drivers/tty/serial/apbuart.c +++ b/drivers/tty/serial/apbuart.c @@ -70,8 +70,9 @@ static void apbuart_stop_rx(struct uart_port *port) static void apbuart_rx_chars(struct uart_port *port) { - unsigned int status, ch, rsr, flag; + unsigned int status, rsr; unsigned int max_chars = port->fifosize; + u8 ch, flag; status = UART_GET_STATUS(port); diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c index 835903488acb..ad4ae19b6ce3 100644 --- a/drivers/tty/serial/arc_uart.c +++ b/drivers/tty/serial/arc_uart.c @@ -205,7 +205,7 @@ static void arc_serial_rx_chars(struct uart_port *port, unsigned int status) * controller, which is indeed the Rx-FIFO. */ do { - unsigned int ch, flg = TTY_NORMAL; + u8 ch, flg = TTY_NORMAL; /* * This could be an Rx Intr for err (no data), diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 3467a875641a..ec54436969dc 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -1516,8 +1516,8 @@ static void atmel_rx_from_ring(struct uart_port *port) { struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); struct circ_buf *ring = &atmel_port->rx_ring; - unsigned int flg; unsigned int status; + u8 flg; while (ring->head != ring->tail) { struct atmel_uart_char c; diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c index e49bc4019b50..be8b8788d2e2 100644 --- a/drivers/tty/serial/clps711x.c +++ b/drivers/tty/serial/clps711x.c @@ -92,8 +92,9 @@ static irqreturn_t uart_clps711x_int_rx(int irq, void *dev_id) { struct uart_port *port = dev_id; struct clps711x_port *s = dev_get_drvdata(port->dev); - unsigned int status, flg; + unsigned int status; u16 ch; + u8 flg; for (;;) { u32 sysflg = 0; diff --git a/drivers/tty/serial/digicolor-usart.c b/drivers/tty/serial/digicolor-usart.c index ed197705f7ee..128b5479e813 100644 --- a/drivers/tty/serial/digicolor-usart.c +++ b/drivers/tty/serial/digicolor-usart.c @@ -136,8 +136,7 @@ static void digicolor_uart_rx(struct uart_port *port) spin_lock_irqsave(&port->lock, flags); while (1) { - u8 status, ch; - unsigned int ch_flag; + u8 status, ch, ch_flag; if (digicolor_uart_rx_empty(port)) break; diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c index 6b7ed7f2f3ca..667f52e83277 100644 --- a/drivers/tty/serial/dz.c +++ b/drivers/tty/serial/dz.c @@ -181,8 +181,8 @@ static inline void dz_receive_chars(struct dz_mux *mux) struct dz_port *dport = &mux->dport[0]; struct uart_icount *icount; int lines_rx[DZ_NB_PORT] = { [0 ... DZ_NB_PORT - 1] = 0 }; - unsigned char ch, flag; u16 status; + u8 ch, flag; int i; while ((status = dz_in(dport, DZ_RBUF)) & DZ_DVAL) { diff --git a/drivers/tty/serial/ip22zilog.c b/drivers/tty/serial/ip22zilog.c index b1f27e168135..845ff706bc59 100644 --- a/drivers/tty/serial/ip22zilog.c +++ b/drivers/tty/serial/ip22zilog.c @@ -248,8 +248,8 @@ static void ip22zilog_maybe_update_regs(struct uart_ip22zilog_port *up, static bool ip22zilog_receive_chars(struct uart_ip22zilog_port *up, struct zilog_channel *channel) { - unsigned char ch, flag; unsigned int r1; + u8 ch, flag; bool push = up->port.state != NULL; for (;;) { diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index 86dcbff8faa3..5efb2b593be3 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c @@ -215,8 +215,9 @@ static int max3100_sr(struct max3100_port *s, u16 tx, u16 *rx) static int max3100_handlerx(struct max3100_port *s, u16 rx) { - unsigned int ch, flg, status = 0; + unsigned int status = 0; int ret = 0, cts; + u8 ch, flg; if (rx & MAX3100_R && s->rx_enabled) { dev_dbg(&s->spi->dev, "%s\n", __func__); diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 997e39449766..416d553b73a7 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -669,7 +669,8 @@ static void max310x_batch_read(struct uart_port *port, u8 *rxbuf, unsigned int l static void max310x_handle_rx(struct uart_port *port, unsigned int rxlen) { struct max310x_one *one = to_max310x_port(port); - unsigned int sts, ch, flag, i; + unsigned int sts, i; + u8 ch, flag; if (port->read_status_mask == MAX310X_LSR_RXOVR_BIT) { /* We are just reading, happily ignoring any error conditions. diff --git a/drivers/tty/serial/mcf.c b/drivers/tty/serial/mcf.c index 3239babe12a4..1666ce012e5e 100644 --- a/drivers/tty/serial/mcf.c +++ b/drivers/tty/serial/mcf.c @@ -281,7 +281,7 @@ static void mcf_set_termios(struct uart_port *port, struct ktermios *termios, static void mcf_rx_chars(struct mcf_uart *pp) { struct uart_port *port = &pp->port; - unsigned char status, ch, flag; + u8 status, ch, flag; while ((status = readb(port->membase + MCFUART_USR)) & MCFUART_USR_RXREADY) { ch = readb(port->membase + MCFUART_URB); diff --git a/drivers/tty/serial/milbeaut_usio.c b/drivers/tty/serial/milbeaut_usio.c index 44988a2941b8..70a910085e93 100644 --- a/drivers/tty/serial/milbeaut_usio.c +++ b/drivers/tty/serial/milbeaut_usio.c @@ -148,8 +148,7 @@ static void mlb_usio_enable_ms(struct uart_port *port) static void mlb_usio_rx_chars(struct uart_port *port) { struct tty_port *ttyport = &port->state->port; - unsigned long flag = 0; - char ch = 0; + u8 flag = 0, ch = 0; u8 status; int max_count = 2; diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index a368f4293967..2ef10997df18 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c @@ -616,9 +616,8 @@ static void mxs_auart_tx_chars(struct mxs_auart_port *s) static void mxs_auart_rx_char(struct mxs_auart_port *s) { - int flag; u32 stat; - u8 c; + u8 c, flag; c = mxs_read(s, REG_DATA); stat = mxs_read(s, REG_STAT); diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 16ab7ea07fa3..2c11870fa894 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -442,7 +442,7 @@ static unsigned int check_modem_status(struct uart_omap_port *up) static void serial_omap_rlsi(struct uart_omap_port *up, unsigned int lsr) { - unsigned int flag; + u8 flag; /* * Read one data character out to avoid stalling the receiver according @@ -498,7 +498,7 @@ static void serial_omap_rlsi(struct uart_omap_port *up, unsigned int lsr) static void serial_omap_rdi(struct uart_omap_port *up, unsigned int lsr) { - unsigned char ch = 0; + u8 ch; if (!(lsr & UART_LSR_DR)) return; diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c index 444fa4b654ac..73c60f5ea027 100644 --- a/drivers/tty/serial/pxa.c +++ b/drivers/tty/serial/pxa.c @@ -90,7 +90,7 @@ static void serial_pxa_stop_rx(struct uart_port *port) static inline void receive_chars(struct uart_pxa_port *up, int *status) { - unsigned int ch, flag; + u8 ch, flag; int max_count = 256; do { diff --git a/drivers/tty/serial/rp2.c b/drivers/tty/serial/rp2.c index 749b873a5d99..de220ac8ca54 100644 --- a/drivers/tty/serial/rp2.c +++ b/drivers/tty/serial/rp2.c @@ -401,14 +401,14 @@ static void rp2_rx_chars(struct rp2_uart_port *up) for (; bytes != 0; bytes--) { u32 byte = readw(up->base + RP2_DATA_BYTE) | RP2_DUMMY_READ; - char ch = byte & 0xff; + u8 ch = byte & 0xff; if (likely(!(byte & RP2_DATA_BYTE_EXCEPTION_MASK))) { if (!uart_handle_sysrq_char(&up->port, ch)) uart_insert_char(&up->port, byte, 0, ch, TTY_NORMAL); } else { - char flag = TTY_NORMAL; + u8 flag = TTY_NORMAL; if (byte & RP2_DATA_BYTE_BREAK_m) flag = TTY_BREAK; diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c index 55107bbc00ce..ad011f1e2f4d 100644 --- a/drivers/tty/serial/sa1100.c +++ b/drivers/tty/serial/sa1100.c @@ -180,7 +180,8 @@ static void sa1100_enable_ms(struct uart_port *port) static void sa1100_rx_chars(struct sa1100_port *sport) { - unsigned int status, ch, flg; + unsigned int status; + u8 ch, flg; status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) | UTSR0_TO_SM(UART_GET_UTSR0(sport)); diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index b29e9dfd81a6..aa4a184f4a6c 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -759,9 +759,10 @@ static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id) static void s3c24xx_serial_rx_drain_fifo(struct s3c24xx_uart_port *ourport) { struct uart_port *port = &ourport->port; - unsigned int ufcon, ch, flag, ufstat, uerstat; + unsigned int ufcon, ufstat, uerstat; unsigned int fifocnt = 0; int max_count = port->fifosize; + u8 ch, flag; while (max_count-- > 0) { /* diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c index b6de0dc51f29..f3cd69346482 100644 --- a/drivers/tty/serial/sb1250-duart.c +++ b/drivers/tty/serial/sb1250-duart.c @@ -331,8 +331,9 @@ static void sbd_receive_chars(struct sbd_port *sport) { struct uart_port *uport = &sport->port; struct uart_icount *icount; - unsigned int status, ch, flag; + unsigned int status; int count; + u8 ch, flag; for (count = 16; count; count--) { status = read_sbdchn(sport, R_DUART_STATUS); diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 2e7e7c409cf2..cfffc730ba34 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -578,8 +578,9 @@ static void sc16is7xx_handle_rx(struct uart_port *port, unsigned int rxlen, unsigned int iir) { struct sc16is7xx_port *s = dev_get_drvdata(port->dev); - unsigned int lsr = 0, ch, flag, bytes_read, i; + unsigned int lsr = 0, bytes_read, i; bool read_lsr = (iir == SC16IS7XX_IIR_RLSE_SRC) ? true : false; + u8 ch, flag; if (unlikely(rxlen >= sizeof(s->buf))) { dev_warn_ratelimited(port->dev, diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c index 4f2fc5f7bb19..31ee46eba580 100644 --- a/drivers/tty/serial/sccnxp.c +++ b/drivers/tty/serial/sccnxp.c @@ -383,8 +383,7 @@ static void sccnxp_set_bit(struct uart_port *port, int sig, int state) static void sccnxp_handle_rx(struct uart_port *port) { - u8 sr; - unsigned int ch, flag; + u8 sr, ch, flag; for (;;) { sr = sccnxp_port_read(port, SCCNXP_SR_REG); diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c index 1cf08b33456c..813ae97159c4 100644 --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c @@ -434,10 +434,10 @@ static int tegra_set_baudrate(struct tegra_uart_port *tup, unsigned int baud) return 0; } -static char tegra_uart_decode_rx_error(struct tegra_uart_port *tup, +static u8 tegra_uart_decode_rx_error(struct tegra_uart_port *tup, unsigned long lsr) { - char flag = TTY_NORMAL; + u8 flag = TTY_NORMAL; if (unlikely(lsr & TEGRA_UART_LSR_ANY)) { if (lsr & UART_LSR_OE) { @@ -642,9 +642,8 @@ static void tegra_uart_handle_rx_pio(struct tegra_uart_port *tup, struct tty_port *port) { do { - char flag = TTY_NORMAL; unsigned long lsr = 0; - unsigned char ch; + u8 ch, flag = TTY_NORMAL; lsr = tegra_uart_read(tup, UART_LSR); if (!(lsr & UART_LSR_DR)) diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c index eab387b01e36..be08fb6f749c 100644 --- a/drivers/tty/serial/serial_txx9.c +++ b/drivers/tty/serial/serial_txx9.c @@ -246,11 +246,10 @@ static void serial_txx9_initialize(struct uart_port *up) static inline void receive_chars(struct uart_port *up, unsigned int *status) { - unsigned char ch; unsigned int disr = *status; int max_count = 256; - char flag; unsigned int next_ignore_status_mask; + u8 ch, flag; do { ch = sio_in(up, TXX9_SIRFIFO); diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c index 1f565a216e74..c00080f12cab 100644 --- a/drivers/tty/serial/sifive.c +++ b/drivers/tty/serial/sifive.c @@ -402,9 +402,9 @@ static char __ssp_receive_char(struct sifive_serial_port *ssp, char *is_empty) */ static void __ssp_receive_chars(struct sifive_serial_port *ssp) { - unsigned char ch; char is_empty; int c; + u8 ch; for (c = SIFIVE_RX_FIFO_DEPTH; c > 0; --c) { ch = __ssp_receive_char(ssp, &is_empty); diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index b58f51296ace..8f6fd1cd91d7 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -558,7 +558,7 @@ static void sprd_break_ctl(struct uart_port *port, int break_state) } static int handle_lsr_errors(struct uart_port *port, - unsigned int *flag, + u8 *flag, unsigned int *lsr) { int ret = 0; @@ -594,7 +594,8 @@ static inline void sprd_rx(struct uart_port *port) struct sprd_uart_port *sp = container_of(port, struct sprd_uart_port, port); struct tty_port *tty = &port->state->port; - unsigned int ch, flag, lsr, max_count = SPRD_TIMEOUT; + unsigned int lsr, max_count = SPRD_TIMEOUT; + u8 ch, flag; if (sp->rx_dma.enable) { sprd_uart_dma_irq(port); diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index aa471c9c24d9..387bc69bb1fe 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -250,7 +250,7 @@ static void asc_receive_chars(struct uart_port *port) struct tty_port *tport = &port->state->port; unsigned long status, mode; unsigned long c = 0; - char flag; + u8 flag; bool ignore_pe = false; /* diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index e9e11a259621..be47cd343cf6 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -321,7 +321,7 @@ static bool stm32_usart_pending_rx_pio(struct uart_port *port, u32 *sr) return false; } -static unsigned long stm32_usart_get_char_pio(struct uart_port *port) +static u8 stm32_usart_get_char_pio(struct uart_port *port) { struct stm32_port *stm32_port = to_stm32_port(port); const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; @@ -338,10 +338,9 @@ static unsigned int stm32_usart_receive_chars_pio(struct uart_port *port) { struct stm32_port *stm32_port = to_stm32_port(port); const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; - unsigned long c; unsigned int size = 0; u32 sr; - char flag; + u8 c, flag; while (stm32_usart_pending_rx_pio(port, &sr)) { sr |= USART_SR_DUMMY_RX; diff --git a/drivers/tty/serial/sunplus-uart.c b/drivers/tty/serial/sunplus-uart.c index 727942c43c45..3aacd5eb414c 100644 --- a/drivers/tty/serial/sunplus-uart.c +++ b/drivers/tty/serial/sunplus-uart.c @@ -231,7 +231,7 @@ static void transmit_chars(struct uart_port *port) static void receive_chars(struct uart_port *port) { unsigned int lsr = readl(port->membase + SUP_UART_LSR); - unsigned int ch, flag; + u8 ch, flag; do { ch = readl(port->membase + SUP_UART_DATA); diff --git a/drivers/tty/serial/zs.c b/drivers/tty/serial/zs.c index 730c648e32ff..65ca4da6e368 100644 --- a/drivers/tty/serial/zs.c +++ b/drivers/tty/serial/zs.c @@ -539,8 +539,9 @@ static void zs_receive_chars(struct zs_port *zport) struct uart_port *uport = &zport->port; struct zs_scc *scc = zport->scc; struct uart_icount *icount; - unsigned int avail, status, ch, flag; + unsigned int avail, status; int count; + u8 ch, flag; for (count = 16; count; count--) { spin_lock(&scc->zlock); -- 2.41.0