KVM: x86: Fix typos and whitespace errors

Some typos, comments, whitespace errors corrected in the cpuid code

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Amit Shah 2009-01-14 16:56:00 +00:00 committed by Avi Kivity
parent 9aa4dd5e5f
commit 1935547504
1 changed files with 16 additions and 17 deletions

View File

@ -1067,7 +1067,7 @@ long kvm_arch_dev_ioctl(struct file *filp,
if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid)) if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid))
goto out; goto out;
r = kvm_dev_ioctl_get_supported_cpuid(&cpuid, r = kvm_dev_ioctl_get_supported_cpuid(&cpuid,
cpuid_arg->entries); cpuid_arg->entries);
if (r) if (r)
goto out; goto out;
@ -1165,8 +1165,8 @@ out:
} }
static int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu, static int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
struct kvm_cpuid2 *cpuid, struct kvm_cpuid2 *cpuid,
struct kvm_cpuid_entry2 __user *entries) struct kvm_cpuid_entry2 __user *entries)
{ {
int r; int r;
@ -1185,8 +1185,8 @@ out:
} }
static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu, static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
struct kvm_cpuid2 *cpuid, struct kvm_cpuid2 *cpuid,
struct kvm_cpuid_entry2 __user *entries) struct kvm_cpuid_entry2 __user *entries)
{ {
int r; int r;
@ -1195,7 +1195,7 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
goto out; goto out;
r = -EFAULT; r = -EFAULT;
if (copy_to_user(entries, &vcpu->arch.cpuid_entries, if (copy_to_user(entries, &vcpu->arch.cpuid_entries,
vcpu->arch.cpuid_nent * sizeof(struct kvm_cpuid_entry2))) vcpu->arch.cpuid_nent * sizeof(struct kvm_cpuid_entry2)))
goto out; goto out;
return 0; return 0;
@ -1205,12 +1205,12 @@ out:
} }
static void do_cpuid_1_ent(struct kvm_cpuid_entry2 *entry, u32 function, static void do_cpuid_1_ent(struct kvm_cpuid_entry2 *entry, u32 function,
u32 index) u32 index)
{ {
entry->function = function; entry->function = function;
entry->index = index; entry->index = index;
cpuid_count(entry->function, entry->index, cpuid_count(entry->function, entry->index,
&entry->eax, &entry->ebx, &entry->ecx, &entry->edx); &entry->eax, &entry->ebx, &entry->ecx, &entry->edx);
entry->flags = 0; entry->flags = 0;
} }
@ -1249,7 +1249,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
bit(X86_FEATURE_LAHF_LM) | bit(X86_FEATURE_CMP_LEGACY) | bit(X86_FEATURE_LAHF_LM) | bit(X86_FEATURE_CMP_LEGACY) |
bit(X86_FEATURE_SVM); bit(X86_FEATURE_SVM);
/* all func 2 cpuid_count() should be called on the same cpu */ /* all calls to cpuid_count() should be made on the same cpu */
get_cpu(); get_cpu();
do_cpuid_1_ent(entry, function, index); do_cpuid_1_ent(entry, function, index);
++*nent; ++*nent;
@ -1323,7 +1323,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
} }
static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid, static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid,
struct kvm_cpuid_entry2 __user *entries) struct kvm_cpuid_entry2 __user *entries)
{ {
struct kvm_cpuid_entry2 *cpuid_entries; struct kvm_cpuid_entry2 *cpuid_entries;
int limit, nent = 0, r = -E2BIG; int limit, nent = 0, r = -E2BIG;
@ -1340,7 +1340,7 @@ static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid,
limit = cpuid_entries[0].eax; limit = cpuid_entries[0].eax;
for (func = 1; func <= limit && nent < cpuid->nent; ++func) for (func = 1; func <= limit && nent < cpuid->nent; ++func)
do_cpuid_ent(&cpuid_entries[nent], func, 0, do_cpuid_ent(&cpuid_entries[nent], func, 0,
&nent, cpuid->nent); &nent, cpuid->nent);
r = -E2BIG; r = -E2BIG;
if (nent >= cpuid->nent) if (nent >= cpuid->nent)
goto out_free; goto out_free;
@ -1349,10 +1349,10 @@ static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid,
limit = cpuid_entries[nent - 1].eax; limit = cpuid_entries[nent - 1].eax;
for (func = 0x80000001; func <= limit && nent < cpuid->nent; ++func) for (func = 0x80000001; func <= limit && nent < cpuid->nent; ++func)
do_cpuid_ent(&cpuid_entries[nent], func, 0, do_cpuid_ent(&cpuid_entries[nent], func, 0,
&nent, cpuid->nent); &nent, cpuid->nent);
r = -EFAULT; r = -EFAULT;
if (copy_to_user(entries, cpuid_entries, if (copy_to_user(entries, cpuid_entries,
nent * sizeof(struct kvm_cpuid_entry2))) nent * sizeof(struct kvm_cpuid_entry2)))
goto out_free; goto out_free;
cpuid->nent = nent; cpuid->nent = nent;
r = 0; r = 0;
@ -1496,7 +1496,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid)) if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid))
goto out; goto out;
r = kvm_vcpu_ioctl_set_cpuid2(vcpu, &cpuid, r = kvm_vcpu_ioctl_set_cpuid2(vcpu, &cpuid,
cpuid_arg->entries); cpuid_arg->entries);
if (r) if (r)
goto out; goto out;
break; break;
@ -1509,7 +1509,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid)) if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid))
goto out; goto out;
r = kvm_vcpu_ioctl_get_cpuid2(vcpu, &cpuid, r = kvm_vcpu_ioctl_get_cpuid2(vcpu, &cpuid,
cpuid_arg->entries); cpuid_arg->entries);
if (r) if (r)
goto out; goto out;
r = -EFAULT; r = -EFAULT;
@ -2864,7 +2864,7 @@ static int is_matching_cpuid_entry(struct kvm_cpuid_entry2 *e,
if ((e->flags & KVM_CPUID_FLAG_SIGNIFCANT_INDEX) && e->index != index) if ((e->flags & KVM_CPUID_FLAG_SIGNIFCANT_INDEX) && e->index != index)
return 0; return 0;
if ((e->flags & KVM_CPUID_FLAG_STATEFUL_FUNC) && if ((e->flags & KVM_CPUID_FLAG_STATEFUL_FUNC) &&
!(e->flags & KVM_CPUID_FLAG_STATE_READ_NEXT)) !(e->flags & KVM_CPUID_FLAG_STATE_READ_NEXT))
return 0; return 0;
return 1; return 1;
} }
@ -2892,7 +2892,6 @@ struct kvm_cpuid_entry2 *kvm_find_cpuid_entry(struct kvm_vcpu *vcpu,
if (!best || e->function > best->function) if (!best || e->function > best->function)
best = e; best = e;
} }
return best; return best;
} }