arm64: KVM: Clean up a condition
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 14 Jul 2016 10:19:34 +0000 (13:19 +0300)
committerMarc Zyngier <marc.zyngier@arm.com>
Thu, 14 Jul 2016 13:35:50 +0000 (14:35 +0100)
My static checker complains that this condition looks like it should be
== instead of =.  This isn't a fast path, so we don't need to be fancy.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/kvm/sys_regs.c

index a57d650f552cd67ed15964b645001791bf05ae6c..b0b225ceca18f956a805c2862f299d0ee9575749 100644 (file)
@@ -1546,7 +1546,7 @@ static void unhandled_cp_access(struct kvm_vcpu *vcpu,
                                struct sys_reg_params *params)
 {
        u8 hsr_ec = kvm_vcpu_trap_get_class(vcpu);
-       int cp;
+       int cp = -1;
 
        switch(hsr_ec) {
        case ESR_ELx_EC_CP15_32:
@@ -1558,7 +1558,7 @@ static void unhandled_cp_access(struct kvm_vcpu *vcpu,
                cp = 14;
                break;
        default:
-               WARN_ON((cp = -1));
+               WARN_ON(1);
        }
 
        kvm_err("Unsupported guest CP%d access at: %08lx\n",