[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231014104942.856152-3-vamshigajjela@google.com>
Date: Sat, 14 Oct 2023 16:19:41 +0530
From: Vamshi Gajjela <vamshigajjela@...gle.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
ilpo.jarvinen@...ux.intel.com
Cc: linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
manugautam@...gle.com, Subhash Jadavani <sjadavani@...gle.com>,
Channa Kadabi <kadabi@...gle.com>,
VAMSHI GAJJELA <vamshigajjela@...gle.com>
Subject: [PATCH 2/3] serial: core: Make local variable size to u64
From: VAMSHI GAJJELA <vamshigajjela@...gle.com>
The variable size has been changed from u32 to u64 to accommodate a
larger range of values without the need for explicit typecasting.
Signed-off-by: VAMSHI GAJJELA <vamshigajjela@...gle.com>
---
drivers/tty/serial/serial_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 7bdc21d5e13b..fb4696d17a8b 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -410,10 +410,10 @@ void
uart_update_timeout(struct uart_port *port, unsigned int cflag,
unsigned int baud)
{
- unsigned int size = tty_get_frame_size(cflag);
+ u64 size = tty_get_frame_size(cflag);
u64 frame_time;
- frame_time = (u64)size * NSEC_PER_SEC;
+ frame_time = size * NSEC_PER_SEC;
port->frame_time = DIV64_U64_ROUND_UP(frame_time, baud);
}
EXPORT_SYMBOL(uart_update_timeout);
--
2.42.0.655.g421f12c284-goog
Powered by blists - more mailing lists