From 5d025eb2353550eadbd2fa9b8083a92fe9b07bd9 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Wed, 19 Jan 2022 11:20:17 +0200 Subject: 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 Reviewed-by: Dong Du Reviewed-by: Xiang W Reviewed-by: Anup Patel --- lib/utils/timer/aclint_mtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/utils/timer') diff --git a/lib/utils/timer/aclint_mtimer.c b/lib/utils/timer/aclint_mtimer.c index 62e87f7..2532b63 100644 --- a/lib/utils/timer/aclint_mtimer.c +++ b/lib/utils/timer/aclint_mtimer.c @@ -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)); } -- cgit v1.1