mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
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>
This commit is contained in:
committed by
Paolo Bonzini
parent
2def950c63
commit
f15ba52bfa
@@ -4467,7 +4467,7 @@ static int kvm_ioctl_create_device(struct kvm *kvm,
|
|||||||
return 0;
|
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) {
|
switch (arg) {
|
||||||
case KVM_CAP_USER_MEMORY:
|
case KVM_CAP_USER_MEMORY:
|
||||||
@@ -5045,7 +5045,7 @@ put_fd:
|
|||||||
static long kvm_dev_ioctl(struct file *filp,
|
static long kvm_dev_ioctl(struct file *filp,
|
||||||
unsigned int ioctl, unsigned long arg)
|
unsigned int ioctl, unsigned long arg)
|
||||||
{
|
{
|
||||||
long r = -EINVAL;
|
int r = -EINVAL;
|
||||||
|
|
||||||
switch (ioctl) {
|
switch (ioctl) {
|
||||||
case KVM_GET_API_VERSION:
|
case KVM_GET_API_VERSION:
|
||||||
|
Reference in New Issue
Block a user