diff options
| author | Jukka Laitinen <[email protected]> | 2022-01-19 11:20:17 +0200 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2022-01-21 21:58:12 +0530 |
| commit | 5d025eb2353550eadbd2fa9b8083a92fe9b07bd9 (patch) | |
| tree | d894553a47e62e5224780e2836a4648bc778c9e8 /lib/utils/reset | |
| parent | fb688d9e9d4099d6945c9e460b9cd2c8c4d8a29b (diff) | |
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 <[email protected]>
Reviewed-by: Dong Du <[email protected]>
Reviewed-by: Xiang W <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib/utils/reset')
| -rw-r--r-- | lib/utils/reset/fdt_reset_sunxi_wdt.c | 4 | ||||
| -rw-r--r-- | lib/utils/reset/fdt_reset_thead.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/utils/reset/fdt_reset_sunxi_wdt.c b/lib/utils/reset/fdt_reset_sunxi_wdt.c index 6d1b5b7d..446d32b4 100644 --- a/lib/utils/reset/fdt_reset_sunxi_wdt.c +++ b/lib/utils/reset/fdt_reset_sunxi_wdt.c @@ -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); diff --git a/lib/utils/reset/fdt_reset_thead.c b/lib/utils/reset/fdt_reset_thead.c index d4916872..e1d6885d 100644 --- a/lib/utils/reset/fdt_reset_thead.c +++ b/lib/utils/reset/fdt_reset_thead.c @@ -59,7 +59,7 @@ extern void __thead_pre_start_warm(void); static int thead_reset_init(void *fdt, int nodeoff, const struct fdt_match *match) { - void *p; + char *p; const fdt64_t *val; const fdt32_t *val_w; int len, i; @@ -91,7 +91,7 @@ static int thead_reset_init(void *fdt, int nodeoff, /* Custom reset method for secondary harts */ val = fdt_getprop(fdt, nodeoff, "entry-reg", &len); if (len > 0 && val) { - p = (void *)(ulong)fdt64_to_cpu(*val); + p = (char *)(ulong)fdt64_to_cpu(*val); val_w = fdt_getprop(fdt, nodeoff, "entry-cnt", &len); if (len > 0 && val_w) { |
