summaryrefslogtreecommitdiff
path: root/virt
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2023-02-08 15:01:04 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2023-03-16 10:18:07 -0400
commitf15ba52bfabc3bc130053bd73d414d859162de91 (patch)
tree23813da81f8f634e84ceb5100f926b1b791788c9 /virt
parent2def950c63e3f976af87a2606dabe0c9e21c605b (diff)
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>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index d255964ec331..f40b72eb0e7b 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -4467,7 +4467,7 @@ static int kvm_ioctl_create_device(struct kvm *kvm,
return 0;
}
-static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
+static int kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
{
switch (arg) {
case KVM_CAP_USER_MEMORY:
@@ -5045,7 +5045,7 @@ put_fd:
static long kvm_dev_ioctl(struct file *filp,
unsigned int ioctl, unsigned long arg)
{
- long r = -EINVAL;
+ int r = -EINVAL;
switch (ioctl) {
case KVM_GET_API_VERSION: