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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 15 Dec 2017 13:08:42 +0530
From:   Sagar Arun Kamble <sagar.a.kamble@...el.com>
To:     linux-kernel@...r.kernel.org
Cc:     Sagar Arun Kamble <sagar.a.kamble@...el.com>,
        Richard Cochran <richardcochran@...il.com>,
        John Stultz <john.stultz@...aro.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Stephen Boyd <sboyd@...eaurora.org>
Subject: [PATCH 27/27] timecounter: Remove timecounter_init

With all timecounter users now initializing timecounter using
timecounter_initialize remove timecounter_init function.

Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@...el.com>
Cc: Richard Cochran <richardcochran@...il.com>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Stephen Boyd <sboyd@...eaurora.org>
Cc: linux-kernel@...r.kernel.org
---
 include/linux/timecounter.h | 20 +++-----------------
 kernel/time/timecounter.c   | 16 ++++------------
 2 files changed, 7 insertions(+), 29 deletions(-)

diff --git a/include/linux/timecounter.h b/include/linux/timecounter.h
index e0fd741..e3e1d1e 100644
--- a/include/linux/timecounter.h
+++ b/include/linux/timecounter.h
@@ -46,8 +46,7 @@ struct cyclecounter {
 /**
  * struct timecounter - layer above a %struct cyclecounter which counts nanoseconds
  *	Contains the state needed by timecounter_read() to detect
- *	cycle counter wrap around. Initialize with timecounter_init() when
- *	underlying cyclecounter is initialized, with timecounter_initialize() to
+ *	cycle counter wrap around. Initialize with timecounter_initialize() to
  *	initialize cyclecounter and timecounter fields. Also used to convert
  *	cycle counts into the corresponding nanosecond counts with
  *	timecounter_cyc2time(). Users of this code are responsible for
@@ -97,18 +96,6 @@ static inline void timecounter_adjtime(struct timecounter *tc, s64 delta)
 }
 
 /**
- * timecounter_init - initialize a time counter
- * @tc:			Pointer to time counter which is to be initialized
- * @start_tstamp:	Arbitrary initial time stamp.
- *
- * After this call the current cycle register (roughly) corresponds to
- * the initial time stamp. Every call to timecounter_read() increments
- * the time stamp counter by the number of elapsed nanoseconds.
- */
-extern void timecounter_init(struct timecounter *tc,
-			     u64 start_tstamp);
-
-/**
  * timecounter_initialize - initialize a time counter and underlying
 			    cyclecounter
  * @tc:			Pointer to time counter which is to be initialized
@@ -143,9 +130,8 @@ extern void timecounter_reset(struct timecounter *tc,
 			      u64 start_tstamp);
 
 /**
- * timecounter_read - return nanoseconds elapsed since timecounter_init() or
- *                    timecounter_initialize() or timecounter_reset() plus
- *		      the initial time stamp
+ * timecounter_read - return nanoseconds elapsed since timecounter_initialize()
+ *		      or timecounter_reset() plus the initial time stamp
  * @tc:          Pointer to time counter.
  *
  * In other words, keeps track of time since the same epoch as
diff --git a/kernel/time/timecounter.c b/kernel/time/timecounter.c
index 3f62fe0..0a02ef0 100644
--- a/kernel/time/timecounter.c
+++ b/kernel/time/timecounter.c
@@ -18,17 +18,6 @@
 #include <linux/export.h>
 #include <linux/timecounter.h>
 
-void timecounter_init(struct timecounter *tc, u64 start_tstamp)
-{
-	struct cyclecounter *cc = &tc->cc;
-
-	tc->cycle_last = cc->read(cc);
-	tc->nsec = start_tstamp;
-	tc->mask = (1ULL << cc->shift) - 1;
-	tc->frac = 0;
-}
-EXPORT_SYMBOL_GPL(timecounter_init);
-
 void timecounter_initialize(struct timecounter *tc,
 			    u64 (*read)(const struct cyclecounter *cc),
 			    u64 mask,
@@ -43,7 +32,10 @@ void timecounter_initialize(struct timecounter *tc,
 	cc->mult = mult;
 	cc->shift = shift;
 
-	timecounter_init(tc, start_tstamp);
+	tc->cycle_last = cc->read(cc);
+	tc->nsec = start_tstamp;
+	tc->mask = (1ULL << cc->shift) - 1;
+	tc->frac = 0;
 }
 EXPORT_SYMBOL_GPL(timecounter_initialize);
 
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ