[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] x86/vmx: fix compilation after 997382



997382 introduced the following errors:

intr.c:342:46: error: address of array 'vlapic->regs->data' will always 
evaluate to 'true'
      [-Werror,-Wpointer-bool-conversion]
                if ( vlapic && vlapic->regs->data )
                            ~~ ~~~~~~~~~~~~~~^~~~
intr.c:352:42: error: address of array 'pi_desc->pir' will always evaluate to 
'true'
      [-Werror,-Wpointer-bool-conversion]
                if ( pi_desc && pi_desc->pir )
                             ~~ ~~~~~~~~~^~~
Both of those checks are done against static arrays, which doesn't seem to make
much sense, so just remove them.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
NB: maybe the first check should be against vlapic->regs?
---
Cc: Jun Nakajima <jun.nakajima@xxxxxxxxx>
Cc: Kevin Tian <kevin.tian@xxxxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: Chao Gao <chao.gao@xxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/intr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c
index 1e17c4e..b9a02d1 100644
--- a/xen/arch/x86/hvm/vmx/intr.c
+++ b/xen/arch/x86/hvm/vmx/intr.c
@@ -339,7 +339,7 @@ void vmx_intr_assist(void)
                        current, intack.source, intack.vector, pt_vector);
 
                 vlapic = vcpu_vlapic(v);
-                if ( vlapic && vlapic->regs->data )
+                if ( vlapic )
                 {
                     word = (const void *)&vlapic->regs->data[APIC_IRR];
                     printk(XENLOG_ERR "vIRR:");
@@ -349,7 +349,7 @@ void vmx_intr_assist(void)
                 }
 
                 pi_desc = &v->arch.hvm_vmx.pi_desc;
-                if ( pi_desc && pi_desc->pir )
+                if ( pi_desc )
                 {
                     word = (const void *)&pi_desc->pir;
                     printk(XENLOG_ERR " PIR:");
-- 
2.10.1 (Apple Git-78)


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.