aboutsummaryrefslogtreecommitdiff
path: root/lib/utils/timer
diff options
context:
space:
mode:
authorJukka Laitinen <jukka.laitinen@iki.fi>2022-01-19 11:20:17 +0200
committerAnup Patel <anup@brainfault.org>2022-01-21 21:58:12 +0530
commit5d025eb2353550eadbd2fa9b8083a92fe9b07bd9 (patch)
treed894553a47e62e5224780e2836a4648bc778c9e8 /lib/utils/timer
parentfb688d9e9d4099d6945c9e460b9cd2c8c4d8a29b (diff)
downloadopensbi-5d025eb2353550eadbd2fa9b8083a92fe9b07bd9.zip
opensbi-5d025eb2353550eadbd2fa9b8083a92fe9b07bd9.tar.gz
opensbi-5d025eb2353550eadbd2fa9b8083a92fe9b07bd9.tar.bz2
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>
Diffstat (limited to 'lib/utils/timer')
-rw-r--r--lib/utils/timer/aclint_mtimer.c2
1 files changed, 1 insertions, 1 deletions
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));
}