diff options
author | Jan Beulich <jbeulich@suse.com> | 2012-09-28 10:59:41 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2012-09-28 10:59:41 +0200 |
commit | c7970c8c39736732bc964b62e17a4f1e386af7bb (patch) | |
tree | 3614ee7a8a6fe06fb1df60da33e16b08af323d37 /xen/arch/x86/traps.c | |
parent | 1443c44067837f77cbd89fcac64cdde3fd337ef4 (diff) | |
download | xen-c7970c8c39736732bc964b62e17a4f1e386af7bb.tar.gz xen-c7970c8c39736732bc964b62e17a4f1e386af7bb.tar.bz2 xen-c7970c8c39736732bc964b62e17a4f1e386af7bb.zip |
x86: replace literal numbers
In various cases, 256 was being used instead of NR_VECTORS or a derived
ARRAY_SIZE() expression. In one case (guest_has_trap_callback()), a
wrong (unrelated) constant was used instead of NR_VECTORS.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/traps.c')
-rw-r--r-- | xen/arch/x86/traps.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 58cf0de6c0..2ff88ade8e 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -3506,7 +3506,7 @@ int guest_has_trap_callback(struct domain *d, uint16_t vcpuid, unsigned int trap BUG_ON(vcpuid >= d->max_vcpus); /* Sanity check - XXX should be more fine grained. */ - BUG_ON(trap_nr > TRAP_syscall); + BUG_ON(trap_nr >= NR_VECTORS); v = d->vcpu[vcpuid]; t = &v->arch.pv_vcpu.trap_ctxt[trap_nr]; @@ -3574,7 +3574,7 @@ long do_set_trap_table(XEN_GUEST_HANDLE(const_trap_info_t) traps) /* If no table is presented then clear the entire virtual IDT. */ if ( guest_handle_is_null(traps) ) { - memset(dst, 0, 256 * sizeof(*dst)); + memset(dst, 0, NR_VECTORS * sizeof(*dst)); init_int80_direct_trap(curr); return 0; } |