From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch] arm64: KVM: clean up a condition
Date: Thu, 14 Jul 2016 14:33:25 +0100 [thread overview]
Message-ID: <578794A5.3000701@arm.com> (raw)
In-Reply-To: <20160714101934.GD18175@mwanda>
On 14/07/16 11:19, Dan Carpenter wrote:
> 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>
>
> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
> index a57d650..b0b225c 100644
> --- a/arch/arm64/kvm/sys_regs.c
> +++ b/arch/arm64/kvm/sys_regs.c
> @@ -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",
>
Indeed, that looks a bit dodgy. I'll queue it for 4.8.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
prev parent reply other threads:[~2016-07-14 13:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-14 10:19 [patch] arm64: KVM: clean up a condition Dan Carpenter
2016-07-14 13:33 ` Marc Zyngier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=578794A5.3000701@arm.com \
--to=marc.zyngier@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).