[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v5 11/13] x86/callback.c: slightly change {un, }register_guest_nmi_callback
Make register_guest_nmi_callback return int and make unregister_guest_nmi_callback void. Adjust the callers where necessary. Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- Can be squashed into previous patch. --- xen/arch/x86/pv/callback.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/pv/callback.c b/xen/arch/x86/pv/callback.c index 739ccb4d06..5957cb5085 100644 --- a/xen/arch/x86/pv/callback.c +++ b/xen/arch/x86/pv/callback.c @@ -31,7 +31,7 @@ #include <public/callback.h> -static long register_guest_nmi_callback(unsigned long address) +static int register_guest_nmi_callback(unsigned long address) { struct vcpu *curr = current; struct domain *d = curr->domain; @@ -57,14 +57,12 @@ static long register_guest_nmi_callback(unsigned long address) return 0; } -static long unregister_guest_nmi_callback(void) +static void unregister_guest_nmi_callback(void) { struct vcpu *curr = current; struct trap_info *t = &curr->arch.pv_vcpu.trap_ctxt[TRAP_nmi]; memset(t, 0, sizeof(*t)); - - return 0; } static long register_guest_callback(struct callback_register *reg) @@ -140,7 +138,8 @@ static long unregister_guest_callback(struct callback_unregister *unreg) break; case CALLBACKTYPE_nmi: - ret = unregister_guest_nmi_callback(); + unregister_guest_nmi_callback(); + ret = 0; break; default: @@ -279,7 +278,8 @@ static long compat_unregister_guest_callback( break; case CALLBACKTYPE_nmi: - ret = unregister_guest_nmi_callback(); + unregister_guest_nmi_callback(); + ret = 0; break; default: @@ -463,7 +463,8 @@ long do_nmi_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) rc = register_guest_nmi_callback(cb.handler_address); break; case XENNMI_unregister_callback: - rc = unregister_guest_nmi_callback(); + unregister_guest_nmi_callback(); + rc = 0; break; default: rc = -ENOSYS; @@ -487,7 +488,8 @@ int compat_nmi_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) rc = register_guest_nmi_callback(cb.handler_address); break; case XENNMI_unregister_callback: - rc = unregister_guest_nmi_callback(); + unregister_guest_nmi_callback(); + rc = 0; break; default: rc = -ENOSYS; -- 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |