mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 05:02:12 +00:00
KVM: Remove three magic numbers
There are several places where hardcoded numbers are used in place of the easily-available constant, which is poor form. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:
parent
8b9cf98cc7
commit
3077c4513c
@ -413,7 +413,7 @@ static void free_pio_guest_pages(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 2; ++i)
|
||||
for (i = 0; i < ARRAY_SIZE(vcpu->pio.guest_pages); ++i)
|
||||
if (vcpu->pio.guest_pages[i]) {
|
||||
__free_page(vcpu->pio.guest_pages[i]);
|
||||
vcpu->pio.guest_pages[i] = NULL;
|
||||
|
@ -241,7 +241,7 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
|
||||
printk(KERN_DEBUG "%s: NOP\n", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
if (svm->next_rip - svm->vmcb->save.rip > 15) {
|
||||
if (svm->next_rip - svm->vmcb->save.rip > MAX_INST_SIZE) {
|
||||
printk(KERN_ERR "%s: ip 0x%llx next 0x%llx\n",
|
||||
__FUNCTION__,
|
||||
svm->vmcb->save.rip,
|
||||
|
Loading…
Reference in New Issue
Block a user