Skip to content

Commit f15ba52

Browse files
huthbonzini
authored andcommitted
KVM: Standardize on "int" return types instead of "long" in kvm_main.c
KVM functions use "long" return values for functions that are wired up to "struct file_operations", but otherwise use "int" return values for functions that can return 0/-errno in order to avoid unintentional divergences between 32-bit and 64-bit kernels. Some code still uses "long" in unnecessary spots, though, which can cause a little bit of confusion and unnecessary size casts. Let's change these spots to use "int" types, too. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230208140105.655814-6-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 2def950 commit f15ba52

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

virt/kvm/kvm_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4467,7 +4467,7 @@ static int kvm_ioctl_create_device(struct kvm *kvm,
44674467
return 0;
44684468
}
44694469

4470-
static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
4470+
static int kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
44714471
{
44724472
switch (arg) {
44734473
case KVM_CAP_USER_MEMORY:
@@ -5045,7 +5045,7 @@ static int kvm_dev_ioctl_create_vm(unsigned long type)
50455045
static long kvm_dev_ioctl(struct file *filp,
50465046
unsigned int ioctl, unsigned long arg)
50475047
{
5048-
long r = -EINVAL;
5048+
int r = -EINVAL;
50495049

50505050
switch (ioctl) {
50515051
case KVM_GET_API_VERSION:

0 commit comments

Comments
 (0)