From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96540169AD2; Tue, 16 Jun 2026 18:39:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781635173; cv=none; b=Y16a3/Bzi5PU9yrzdsvxBpsunGiUJkFFAxRKJs2zEHee7305+Gh+ny7BWIhKeGykz7wU4ZCvEPIaImXAdqAWlIB6uAhim21hYTpWYr4e1Z3usGY9cgpeJRORMN+DeWslO1kp0C+dvt43yoAbrUjYiTD3wt2Llf3TM6xsrvHgW0A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781635173; c=relaxed/simple; bh=VNyzP8ycTZDOub6ru8TVCXuwt+Yq2A4XNtVqOwCaw54=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=okEamKOHVy2tzjx3TRvzH70ZttbICciIOYSy1w8yFeiktuuQTg9QZDvK4SHSsPtRbwxXhshS7v6paJl0TezLOTIIRdQ8eJHaPnxwBq4llgsYW7NlEHZSr7UEyttLPrYmM66fWeK3yr/KfoKgtAj/XiDLAZSTF2i9zazYdE+Z5yY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XwiP/ScL; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XwiP/ScL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97C901F000E9; Tue, 16 Jun 2026 18:39:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781635172; bh=qHvtNmSKH80Qba/uhzjP6++hT8eG9cniCNO/QX+OM9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XwiP/ScLZpX54mxpQZA+pZ+sEVFqfElHWj4nGHsorjRiHnpQNRRjvpPm2dj2rqNoS 3lDhHEL9op34IGcmdCNlEDBqgRmSqbn+ikdJbSUXfWzOqgXhnOPuGkKx7FU3FQk2Zx FciZlIAWUpGxEAVzK20HHFYR2P4z4cO+4/T9UpAI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sam Protsenko , Tudor Ambarus , Sasha Levin Subject: [PATCH 5.15 371/411] tty: serial: samsung: use u32 for register interactions Date: Tue, 16 Jun 2026 20:30:09 +0530 Message-ID: <20260616145121.045435298@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145100.376842714@linuxfoundation.org> References: <20260616145100.376842714@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tudor Ambarus [ Upstream commit 032a725c16add79332d774348d7ad7d0d4b86479 ] All registers of the IP have 32 bits. Use u32 variables when reading or writing from/to the registers. The purpose of those variables becomes clearer. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20240119104526.1221243-9-tudor.ambarus@linaro.org Signed-off-by: Greg Kroah-Hartman Stable-dep-of: a3bb136bff5e ("tty: serial: samsung: Remove redundant port lock acquisition in rx helpers") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/samsung_tty.c | 44 ++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 23 deletions(-) --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -243,8 +243,8 @@ static void s3c24xx_serial_rx_enable(str { struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned long flags; - unsigned int ucon, ufcon; int count = 10000; + u32 ucon, ufcon; uart_port_lock_irqsave(port, &flags); @@ -267,7 +267,7 @@ static void s3c24xx_serial_rx_disable(st { struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned long flags; - unsigned int ucon; + u32 ucon; uart_port_lock_irqsave(port, &flags); @@ -664,7 +664,7 @@ static void s3c64xx_start_rx_dma(struct static void enable_rx_dma(struct s3c24xx_uart_port *ourport) { struct uart_port *port = &ourport->port; - unsigned int ucon; + u32 ucon; /* set Rx mode to DMA mode */ ucon = rd_regl(port, S3C2410_UCON); @@ -687,7 +687,7 @@ static void enable_rx_dma(struct s3c24xx static void enable_rx_pio(struct s3c24xx_uart_port *ourport) { struct uart_port *port = &ourport->port; - unsigned int ucon; + u32 ucon; /* set Rx mode to DMA mode */ ucon = rd_regl(port, S3C2410_UCON); @@ -712,13 +712,14 @@ static void s3c24xx_serial_rx_drain_fifo static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id) { - unsigned int utrstat, received; struct s3c24xx_uart_port *ourport = dev_id; struct uart_port *port = &ourport->port; struct s3c24xx_uart_dma *dma = ourport->dma; struct tty_struct *tty = tty_port_tty_get(&ourport->port.state->port); struct tty_port *t = &port->state->port; struct dma_tx_state state; + unsigned int received; + u32 utrstat; utrstat = rd_regl(port, S3C2410_UTRSTAT); rd_regl(port, S3C2410_UFSTAT); @@ -1000,7 +1001,7 @@ static unsigned int s3c24xx_serial_tx_em /* no modem control lines */ static unsigned int s3c24xx_serial_get_mctrl(struct uart_port *port) { - unsigned int umstat = rd_reg(port, S3C2410_UMSTAT); + u32 umstat = rd_reg(port, S3C2410_UMSTAT); if (umstat & S3C2410_UMSTAT_CTS) return TIOCM_CAR | TIOCM_DSR | TIOCM_CTS; @@ -1023,7 +1024,7 @@ static void s3c24xx_serial_set_mctrl(str static void s3c24xx_serial_break_ctl(struct uart_port *port, int break_state) { unsigned long flags; - unsigned int ucon; + u32 ucon; uart_port_lock_irqsave(port, &flags); @@ -1204,7 +1205,7 @@ static void apple_s5l_serial_shutdown(st { struct s3c24xx_uart_port *ourport = to_ourport(port); - unsigned int ucon; + u32 ucon; ucon = rd_regl(port, S3C2410_UCON); ucon &= ~(APPLE_S5L_UCON_TXTHRESH_ENA_MSK | @@ -1272,7 +1273,7 @@ static int s3c64xx_serial_startup(struct { struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned long flags; - unsigned int ufcon; + u32 ufcon; int ret; wr_regl(port, S3C64XX_UINTM, 0xf); @@ -1317,7 +1318,7 @@ static int apple_s5l_serial_startup(stru { struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned long flags; - unsigned int ufcon; + u32 ufcon; int ret; wr_regl(port, S3C2410_UTRSTAT, APPLE_S5L_UTRSTAT_ALL_FLAGS); @@ -1559,9 +1560,8 @@ static void s3c24xx_serial_set_termios(s struct clk *clk = ERR_PTR(-EINVAL); unsigned long flags; unsigned int baud, quot, clk_sel = 0; - unsigned int ulcon; - unsigned int umcon; unsigned int udivslot = 0; + u32 ulcon, umcon; /* * We don't support modem control lines. @@ -2147,7 +2147,7 @@ static int s3c24xx_serial_init_port(stru wr_regl(port, S3C64XX_UINTSP, 0xf); break; case TYPE_APPLE_S5L: { - unsigned int ucon; + u32 ucon; ucon = rd_regl(port, S3C2410_UCON); ucon &= ~(APPLE_S5L_UCON_TXTHRESH_ENA_MSK | @@ -2366,7 +2366,7 @@ static int s3c24xx_serial_resume_noirq(s /* restore IRQ mask */ switch (ourport->info->type) { case TYPE_S3C6400: { - unsigned int uintm = 0xf; + u32 uintm = 0xf; if (ourport->tx_enabled) uintm &= ~S3C64XX_UINTM_TXD_MSK; @@ -2382,7 +2382,7 @@ static int s3c24xx_serial_resume_noirq(s break; } case TYPE_APPLE_S5L: { - unsigned int ucon; + u32 ucon; int ret; ret = clk_prepare_enable(ourport->clk); @@ -2445,7 +2445,7 @@ static const struct dev_pm_ops s3c24xx_s static struct uart_port *cons_uart; static int -s3c24xx_serial_console_txrdy(struct uart_port *port, unsigned int ufcon) +s3c24xx_serial_console_txrdy(struct uart_port *port, u32 ufcon) { struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); unsigned long ufstat, utrstat; @@ -2464,7 +2464,7 @@ s3c24xx_serial_console_txrdy(struct uart } static bool -s3c24xx_port_configured(unsigned int ucon) +s3c24xx_port_configured(u32 ucon) { /* consider the serial port configured if the tx/rx mode set */ return (ucon & 0xf) != 0; @@ -2491,8 +2491,8 @@ static int s3c24xx_serial_get_poll_char( static void s3c24xx_serial_put_poll_char(struct uart_port *port, unsigned char c) { - unsigned int ufcon = rd_regl(port, S3C2410_UFCON); - unsigned int ucon = rd_regl(port, S3C2410_UCON); + u32 ufcon = rd_regl(port, S3C2410_UFCON); + u32 ucon = rd_regl(port, S3C2410_UCON); /* not possible to xmit on unconfigured port */ if (!s3c24xx_port_configured(ucon)) @@ -2508,7 +2508,7 @@ static void s3c24xx_serial_put_poll_char static void s3c24xx_serial_console_putchar(struct uart_port *port, int ch) { - unsigned int ufcon = rd_regl(port, S3C2410_UFCON); + u32 ufcon = rd_regl(port, S3C2410_UFCON); while (!s3c24xx_serial_console_txrdy(port, ufcon)) cpu_relax(); @@ -2533,11 +2533,9 @@ s3c24xx_serial_get_options(struct uart_p int *parity, int *bits) { struct clk *clk; - unsigned int ulcon; - unsigned int ucon; - unsigned int ubrdiv; unsigned long rate; unsigned int clk_sel; + u32 ulcon, ucon, ubrdiv; char clk_name[MAX_CLK_NAME_LENGTH]; ulcon = rd_regl(port, S3C2410_ULCON);