Skip to content

Commit d8708b8

Browse files
huthbonzini
authored andcommitted
KVM: Change return type of kvm_arch_vm_ioctl() to "int"
All kvm_arch_vm_ioctl() implementations now only deal with "int" types as return values, so we can change the return type of these functions to use "int" instead of "long". Signed-off-by: Thomas Huth <thuth@redhat.com> Acked-by: Anup Patel <anup@brainfault.org> Message-Id: <20230208140105.655814-7-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent f15ba52 commit d8708b8

7 files changed

Lines changed: 9 additions & 15 deletions

File tree

arch/arm64/kvm/arm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,8 +1439,7 @@ static int kvm_vm_ioctl_set_device_addr(struct kvm *kvm,
14391439
}
14401440
}
14411441

1442-
long kvm_arch_vm_ioctl(struct file *filp,
1443-
unsigned int ioctl, unsigned long arg)
1442+
int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
14441443
{
14451444
struct kvm *kvm = filp->private_data;
14461445
void __user *argp = (void __user *)arg;

arch/mips/kvm/mips.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -993,9 +993,9 @@ void kvm_arch_flush_remote_tlbs_memslot(struct kvm *kvm,
993993
kvm_flush_remote_tlbs(kvm);
994994
}
995995

996-
long kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
996+
int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
997997
{
998-
long r;
998+
int r;
999999

10001000
switch (ioctl) {
10011001
default:

arch/powerpc/kvm/powerpc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,12 +2371,11 @@ static int kvmppc_get_cpu_char(struct kvm_ppc_cpu_char *cp)
23712371
}
23722372
#endif
23732373

2374-
long kvm_arch_vm_ioctl(struct file *filp,
2375-
unsigned int ioctl, unsigned long arg)
2374+
int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
23762375
{
23772376
struct kvm *kvm __maybe_unused = filp->private_data;
23782377
void __user *argp = (void __user *)arg;
2379-
long r;
2378+
int r;
23802379

23812380
switch (ioctl) {
23822381
case KVM_PPC_GET_PVINFO: {

arch/riscv/kvm/vm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
8787
return r;
8888
}
8989

90-
long kvm_arch_vm_ioctl(struct file *filp,
91-
unsigned int ioctl, unsigned long arg)
90+
int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
9291
{
9392
return -EINVAL;
9493
}

arch/s390/kvm/kvm-s390.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2898,8 +2898,7 @@ static int kvm_s390_vm_mem_op(struct kvm *kvm, struct kvm_s390_mem_op *mop)
28982898
}
28992899
}
29002900

2901-
long kvm_arch_vm_ioctl(struct file *filp,
2902-
unsigned int ioctl, unsigned long arg)
2901+
int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
29032902
{
29042903
struct kvm *kvm = filp->private_data;
29052904
void __user *argp = (void __user *)arg;

arch/x86/kvm/x86.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6667,8 +6667,7 @@ static int kvm_vm_ioctl_set_clock(struct kvm *kvm, void __user *argp)
66676667
return 0;
66686668
}
66696669

6670-
long kvm_arch_vm_ioctl(struct file *filp,
6671-
unsigned int ioctl, unsigned long arg)
6670+
int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
66726671
{
66736672
struct kvm *kvm = filp->private_data;
66746673
void __user *argp = (void __user *)arg;

include/linux/kvm_host.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,8 +1397,7 @@ int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level,
13971397
bool line_status);
13981398
int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
13991399
struct kvm_enable_cap *cap);
1400-
long kvm_arch_vm_ioctl(struct file *filp,
1401-
unsigned int ioctl, unsigned long arg);
1400+
int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg);
14021401
long kvm_arch_vm_compat_ioctl(struct file *filp, unsigned int ioctl,
14031402
unsigned long arg);
14041403

0 commit comments

Comments
 (0)