mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
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>
This commit is contained in:
@@ -112,9 +112,9 @@ static void serial_out_dynamic(struct ns16550_plat *plat, u8 *addr,
|
||||
} else if (plat->reg_width == 4) {
|
||||
if (plat->flags & NS16550_FLAG_ENDIAN) {
|
||||
if (plat->flags & NS16550_FLAG_BE)
|
||||
out_be32(addr, value);
|
||||
out_be32((u32 *)addr, value);
|
||||
else
|
||||
out_le32(addr, value);
|
||||
out_le32((u32 *)addr, value);
|
||||
} else {
|
||||
writel(value, addr);
|
||||
}
|
||||
@@ -132,9 +132,9 @@ static int serial_in_dynamic(struct ns16550_plat *plat, u8 *addr)
|
||||
} else if (plat->reg_width == 4) {
|
||||
if (plat->flags & NS16550_FLAG_ENDIAN) {
|
||||
if (plat->flags & NS16550_FLAG_BE)
|
||||
return in_be32(addr);
|
||||
return in_be32((u32 *)addr);
|
||||
else
|
||||
return in_le32(addr);
|
||||
return in_le32((u32 *)addr);
|
||||
} else {
|
||||
return readl(addr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user