From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM64: include: asm: use 'int' instead of 'u32' for variable 'target' in kvm_host.h.
Date: Tue, 30 Jul 2013 08:41:34 +0100 [thread overview]
Message-ID: <51F76E2E.9050707@arm.com> (raw)
In-Reply-To: <20130730034945.GD5471@cbox>
On 30/07/13 04:49, Christoffer Dall wrote:
> On Mon, Jul 22, 2013 at 11:40:38AM +0800, Chen Gang wrote:
>> 'target' will be set to '-1' in kvm_arch_vcpu_init(), and it need check
>> 'target' whether less than zero or not in kvm_vcpu_initialized().
>>
>> So need define target as 'int' instead of 'u32', just like ARM has done.
>>
>>
>> The related warning:
>>
>> arch/arm64/kvm/../../../arch/arm/kvm/arm.c:497:2: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
>>
>> Signed-off-by: Chen Gang <gang.chen@asianux.com>
>> ---
>> arch/arm64/include/asm/kvm_host.h | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
>> index 644d739..0859a4d 100644
>> --- a/arch/arm64/include/asm/kvm_host.h
>> +++ b/arch/arm64/include/asm/kvm_host.h
>> @@ -129,7 +129,7 @@ struct kvm_vcpu_arch {
>> struct kvm_mmu_memory_cache mmu_page_cache;
>>
>> /* Target CPU and feature flags */
>> - u32 target;
>> + int target;
>> DECLARE_BITMAP(features, KVM_VCPU_MAX_FEATURES);
>>
>> /* Detect first run of a vcpu */
>> --
>> 1.7.7.6
>
> This looks ok to me, Marc, was there any reason to declare target a u32
> on arm64?
No, that's simply a bug. I really wonder why my compiler doesn't scream
at something that obvious...
Chen: what compiler version are you using?
I'll queue this fix.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <marc.zyngier@arm.com>
To: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Chen Gang <gang.chen@asianux.com>, Gleb Natapov <gleb@redhat.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
Catalin Marinas <Catalin.Marinas@arm.com>,
Will Deacon <Will.Deacon@arm.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH] ARM64: include: asm: use 'int' instead of 'u32' for variable 'target' in kvm_host.h.
Date: Tue, 30 Jul 2013 08:41:34 +0100 [thread overview]
Message-ID: <51F76E2E.9050707@arm.com> (raw)
In-Reply-To: <20130730034945.GD5471@cbox>
On 30/07/13 04:49, Christoffer Dall wrote:
> On Mon, Jul 22, 2013 at 11:40:38AM +0800, Chen Gang wrote:
>> 'target' will be set to '-1' in kvm_arch_vcpu_init(), and it need check
>> 'target' whether less than zero or not in kvm_vcpu_initialized().
>>
>> So need define target as 'int' instead of 'u32', just like ARM has done.
>>
>>
>> The related warning:
>>
>> arch/arm64/kvm/../../../arch/arm/kvm/arm.c:497:2: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
>>
>> Signed-off-by: Chen Gang <gang.chen@asianux.com>
>> ---
>> arch/arm64/include/asm/kvm_host.h | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
>> index 644d739..0859a4d 100644
>> --- a/arch/arm64/include/asm/kvm_host.h
>> +++ b/arch/arm64/include/asm/kvm_host.h
>> @@ -129,7 +129,7 @@ struct kvm_vcpu_arch {
>> struct kvm_mmu_memory_cache mmu_page_cache;
>>
>> /* Target CPU and feature flags */
>> - u32 target;
>> + int target;
>> DECLARE_BITMAP(features, KVM_VCPU_MAX_FEATURES);
>>
>> /* Detect first run of a vcpu */
>> --
>> 1.7.7.6
>
> This looks ok to me, Marc, was there any reason to declare target a u32
> on arm64?
No, that's simply a bug. I really wonder why my compiler doesn't scream
at something that obvious...
Chen: what compiler version are you using?
I'll queue this fix.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2013-07-30 7:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-22 3:40 [PATCH] ARM64: include: asm: use 'int' instead of 'u32' for variable 'target' in kvm_host.h Chen Gang
2013-07-22 3:40 ` Chen Gang
2013-07-30 2:52 ` Chen Gang
2013-07-30 2:52 ` Chen Gang
2013-07-30 3:49 ` Christoffer Dall
2013-07-30 3:49 ` Christoffer Dall
2013-07-30 7:41 ` Marc Zyngier [this message]
2013-07-30 7:41 ` Marc Zyngier
2013-07-30 8:11 ` Chen Gang
2013-07-30 8:11 ` 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=51F76E2E.9050707@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 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.