All of lore.kernel.org
 help / color / mirror / Atom feed
From: gang.chen@asianux.com (Chen Gang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM(64): KVM: add signed type cast for comparation
Date: Tue, 30 Jul 2013 10:51:47 +0800	[thread overview]
Message-ID: <51F72A43.5090409@asianux.com> (raw)
In-Reply-To: <51ECA4EC.3000408@asianux.com>

Hello Maintainers:

Please help check the patch whether OK or not, when you have time.

Thanks.

On 07/22/2013 11:20 AM, Chen Gang wrote:
> 'len' is 'unsigned long' which is never less than zero.
> 
> So need a related type cast for comparation.
> 
> The related warning (when building ARM64 with allmodconfig):
> 
>   arch/arm64/kvm/../../../arch/arm/kvm/mmio.c:82:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
> 
> 
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
>  arch/arm/kvm/mmio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/kvm/mmio.c b/arch/arm/kvm/mmio.c
> index b8e06b7..626dfc8 100644
> --- a/arch/arm/kvm/mmio.c
> +++ b/arch/arm/kvm/mmio.c
> @@ -79,7 +79,7 @@ static int decode_hsr(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
>  	}
>  
>  	len = kvm_vcpu_dabt_get_as(vcpu);
> -	if (unlikely(len < 0))
> +	if (unlikely((long)len < 0))
>  		return len;
>  
>  	is_write = kvm_vcpu_dabt_iswrite(vcpu);
> 


-- 
Chen Gang

WARNING: multiple messages have this Message-ID (diff)
From: Chen Gang <gang.chen@asianux.com>
To: christoffer.dall@linaro.org, Gleb Natapov <gleb@redhat.com>,
	pbonzini@redhat.com
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
	kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>
Subject: Re: [PATCH] ARM(64): KVM: add signed type cast for comparation
Date: Tue, 30 Jul 2013 10:51:47 +0800	[thread overview]
Message-ID: <51F72A43.5090409@asianux.com> (raw)
In-Reply-To: <51ECA4EC.3000408@asianux.com>

Hello Maintainers:

Please help check the patch whether OK or not, when you have time.

Thanks.

On 07/22/2013 11:20 AM, Chen Gang wrote:
> 'len' is 'unsigned long' which is never less than zero.
> 
> So need a related type cast for comparation.
> 
> The related warning (when building ARM64 with allmodconfig):
> 
>   arch/arm64/kvm/../../../arch/arm/kvm/mmio.c:82:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
> 
> 
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
>  arch/arm/kvm/mmio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/kvm/mmio.c b/arch/arm/kvm/mmio.c
> index b8e06b7..626dfc8 100644
> --- a/arch/arm/kvm/mmio.c
> +++ b/arch/arm/kvm/mmio.c
> @@ -79,7 +79,7 @@ static int decode_hsr(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
>  	}
>  
>  	len = kvm_vcpu_dabt_get_as(vcpu);
> -	if (unlikely(len < 0))
> +	if (unlikely((long)len < 0))
>  		return len;
>  
>  	is_write = kvm_vcpu_dabt_iswrite(vcpu);
> 


-- 
Chen Gang

  reply	other threads:[~2013-07-30  2:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-22  3:20 [PATCH] ARM(64): KVM: add signed type cast for comparation Chen Gang
2013-07-22  3:20 ` Chen Gang
2013-07-30  2:51 ` Chen Gang [this message]
2013-07-30  2:51   ` Chen Gang
2013-07-30  3:45 ` Christoffer Dall
2013-07-30  3:45   ` Christoffer Dall
2013-07-30  4:07   ` Chen Gang
2013-07-30  4:07     ` Chen Gang

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=51F72A43.5090409@asianux.com \
    --to=gang.chen@asianux.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 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.