mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00
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
@@ -47,7 +47,7 @@ static u64 mtimer_time_rd32(volatile u64 *addr)
|
||||
static void mtimer_time_wr32(bool timecmp, u64 value, volatile u64 *addr)
|
||||
{
|
||||
writel_relaxed((timecmp) ? -1U : 0U, (void *)(addr));
|
||||
writel_relaxed((u32)(value >> 32), (void *)(addr) + 0x04);
|
||||
writel_relaxed((u32)(value >> 32), (char *)(addr) + 0x04);
|
||||
writel_relaxed((u32)value, (void *)(addr));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user