Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1386051 > unrolled thread

[PATCH] Cleanup __pvclock_read_cycles to remove useless variables

Started byMinfei Huang <mnghuan@gmail.com>
First post2016-04-25 09:00 +0200
Last post2016-04-25 09:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] Cleanup __pvclock_read_cycles to remove useless variables Minfei Huang <mnghuan@gmail.com> - 2016-04-25 09:00 +0200

#1386051 — [PATCH] Cleanup __pvclock_read_cycles to remove useless variables

FromMinfei Huang <mnghuan@gmail.com>
Date2016-04-25 09:00 +0200
Subject[PATCH] Cleanup __pvclock_read_cycles to remove useless variables
Message-ID<rrIEW-1iI-29@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web