aboutsummaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorGuo Chao <yan@linux.vnet.ibm.com>2012-11-02 06:33:23 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2012-11-13 19:14:29 -0500
commit807f12e57c9783458b8c07f63eff3c3e1df8ab5d (patch)
tree7560f5d4fb19bf4637b59f926eda4512232a921e /virt
parent951179ce86f5599e2dfb9de254056e91bd865f15 (diff)
KVM: remove unnecessary return value check
No need to check return value before breaking switch. Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 316d76aa030d..e3f5b143158e 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1929,10 +1929,6 @@ out_free1:
1929 goto out; 1929 goto out;
1930 } 1930 }
1931 r = kvm_arch_vcpu_ioctl_set_regs(vcpu, kvm_regs); 1931 r = kvm_arch_vcpu_ioctl_set_regs(vcpu, kvm_regs);
1932 if (r)
1933 goto out_free2;
1934 r = 0;
1935out_free2:
1936 kfree(kvm_regs); 1932 kfree(kvm_regs);
1937 break; 1933 break;
1938 } 1934 }
@@ -1958,9 +1954,6 @@ out_free2:
1958 goto out; 1954 goto out;
1959 } 1955 }
1960 r = kvm_arch_vcpu_ioctl_set_sregs(vcpu, kvm_sregs); 1956 r = kvm_arch_vcpu_ioctl_set_sregs(vcpu, kvm_sregs);
1961 if (r)
1962 goto out;
1963 r = 0;
1964 break; 1957 break;
1965 } 1958 }
1966 case KVM_GET_MP_STATE: { 1959 case KVM_GET_MP_STATE: {
@@ -1982,9 +1975,6 @@ out_free2:
1982 if (copy_from_user(&mp_state, argp, sizeof mp_state)) 1975 if (copy_from_user(&mp_state, argp, sizeof mp_state))
1983 goto out; 1976 goto out;
1984 r = kvm_arch_vcpu_ioctl_set_mpstate(vcpu, &mp_state); 1977 r = kvm_arch_vcpu_ioctl_set_mpstate(vcpu, &mp_state);
1985 if (r)
1986 goto out;
1987 r = 0;
1988 break; 1978 break;
1989 } 1979 }
1990 case KVM_TRANSLATE: { 1980 case KVM_TRANSLATE: {
@@ -2009,9 +1999,6 @@ out_free2:
2009 if (copy_from_user(&dbg, argp, sizeof dbg)) 1999 if (copy_from_user(&dbg, argp, sizeof dbg))
2010 goto out; 2000 goto out;
2011 r = kvm_arch_vcpu_ioctl_set_guest_debug(vcpu, &dbg); 2001 r = kvm_arch_vcpu_ioctl_set_guest_debug(vcpu, &dbg);
2012 if (r)
2013 goto out;
2014 r = 0;
2015 break; 2002 break;
2016 } 2003 }
2017 case KVM_SET_SIGNAL_MASK: { 2004 case KVM_SET_SIGNAL_MASK: {
@@ -2059,9 +2046,6 @@ out_free2:
2059 goto out; 2046 goto out;
2060 } 2047 }
2061 r = kvm_arch_vcpu_ioctl_set_fpu(vcpu, fpu); 2048 r = kvm_arch_vcpu_ioctl_set_fpu(vcpu, fpu);
2062 if (r)
2063 goto out;
2064 r = 0;
2065 break; 2049 break;
2066 } 2050 }
2067 default: 2051 default:
@@ -2131,8 +2115,6 @@ static long kvm_vm_ioctl(struct file *filp,
2131 switch (ioctl) { 2115 switch (ioctl) {
2132 case KVM_CREATE_VCPU: 2116 case KVM_CREATE_VCPU:
2133 r = kvm_vm_ioctl_create_vcpu(kvm, arg); 2117 r = kvm_vm_ioctl_create_vcpu(kvm, arg);
2134 if (r < 0)
2135 goto out;
2136 break; 2118 break;
2137 case KVM_SET_USER_MEMORY_REGION: { 2119 case KVM_SET_USER_MEMORY_REGION: {
2138 struct kvm_userspace_memory_region kvm_userspace_mem; 2120 struct kvm_userspace_memory_region kvm_userspace_mem;
@@ -2143,8 +2125,6 @@ static long kvm_vm_ioctl(struct file *filp,
2143 goto out; 2125 goto out;
2144 2126
2145 r = kvm_vm_ioctl_set_memory_region(kvm, &kvm_userspace_mem, 1); 2127 r = kvm_vm_ioctl_set_memory_region(kvm, &kvm_userspace_mem, 1);
2146 if (r)
2147 goto out;
2148 break; 2128 break;
2149 } 2129 }
2150 case KVM_GET_DIRTY_LOG: { 2130 case KVM_GET_DIRTY_LOG: {
@@ -2154,8 +2134,6 @@ static long kvm_vm_ioctl(struct file *filp,
2154 if (copy_from_user(&log, argp, sizeof log)) 2134 if (copy_from_user(&log, argp, sizeof log))
2155 goto out; 2135 goto out;
2156 r = kvm_vm_ioctl_get_dirty_log(kvm, &log); 2136 r = kvm_vm_ioctl_get_dirty_log(kvm, &log);
2157 if (r)
2158 goto out;
2159 break; 2137 break;
2160 } 2138 }
2161#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET 2139#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET
@@ -2165,9 +2143,6 @@ static long kvm_vm_ioctl(struct file *filp,
2165 if (copy_from_user(&zone, argp, sizeof zone)) 2143 if (copy_from_user(&zone, argp, sizeof zone))
2166 goto out; 2144 goto out;
2167 r = kvm_vm_ioctl_register_coalesced_mmio(kvm, &zone); 2145 r = kvm_vm_ioctl_register_coalesced_mmio(kvm, &zone);
2168 if (r)
2169 goto out;
2170 r = 0;
2171 break; 2146 break;
2172 } 2147 }
2173 case KVM_UNREGISTER_COALESCED_MMIO: { 2148 case KVM_UNREGISTER_COALESCED_MMIO: {
@@ -2176,9 +2151,6 @@ static long kvm_vm_ioctl(struct file *filp,
2176 if (copy_from_user(&zone, argp, sizeof zone)) 2151 if (copy_from_user(&zone, argp, sizeof zone))
2177 goto out; 2152 goto out;
2178 r = kvm_vm_ioctl_unregister_coalesced_mmio(kvm, &zone); 2153 r = kvm_vm_ioctl_unregister_coalesced_mmio(kvm, &zone);
2179 if (r)
2180 goto out;
2181 r = 0;
2182 break; 2154 break;
2183 } 2155 }
2184#endif 2156#endif
@@ -2287,8 +2259,6 @@ static long kvm_vm_compat_ioctl(struct file *filp,
2287 log.dirty_bitmap = compat_ptr(compat_log.dirty_bitmap); 2259 log.dirty_bitmap = compat_ptr(compat_log.dirty_bitmap);
2288 2260
2289 r = kvm_vm_ioctl_get_dirty_log(kvm, &log); 2261 r = kvm_vm_ioctl_get_dirty_log(kvm, &log);
2290 if (r)
2291 goto out;
2292 break; 2262 break;
2293 } 2263 }
2294 default: 2264 default: