Skip to contentSkip to conversation

x86/kvmclock_test: fix i386 compilation

PATCH In review Andrew Jones 3 participants 4 messages Oct 31, 2016 – Nov 1, 2016 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/kvmclock_test: fix i386 compilation

---
 x86/kvmclock_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/kvmclock_test.c +1 -1
index f729dbecf38e..cbdcaf6961fe 100644
@@ -33,7 +33,7 @@ static void wallclock_test(void *data)
         ksec = ts.tv_sec;
 
         offset = ksec - sec;
-        printf("Raw nanoseconds value from kvmclock: %ld (cpu %d)\n", kvm_clock_read(), smp_id());
+        printf("Raw nanoseconds value from kvmclock: %" PRId64 " (cpu %d)\n", kvm_clock_read(), smp_id());
         printf("Seconds get from kvmclock: %ld (cpu %d, offset: %ld)\n", ksec, smp_id(), offset);
 
         if (offset > threshold || offset < -threshold) {
Signature · 1 line
2.7.4
#1 lore raw
Quoted 10 lines
---
 x86/kvmclock_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/kvmclock_test.c +0 -0
index f729dbecf38e..cbdcaf6961fe 100644

x86/kvmclock_test.c static void wallclock_test(void *data) · line 36

Quoted 5 lines
x86/kvmclock_test.c +1 -1
@@ -33,7 +33,7 @@ static void wallclock_test(void *data)
         ksec = ts.tv_sec;
 
         offset = ksec - sec;
-        printf("Raw nanoseconds value from kvmclock: %ld (cpu %d)\n", kvm_clock_read(), smp_id());
+        printf("Raw nanoseconds value from kvmclock: %" PRId64 " (cpu %d)\n", kvm_clock_read(), smp_id());

Looks like the PRId64 here should be PRIu64, as the cycle_t from x86/kvmclock.h uses u64

in x86/kvmclock.h:

14 typedef u64 cycle_t;
39 cycle_t kvm_clock_read();

Quoted 10 lines
x86/kvmclock_test.c +0 -1
         printf("Seconds get from kvmclock: %ld (cpu %d, offset: %ld)\n", ksec, smp_id(), offset);
 
         if (offset > threshold || offset < -threshold) {
--

2.7.4

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 18 lines · Po-Hsu Lin
Quoted 10 lines
---
 x86/kvmclock_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/kvmclock_test.c +0 -0
index f729dbecf38e..cbdcaf6961fe 100644

x86/kvmclock_test.c static void wallclock_test(void *data) · line 36

Quoted 5 lines
x86/kvmclock_test.c +1 -1
@@ -33,7 +33,7 @@ static void wallclock_test(void *data)
         ksec = ts.tv_sec;
 
         offset = ksec - sec;
-        printf("Raw nanoseconds value from kvmclock: %ld (cpu %d)\n", kvm_clock_read(), smp_id());
+        printf("Raw nanoseconds value from kvmclock: %" PRId64 " (cpu %d)\n", kvm_clock_read(), smp_id());

Looks like the PRId64 here should be PRIu64, as the cycle_t from x86/kvmclock.h uses u64

Quoted 4 lines

in x86/kvmclock.h:

14 typedef u64 cycle_t;
39 cycle_t kvm_clock_read();

Will fix.

Thanks,
drew

Quoted 15 lines
Quoted 11 lines
x86/kvmclock_test.c +0 -1
         printf("Seconds get from kvmclock: %ld (cpu %d, offset: %ld)\n", ksec, smp_id(), offset);
 
         if (offset > threshold || offset < -threshold) {
--

2.7.4

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#3 lore raw
In reply to Andrew Jones
Quoted 11 lines · Andrew Jones
---
 x86/kvmclock_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/kvmclock_test.c +0 -0
index f729dbecf38e..cbdcaf6961fe 100644

x86/kvmclock_test.c static void wallclock_test(void *data) · line 39

Quoted 8 lines
x86/kvmclock_test.c +1 -1
@@ -33,7 +33,7 @@ static void wallclock_test(void *data)
         ksec = ts.tv_sec;
 
         offset = ksec - sec;
-        printf("Raw nanoseconds value from kvmclock: %ld (cpu %d)\n", kvm_clock_read(), smp_id());
+        printf("Raw nanoseconds value from kvmclock: %" PRId64 " (cpu %d)\n", kvm_clock_read(), smp_id());
         printf("Seconds get from kvmclock: %ld (cpu %d, offset: %ld)\n", ksec, smp_id(), offset);
 
         if (offset > threshold || offset < -threshold) {

Committed, thanks (with PRIu64).

Paolo