Skip to content

Commit 0fec518

Browse files
diandersgregkh
authored andcommitted
tty: serial: qcom-geni-serial: Fix %lu -> %u in print statements
When we multiply an unsigned int by a u32 we still end up with an unsigned int. That means we should specify "%u" not "%lu" in the format code. NOTE: this fix was chosen instead of somehow promoting the value to "unsigned long" since the max baud rate from the earlier call to uart_get_baud_rate() is 4000000 and the max sampling rate is 32. 4000000 * 32 = 0x07a12000, not even close to overflowing 32-bits. Fixes: c474c77 ("tty: serial: qcom-geni-serial: Fix get_clk_div_rate() which otherwise could return a sub-optimal clock rate.") Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20220802132250.1.Iea061e14157a17e114dbe2eca764568a02d6b889@changeid Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 014482b commit 0fec518

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/tty/serial/qcom_geni_serial.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,12 +1033,12 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport,
10331033
sampling_rate, &clk_div);
10341034
if (!clk_rate) {
10351035
dev_err(port->se.dev,
1036-
"Couldn't find suitable clock rate for %lu\n",
1036+
"Couldn't find suitable clock rate for %u\n",
10371037
baud * sampling_rate);
10381038
goto out_restart_rx;
10391039
}
10401040

1041-
dev_dbg(port->se.dev, "desired_rate-%lu, clk_rate-%lu, clk_div-%u\n",
1041+
dev_dbg(port->se.dev, "desired_rate-%u, clk_rate-%lu, clk_div-%u\n",
10421042
baud * sampling_rate, clk_rate, clk_div);
10431043

10441044
uport->uartclk = clk_rate;

0 commit comments

Comments
 (0)