All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] xics_kvm: drop extra checking of kernel_xics_fd
@ 2016-07-21  7:15 Greg Kurz
  2016-07-21 12:59 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Greg Kurz @ 2016-07-21  7:15 UTC (permalink / raw)
  To: David Gibson; +Cc: qemu-ppc, qemu-devel

We abort a few lines above if kernel_xics_fd == -1.

This is only code cleanup.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/intc/xics_kvm.c |   20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
index edbd62fd1bae..c9caefcf2b0b 100644
--- a/hw/intc/xics_kvm.c
+++ b/hw/intc/xics_kvm.c
@@ -329,6 +329,7 @@ static void xics_kvm_cpu_setup(XICSState *xics, PowerPCCPU *cpu)
     CPUState *cs;
     ICPState *ss;
     KVMXICSState *xicskvm = XICS_SPAPR_KVM(xics);
+    int ret;
 
     cs = CPU(cpu);
     ss = &xics->ss[cs->cpu_index];
@@ -347,19 +348,14 @@ static void xics_kvm_cpu_setup(XICSState *xics, PowerPCCPU *cpu)
         return;
     }
 
-    if (xicskvm->kernel_xics_fd != -1) {
-        int ret;
-
-        ret = kvm_vcpu_enable_cap(cs, KVM_CAP_IRQ_XICS, 0,
-                                  xicskvm->kernel_xics_fd,
-                                  kvm_arch_vcpu_id(cs));
-        if (ret < 0) {
-            error_report("Unable to connect CPU%ld to kernel XICS: %s",
-                    kvm_arch_vcpu_id(cs), strerror(errno));
-            exit(1);
-        }
-        ss->cap_irq_xics_enabled = true;
+    ret = kvm_vcpu_enable_cap(cs, KVM_CAP_IRQ_XICS, 0, xicskvm->kernel_xics_fd,
+                              kvm_arch_vcpu_id(cs));
+    if (ret < 0) {
+        error_report("Unable to connect CPU%ld to kernel XICS: %s",
+                     kvm_arch_vcpu_id(cs), strerror(errno));
+        exit(1);
     }
+    ss->cap_irq_xics_enabled = true;
 }
 
 static void xics_kvm_set_nr_irqs(XICSState *xics, uint32_t nr_irqs,

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] xics_kvm: drop extra checking of kernel_xics_fd
  2016-07-21  7:15 [Qemu-devel] [PATCH] xics_kvm: drop extra checking of kernel_xics_fd Greg Kurz
@ 2016-07-21 12:59 ` David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2016-07-21 12:59 UTC (permalink / raw)
  To: Greg Kurz; +Cc: qemu-ppc, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2073 bytes --]

On Thu, Jul 21, 2016 at 09:15:50AM +0200, Greg Kurz wrote:
> We abort a few lines above if kernel_xics_fd == -1.
> 
> This is only code cleanup.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>

Applied to ppc-for-2.8 (newly created).

> ---
>  hw/intc/xics_kvm.c |   20 ++++++++------------
>  1 file changed, 8 insertions(+), 12 deletions(-)
> 
> diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
> index edbd62fd1bae..c9caefcf2b0b 100644
> --- a/hw/intc/xics_kvm.c
> +++ b/hw/intc/xics_kvm.c
> @@ -329,6 +329,7 @@ static void xics_kvm_cpu_setup(XICSState *xics, PowerPCCPU *cpu)
>      CPUState *cs;
>      ICPState *ss;
>      KVMXICSState *xicskvm = XICS_SPAPR_KVM(xics);
> +    int ret;
>  
>      cs = CPU(cpu);
>      ss = &xics->ss[cs->cpu_index];
> @@ -347,19 +348,14 @@ static void xics_kvm_cpu_setup(XICSState *xics, PowerPCCPU *cpu)
>          return;
>      }
>  
> -    if (xicskvm->kernel_xics_fd != -1) {
> -        int ret;
> -
> -        ret = kvm_vcpu_enable_cap(cs, KVM_CAP_IRQ_XICS, 0,
> -                                  xicskvm->kernel_xics_fd,
> -                                  kvm_arch_vcpu_id(cs));
> -        if (ret < 0) {
> -            error_report("Unable to connect CPU%ld to kernel XICS: %s",
> -                    kvm_arch_vcpu_id(cs), strerror(errno));
> -            exit(1);
> -        }
> -        ss->cap_irq_xics_enabled = true;
> +    ret = kvm_vcpu_enable_cap(cs, KVM_CAP_IRQ_XICS, 0, xicskvm->kernel_xics_fd,
> +                              kvm_arch_vcpu_id(cs));
> +    if (ret < 0) {
> +        error_report("Unable to connect CPU%ld to kernel XICS: %s",
> +                     kvm_arch_vcpu_id(cs), strerror(errno));
> +        exit(1);
>      }
> +    ss->cap_irq_xics_enabled = true;
>  }
>  
>  static void xics_kvm_set_nr_irqs(XICSState *xics, uint32_t nr_irqs,
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-21 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-21  7:15 [Qemu-devel] [PATCH] xics_kvm: drop extra checking of kernel_xics_fd Greg Kurz
2016-07-21 12:59 ` David Gibson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.