Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Roger Pau Monné <roger@xenproject.org>
CC: Teddy Astie <teddy.astie@vates.tech>
---
xen/arch/x86/hvm/rtc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index 65b3b79f1edb..9895dd570c65 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -469,9 +469,8 @@ static void cf_check rtc_alarm_cb(void *opaque)
spin_unlock(&s->lock);
}
-static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
+static int rtc_ioport_write(RTCState *s, uint32_t addr, uint32_t data)
{
- RTCState *s = opaque;
struct domain *d = vrtc_domain(s);
uint32_t orig;
base-commit: 75f920bd47a4f59eaaa4596aa3f4e12a447d26d2
--
2.39.5
On 28.07.2026 14:31, Andrew Cooper wrote:
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
> --- a/xen/arch/x86/hvm/rtc.c
> +++ b/xen/arch/x86/hvm/rtc.c
> @@ -469,9 +469,8 @@ static void cf_check rtc_alarm_cb(void *opaque)
> spin_unlock(&s->lock);
> }
>
> -static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
> +static int rtc_ioport_write(RTCState *s, uint32_t addr, uint32_t data)
> {
> - RTCState *s = opaque;
> struct domain *d = vrtc_domain(s);
> uint32_t orig;
It's entirely unclear why it was ever done like this. Even in 3.2 it could
already have been done the type-correct way.
Jan
On 28/07/2026 1:36 pm, Jan Beulich wrote:
> On 28.07.2026 14:31, Andrew Cooper wrote:
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
Thanks.
>
>> --- a/xen/arch/x86/hvm/rtc.c
>> +++ b/xen/arch/x86/hvm/rtc.c
>> @@ -469,9 +469,8 @@ static void cf_check rtc_alarm_cb(void *opaque)
>> spin_unlock(&s->lock);
>> }
>>
>> -static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
>> +static int rtc_ioport_write(RTCState *s, uint32_t addr, uint32_t data)
>> {
>> - RTCState *s = opaque;
>> struct domain *d = vrtc_domain(s);
>> uint32_t orig;
> It's entirely unclear why it was ever done like this. Even in 3.2 it could
> already have been done the type-correct way.
There are a whole bunch of callbacks which use this pattern. They must
continue to use void * for the function types to work.
I wonder if at any point in the past rtc_ioport_write() was used
directly as a pointee, but I haven't gone looking.
~Andrew
© 2016 - 2026 Red Hat, Inc.