diff options
author | Jukka Laitinen <jukka.laitinen@iki.fi> | 2022-01-19 11:20:17 +0200 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2022-01-21 21:58:12 +0530 |
commit | 5d025eb2353550eadbd2fa9b8083a92fe9b07bd9 (patch) | |
tree | d894553a47e62e5224780e2836a4648bc778c9e8 /lib/utils/serial/uart8250.c | |
parent | fb688d9e9d4099d6945c9e460b9cd2c8c4d8a29b (diff) | |
download | opensbi-5d025eb2353550eadbd2fa9b8083a92fe9b07bd9.zip opensbi-5d025eb2353550eadbd2fa9b8083a92fe9b07bd9.tar.gz opensbi-5d025eb2353550eadbd2fa9b8083a92fe9b07bd9.tar.bz2 |
lib: fix pointer of type 'void *' used in arithmetic
Using "void *" in arithmetic causes errors with strict compiler settings:
"error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith]"
Avoid these by calculating on "char *" where 1-byte data size is assumed.
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
Reviewed-by: Dong Du <Dd_nirvana@sjtu.edu.cn>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils/serial/uart8250.c')
-rw-r--r-- | lib/utils/serial/uart8250.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/utils/serial/uart8250.c b/lib/utils/serial/uart8250.c index 1cf6624..142f8dc 100644 --- a/lib/utils/serial/uart8250.c +++ b/lib/utils/serial/uart8250.c @@ -39,7 +39,7 @@ /* clang-format on */ -static volatile void *uart8250_base; +static volatile char *uart8250_base; static u32 uart8250_in_freq; static u32 uart8250_baudrate; static u32 uart8250_reg_width; @@ -95,7 +95,7 @@ int uart8250_init(unsigned long base, u32 in_freq, u32 baudrate, u32 reg_shift, { u16 bdiv; - uart8250_base = (volatile void *)base; + uart8250_base = (volatile char *)base; uart8250_reg_shift = reg_shift; uart8250_reg_width = reg_width; uart8250_in_freq = in_freq; |