forked from Mirrors/opensbi
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:

committed by
Anup Patel

parent
fb688d9e9d
commit
5d025eb235
@@ -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)
|
||||
|
Reference in New Issue
Block a user