[PATCH 7/9] hw/intc/riscv_aclint: riscv_aclint_mtimer_get_ticks: get rid of void* argument

Luc Michel posted 9 patches 1 week ago
Maintainers: Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
[PATCH 7/9] hw/intc/riscv_aclint: riscv_aclint_mtimer_get_ticks: get rid of void* argument
Posted by Luc Michel 1 week ago
Now that the riscv_aclint_mtimer_get_ticks is only used internally,
replace its void* argument with the proper RISCVAclintMTimerState type.

Signed-off-by: Luc Michel <luc.michel@amd.com>
---
 hw/intc/riscv_aclint.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/intc/riscv_aclint.c b/hw/intc/riscv_aclint.c
index 8d001a5eb20..014b733d72f 100644
--- a/hw/intc/riscv_aclint.c
+++ b/hw/intc/riscv_aclint.c
@@ -44,13 +44,12 @@ static uint64_t riscv_aclint_mtimer_get_ticks_raw(uint32_t timebase_freq)
 {
     return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL),
         timebase_freq, NANOSECONDS_PER_SECOND);
 }
 
-static uint64_t riscv_aclint_mtimer_get_ticks(void *opaque)
+static uint64_t riscv_aclint_mtimer_get_ticks(RISCVAclintMTimerState *mtimer)
 {
-    RISCVAclintMTimerState *mtimer = opaque;
     return riscv_aclint_mtimer_get_ticks_raw(mtimer->timebase_freq) +
            mtimer->time_delta;
 }
 
 /*
-- 
2.51.0
Re: [PATCH 7/9] hw/intc/riscv_aclint: riscv_aclint_mtimer_get_ticks: get rid of void* argument
Posted by Philippe Mathieu-Daudé 5 days, 1 hour ago
On 7/11/25 11:23, Luc Michel wrote:
> Now that the riscv_aclint_mtimer_get_ticks is only used internally,
> replace its void* argument with the proper RISCVAclintMTimerState type.
> 
> Signed-off-by: Luc Michel <luc.michel@amd.com>
> ---
>   hw/intc/riscv_aclint.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>