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/i2c | |
| 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/i2c')
| -rw-r--r-- | lib/utils/i2c/fdt_i2c_sifive.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/utils/i2c/fdt_i2c_sifive.c b/lib/utils/i2c/fdt_i2c_sifive.c index 871241af..195541cf 100644 --- a/lib/utils/i2c/fdt_i2c_sifive.c +++ b/lib/utils/i2c/fdt_i2c_sifive.c @@ -56,13 +56,13 @@ extern struct fdt_i2c_adapter fdt_i2c_adapter_sifive; static inline void sifive_i2c_setreg(struct sifive_i2c_adapter *adap, uint8_t reg, uint8_t value) { - writel(value, (volatile void *)adap->addr + reg); + writel(value, (volatile char *)adap->addr + reg); } static inline uint8_t sifive_i2c_getreg(struct sifive_i2c_adapter *adap, uint8_t reg) { - return readl((volatile void *)adap->addr + reg); + return readl((volatile char *)adap->addr + reg); } static int sifive_i2c_adapter_rxack(struct sifive_i2c_adapter *adap) |
