All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] x86/kvmclock_test: fix i386 compilation
@ 2016-10-31 18:45 Andrew Jones
  2016-11-01 11:37 ` Po-Hsu Lin
  2016-11-01 14:42 ` Paolo Bonzini
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Jones @ 2016-10-31 18:45 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 x86/kvmclock_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/x86/kvmclock_test.c b/x86/kvmclock_test.c
index f729dbecf38e..cbdcaf6961fe 100644
--- a/x86/kvmclock_test.c
+++ b/x86/kvmclock_test.c
@@ -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) {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [kvm-unit-tests PATCH] x86/kvmclock_test: fix i386 compilation
  2016-10-31 18:45 [kvm-unit-tests PATCH] x86/kvmclock_test: fix i386 compilation Andrew Jones
@ 2016-11-01 11:37 ` Po-Hsu Lin
  2016-11-01 13:50   ` Andrew Jones
  2016-11-01 14:42 ` Paolo Bonzini
  1 sibling, 1 reply; 4+ messages in thread
From: Po-Hsu Lin @ 2016-11-01 11:37 UTC (permalink / raw)
  To: kvm, drjones; +Cc: pbonzini

> Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
> ---
>  x86/kvmclock_test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/x86/kvmclock_test.c b/x86/kvmclock_test.c
> index f729dbecf38e..cbdcaf6961fe 100644
> --- a/x86/kvmclock_test.c
> +++ b/x86/kvmclock_test.c
> @@ -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();

>          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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [kvm-unit-tests PATCH] x86/kvmclock_test: fix i386 compilation
  2016-11-01 11:37 ` Po-Hsu Lin
@ 2016-11-01 13:50   ` Andrew Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Jones @ 2016-11-01 13:50 UTC (permalink / raw)
  To: Po-Hsu Lin; +Cc: kvm, pbonzini

On Tue, Nov 01, 2016 at 07:37:09PM +0800, Po-Hsu Lin wrote:
> > Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
> > ---
> >  x86/kvmclock_test.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/x86/kvmclock_test.c b/x86/kvmclock_test.c
> > index f729dbecf38e..cbdcaf6961fe 100644
> > --- a/x86/kvmclock_test.c
> > +++ b/x86/kvmclock_test.c
> > @@ -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();

Will fix.

Thanks,
drew

> 
> >          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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [kvm-unit-tests PATCH] x86/kvmclock_test: fix i386 compilation
  2016-10-31 18:45 [kvm-unit-tests PATCH] x86/kvmclock_test: fix i386 compilation Andrew Jones
  2016-11-01 11:37 ` Po-Hsu Lin
@ 2016-11-01 14:42 ` Paolo Bonzini
  1 sibling, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2016-11-01 14:42 UTC (permalink / raw)
  To: Andrew Jones, kvm



On 31/10/2016 19:45, Andrew Jones wrote:
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>  x86/kvmclock_test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/x86/kvmclock_test.c b/x86/kvmclock_test.c
> index f729dbecf38e..cbdcaf6961fe 100644
> --- a/x86/kvmclock_test.c
> +++ b/x86/kvmclock_test.c
> @@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-01 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-31 18:45 [kvm-unit-tests PATCH] x86/kvmclock_test: fix i386 compilation Andrew Jones
2016-11-01 11:37 ` Po-Hsu Lin
2016-11-01 13:50   ` Andrew Jones
2016-11-01 14:42 ` Paolo Bonzini

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.