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>
This commit is contained in:
Jukka Laitinen
2022-01-19 11:20:17 +02:00
committed by Anup Patel
parent fb688d9e9d
commit 5d025eb235
13 changed files with 27 additions and 27 deletions

View File

@@ -19,7 +19,7 @@
#define WDT_MODE_REG 0x18
static volatile void *sunxi_wdt_base;
static volatile char *sunxi_wdt_base;
static int sunxi_wdt_system_reset_check(u32 type, u32 reason)
{
@@ -59,7 +59,7 @@ static int sunxi_wdt_reset_init(void *fdt, int nodeoff,
if (rc < 0 || !reg_addr)
return SBI_ENODEV;
sunxi_wdt_base = (volatile void *)(unsigned long)reg_addr;
sunxi_wdt_base = (volatile char *)(unsigned long)reg_addr;
sbi_system_reset_add_device(&sunxi_wdt_reset);