serial: ns16550: Fix pointer type mismatch
authorJ. Neuschäfer <j.ne@posteo.net>
Tue, 18 Feb 2025 13:39:45 +0000 (14:39 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 28 Feb 2025 14:37:55 +0000 (08:37 -0600)
commitc634436038072270811008b2b698ddaec8be6967
treed5cd996be05c11ac02ad4064c4afc0117f3b99b4
parent1ca97ee9039293858988dc38ea3a8ff995b4950e
serial: ns16550: Fix pointer type mismatch

serial_out_dynamic() takes a u8* addr and uses it for 8-bit or 32-bit
accesses, depending on the value of plat->reg_width. This results in a
pointer type mismatch that the compiler may even turn into an error:

drivers/serial/ns16550.c: In function ‘serial_out_dynamic’:
drivers/serial/ns16550.c:115:42: error: passing argument 1 of ‘out_be32’ from incompatible pointer type [-Wincompatible-pointer-types]
  115 |                                 out_be32(addr, value);
      |                                          ^~~~
      |                                          |
      |                                          u8 * {aka unsigned char *}

This error was observed on PowerPC.

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
drivers/serial/ns16550.c