All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Cleanup __pvclock_read_cycles to remove useless variables
@ 2016-04-25  6:53 Minfei Huang
  2016-04-30 10:12 ` Minfei Huang
  2016-04-30 13:24 ` Borislav Petkov
  0 siblings, 2 replies; 8+ messages in thread
From: Minfei Huang @ 2016-04-25  6:53 UTC (permalink / raw)
  To: tglx, mingo, hpa, luto, pbonzini, bp, mtosatti
  Cc: x86, linux-kernel, Minfei Huang

The value of cycles and flags can be assigned directly without
intermediate variables.

Remove the useless variables.

Signed-off-by: Minfei Huang <mnghuan@gmail.com>
---
 arch/x86/include/asm/pvclock.h | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/arch/x86/include/asm/pvclock.h b/arch/x86/include/asm/pvclock.h
index fdcc040..fb95dac 100644
--- a/arch/x86/include/asm/pvclock.h
+++ b/arch/x86/include/asm/pvclock.h
@@ -80,19 +80,12 @@ static __always_inline
 unsigned __pvclock_read_cycles(const struct pvclock_vcpu_time_info *src,
 			       cycle_t *cycles, u8 *flags)
 {
-	unsigned version;
-	cycle_t ret, offset;
-	u8 ret_flags;
-
-	version = src->version;
+	cycle_t offset;
 
 	offset = pvclock_get_nsec_offset(src);
-	ret = src->system_time + offset;
-	ret_flags = src->flags;
-
-	*cycles = ret;
-	*flags = ret_flags;
-	return version;
+	*cycles = src->system_time + offset;
+	*flags = src->flags;
+	return src->version;
 }
 
 struct pvclock_vsyscall_time_info {
-- 
2.6.3

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

end of thread, other threads:[~2016-05-11 15:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-25  6:53 [PATCH] Cleanup __pvclock_read_cycles to remove useless variables Minfei Huang
2016-04-30 10:12 ` Minfei Huang
2016-04-30 13:24 ` Borislav Petkov
2016-04-30 17:47   ` Andy Lutomirski
2016-04-30 19:17     ` Borislav Petkov
2016-04-30 21:57       ` Andy Lutomirski
2016-05-11 14:24         ` Paolo Bonzini
2016-05-11 15:19           ` Minfei Huang

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.