lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 25 Apr 2016 14:53:14 +0800
From:	Minfei Huang <mnghuan@...il.com>
To:	tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
	luto@...nel.org, pbonzini@...hat.com, bp@...e.de,
	mtosatti@...hat.com
Cc:	x86@...nel.org, linux-kernel@...r.kernel.org,
	Minfei Huang <mnghuan@...il.com>
Subject: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables

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

Remove the useless variables.

Signed-off-by: Minfei Huang <mnghuan@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ