drivers/tty/serial/ingenic_uart.c: In function 'serial_ingenic_console_write':
drivers/tty/serial/ingenic_uart.c:923:42: error: passing argument 4 of 'uart_console_write' from incompatible pointer type [-Werror=incompatible-pointer-types]
uart_console_write(&up->port, s, count, serial_ingenic_console_putchar);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
commit 3f8bab174cb26aa5a8053c4457cc733881e3ad88
Author: Jiri Slaby <jirislaby@kernel.org>
Date: Thu Mar 3 09:08:31 2022 +0100
serial: make uart_console_write->putchar()'s character an unsigned char
Currently, uart_console_write->putchar's second parameter (the
character) is of type int. It makes little sense, provided uart_console_write()
accepts the input string as "const char *s" and passes its content -- the
characters -- to putchar(). So switch the character's type to unsigned
char.
We don't use char as that is signed on some platforms. That would cause
troubles for drivers which (implicitly) cast the char to u16 when
writing to the device. Sign extension would happen in that case and the
value written would be completely different to the provided char. DZ is
an example of such a driver -- on MIPS, it uses u16 for dz_out in
dz_console_putchar().
Note we do the char -> uchar conversion implicitly in
uart_console_write(). Provided we do not change size of the data type,
sign extension does not happen there, so the problem is void.
This makes the types consistent and unified with the rest of the uart
layer, which uses unsigned char in most places already. One exception is
xmit_buf, but that is going to be converted later.
-static void gf_early_console_putchar(struct uart_port *port, int ch)
+static void gf_early_console_putchar(struct uart_port *port, unsigned char ch)