All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/time: cpuid_time_leaf() cleanup
@ 2014-05-02 12:31 Andrew Cooper
  0 siblings, 0 replies; only message in thread
From: Andrew Cooper @ 2014-05-02 12:31 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Keir Fraser, Jan Beulich

* Don't mix uint32_t and unsigned int between prototype and definition
* Don't bitwise or with 0

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
---
 xen/arch/x86/time.c        |    7 +++----
 xen/include/asm-x86/time.h |    4 ++--
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index fc5c777..f8c20f8 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1754,10 +1754,9 @@ void cpuid_time_leaf(uint32_t sub_idx, uint32_t *eax, uint32_t *ebx,
     switch ( sub_idx )
     {
     case 0: /* features */
-        *eax = ( ( (!!d->arch.vtsc) << 0 ) |
-                 ( (!!host_tsc_is_safe()) << 1 ) |
-                 ( (!!boot_cpu_has(X86_FEATURE_RDTSCP)) << 2 ) |
-               0 );
+        *eax = (!!d->arch.vtsc << 0) |
+               (!!host_tsc_is_safe() << 1) |
+               (!!boot_cpu_has(X86_FEATURE_RDTSCP) << 2);
         *ebx = d->arch.tsc_mode;
         *ecx = d->arch.tsc_khz;
         *edx = d->arch.incarnation;
diff --git a/xen/include/asm-x86/time.h b/xen/include/asm-x86/time.h
index 0631baa..420620e 100644
--- a/xen/include/asm-x86/time.h
+++ b/xen/include/asm-x86/time.h
@@ -71,8 +71,8 @@ void tsc_get_info(struct domain *d, uint32_t *tsc_mode, uint64_t *elapsed_nsec,
 void force_update_vcpu_system_time(struct vcpu *v);
 
 int host_tsc_is_safe(void);
-void cpuid_time_leaf(uint32_t sub_idx, unsigned int *eax, unsigned int *ebx,
-                      unsigned int *ecx, unsigned int *edx);
+void cpuid_time_leaf(uint32_t sub_idx, uint32_t *eax, uint32_t *ebx,
+                     uint32_t *ecx, uint32_t *edx);
 
 u64 stime2tsc(s_time_t stime);
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-05-02 12:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-02 12:31 [PATCH] x86/time: cpuid_time_leaf() cleanup Andrew Cooper

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.