Re: [PATCH] x86/vrtc: Use a real type for rtc_ioport_write()

Andrew Cooper <[email protected]>
Newsgroups org.xenproject.lists.xen-devel
Message-ID <[email protected]>
On 28/07/2026 1:36 pm, Jan Beulich wrote:
> On 28.07.2026 14:31, Andrew Cooper wrote:
>> Signed-off-by: Andrew Cooper <[email protected]>
> Reviewed-by: Jan Beulich <[email protected]>

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.