* [PATCH] ARM64: include: asm: use 'int' instead of 'u32' for variable 'target' in kvm_host.h.
@ 2013-07-22 3:40 Chen Gang
2013-07-30 2:52 ` Chen Gang
2013-07-30 3:49 ` Christoffer Dall
0 siblings, 2 replies; 5+ messages in thread
From: Chen Gang @ 2013-07-22 3:40 UTC (permalink / raw)
To: linux-arm-kernel
'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
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH] ARM64: include: asm: use 'int' instead of 'u32' for variable 'target' in kvm_host.h.
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-30 2:52 ` Chen Gang
2013-07-30 3:49 ` Christoffer Dall
1 sibling, 0 replies; 5+ messages in thread
From: Chen Gang @ 2013-07-30 2:52 UTC (permalink / raw)
To: linux-arm-kernel
Hello Maintainers:
Please help check the patch whether OK or not, when you have time.
Thanks.
On 07/22/2013 11:40 AM, 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 */
>
--
Chen Gang
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH] ARM64: include: asm: use 'int' instead of 'u32' for variable 'target' in kvm_host.h.
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-30 2:52 ` Chen Gang
@ 2013-07-30 3:49 ` Christoffer Dall
2013-07-30 7:41 ` Marc Zyngier
1 sibling, 1 reply; 5+ messages in thread
From: Christoffer Dall @ 2013-07-30 3:49 UTC (permalink / raw)
To: linux-arm-kernel
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?
-Christoffer
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH] ARM64: include: asm: use 'int' instead of 'u32' for variable 'target' in kvm_host.h.
2013-07-30 3:49 ` Christoffer Dall
@ 2013-07-30 7:41 ` Marc Zyngier
2013-07-30 8:11 ` Chen Gang
0 siblings, 1 reply; 5+ messages in thread
From: Marc Zyngier @ 2013-07-30 7:41 UTC (permalink / raw)
To: linux-arm-kernel
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...
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH] ARM64: include: asm: use 'int' instead of 'u32' for variable 'target' in kvm_host.h.
2013-07-30 7:41 ` Marc Zyngier
@ 2013-07-30 8:11 ` Chen Gang
0 siblings, 0 replies; 5+ messages in thread
From: Chen Gang @ 2013-07-30 8:11 UTC (permalink / raw)
To: linux-arm-kernel
On 07/30/2013 03:41 PM, Marc Zyngier wrote:
> 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...
>
I make with "EXTRA_CFLAGS=-W", normal make will not report this
warning. ;-)
> Chen: what compiler version are you using?
>
[root at gchenlinux linux-next]# aarch64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/bin/../libexec/gcc/aarch64-linux-gnu/4.7.3/lto-wrapper
Target: aarch64-linux-gnu
Configured with: /cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/src/gcc-linaro-4.7-2013.02/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=aarch64-linux-gnu --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/install --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/install/aarch64-linux-gnu/libc --enable-languages=c,c++,fortran --disable-multilib --with-pkgversion='crosstool-NG linaro-1.13.1-4.7-2013.02-01-20130221 - ARM aarch64 via Linaro' --with-bugurl=https://bugs.launchpad.net/gcc-linaro --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/aarch64-linux-gnu/build/static --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/aarch64-linux-gnu/build/static --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linu
x/.build/
aarch64-linux-gnu/build/static --with-ppl=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/aarch64-linux-gnu/build/static --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/aarch64-linux-gnu/build/static --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/aarch64-linux-gnu/build/static --with-host-libstdcxx='-L/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/.build/aarch64-linux-gnu/build/static/lib -lpwl' --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-plugin --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/aarch64-linux-gnu-linux/install/aarch64-linux-gnu/libc --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.7.3 20130205 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.02-01-20130221 - ARM aarch64 via Linaro)
> I'll queue this fix.
>
> Thanks,
>
> M.
>
Thank you too.
--
Chen Gang
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-07-30 8:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-30 2:52 ` Chen Gang
2013-07-30 3:49 ` Christoffer Dall
2013-07-30 7:41 ` Marc Zyngier
2013-07-30 8:11 ` Chen Gang
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).