projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e9deb1
)
serial: use DIV_ROUND_CLOSEST instead of open coding it
author
Uwe Kleine-König
<u.kleine-koenig@pengutronix.de>
Tue, 20 Dec 2011 10:47:44 +0000
(11:47 +0100)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Thu, 5 Jan 2012 00:18:54 +0000
(16:18 -0800)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/tty/serial/serial_core.c
patch
|
blob
|
history
diff --git
a/drivers/tty/serial/serial_core.c
b/drivers/tty/serial/serial_core.c
index d2990f7386063ea29883c659d3eeed3232bb2f85..c7bf31a6a7e75f711b711cad125a1b874db2fa04 100644
(file)
--- a/
drivers/tty/serial/serial_core.c
+++ b/
drivers/tty/serial/serial_core.c
@@
-421,7
+421,7
@@
uart_get_divisor(struct uart_port *port, unsigned int baud)
if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST)
quot = port->custom_divisor;
else
- quot =
(port->uartclk + (8 * baud)) / (
16 * baud);
+ quot =
DIV_ROUND_CLOSEST(port->uartclk,
16 * baud);
return quot;
}