]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tty: serial: fix print format specifiers
authorJoseph Tilahun <jtilahun@astranis.com>
Tue, 10 Jun 2025 06:56:53 +0000 (23:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jun 2025 11:24:33 +0000 (13:24 +0200)
commit33a2515abd45c64911955ff1da179589db54f99f
treeb816ee93b41142e50baba8bd93377d5d15ddde8f
parentd574c5dc8cfe1fd1ddda6edb435f3b3f39155c52
tty: serial: fix print format specifiers

The serial info sometimes produces negative TX/RX counts. E.g.:

3: uart:FSL_LPUART mmio:0x02970000 irq:46 tx:-1595870545 rx:339619
RTS|CTS|DTR|DSR|CD

It appears that the print format specifiers don't match with the types of
the respective variables. E.g.: All of the fields in struct uart_icount
are u32, but the format specifier used is %d, even though u32 is unsigned
and %d is for signed integers. Update drivers/tty/serial/serial_core.c
to use the proper format specifiers. Reference
https://docs.kernel.org/core-api/printk-formats.html as the documentation
for what format specifiers are the proper ones to use for a given C type.

Signed-off-by: Joseph Tilahun <jtilahun@astranis.com>
Link: https://lore.kernel.org/r/20250610065653.3750067-1-jtilahun@astranis.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c