* [PATCH] KVM: x86: Fix constant type in kvm_get_time_scale
@ 2010-09-26 11:00 Jan Kiszka
2010-09-29 8:49 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2010-09-26 11:00 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti; +Cc: kvm, Zachary Amsden
From: Jan Kiszka <jan.kiszka@siemens.com>
Older gcc versions complain about the improper type (for x86-32), 4.5
seems to fix this silently. However, we should better use the right type
initially.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
arch/x86/kvm/x86.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 8412c91..3729bcb 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -930,14 +930,14 @@ static void kvm_get_time_scale(uint32_t scaled_khz, uint32_t base_khz,
tps64 = base_khz * 1000LL;
scaled64 = scaled_khz * 1000LL;
- while (tps64 > scaled64*2 || tps64 & 0xffffffff00000000UL) {
+ while (tps64 > scaled64*2 || tps64 & 0xffffffff00000000ULL) {
tps64 >>= 1;
shift--;
}
tps32 = (uint32_t)tps64;
- while (tps32 <= scaled64 || scaled64 & 0xffffffff00000000UL) {
- if (scaled64 & 0xffffffff00000000UL || tps32 & 0x80000000)
+ while (tps32 <= scaled64 || scaled64 & 0xffffffff00000000ULL) {
+ if (scaled64 & 0xffffffff00000000ULL || tps32 & 0x80000000)
scaled64 >>= 1;
else
tps32 <<= 1;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: x86: Fix constant type in kvm_get_time_scale
2010-09-26 11:00 [PATCH] KVM: x86: Fix constant type in kvm_get_time_scale Jan Kiszka
@ 2010-09-29 8:49 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2010-09-29 8:49 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Marcelo Tosatti, kvm, Zachary Amsden
On 09/26/2010 01:00 PM, Jan Kiszka wrote:
> From: Jan Kiszka<jan.kiszka@siemens.com>
>
> Older gcc versions complain about the improper type (for x86-32), 4.5
> seems to fix this silently. However, we should better use the right type
> initially.
Applied, thanks.
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-29 8:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-26 11:00 [PATCH] KVM: x86: Fix constant type in kvm_get_time_scale Jan Kiszka
2010-09-29 8:49 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox