x86/vrtc: Use a real type for rtc_ioport_write()
PATCH 1/1 x86/vrtc: Use a real type for rtc_ioport_write()
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Teddy Astie <[email protected]>
--- xen/arch/x86/hvm/rtc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
xen/arch/x86/hvm/rtc.c +1 -2
@@ -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
Signature · 1 line
2.39.5
Quoted 1 line · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>
xen/arch/x86/hvm/rtc.c static void cf_check rtc_alarm_cb(void *opaque) · line 475
Quoted 12 lines
xen/arch/x86/hvm/rtc.c +1
-2@@ -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
Quoted 3 lines · Jan Beulich
Quoted 1 line · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>Reviewed-by Jan Beulich <[email protected]>
Thanks.
Quoted 7 lines
Quoted 7 lines
xen/arch/x86/hvm/rtc.c +0
-0@@ -469,9 +469,8 @@ static void cf_check rtc_alarm_cb(void *opaque)spin_unlock (&s->lock); }
Quoted 8 lines
xen/arch/x86/hvm/rtc.c static void cf_check rtc_alarm_cb(void *opaque) · line 475
Quoted 6 lines
xen/arch/x86/hvm/rtc.c +1
-2-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