linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] timekeeping: Remove unused timekeeping_{get,set}_tai_offset()
@ 2016-12-07 22:33 Stephen Boyd
  2016-12-08  5:23 ` John Stultz
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Boyd @ 2016-12-07 22:33 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linux-kernel, John Stultz

The last caller to timekeeping_set_tai_offset() was in commit
0b5154fb9040 (timekeeping: Simplify tai updating from
do_adjtimex, 2013-03-22) and the last caller to
timekeeping_get_tai_offset() was in commit 76f4108892d9 (hrtimer:
Cleanup hrtimer accessors to the timekepeing state, 2014-07-16).
Remove these unused functions now that we handle TAI offsets
differently.

Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

Found with visual inspection while doing some light reading
on the timekeeping code.

 kernel/time/timekeeping.c | 39 +--------------------------------------
 kernel/time/timekeeping.h |  2 --
 2 files changed, 1 insertion(+), 40 deletions(-)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index b2286e94c934..485cf5827d8d 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1278,27 +1278,8 @@ int timekeeping_inject_offset(struct timespec *ts)
 }
 EXPORT_SYMBOL(timekeeping_inject_offset);
 
-
-/**
- * timekeeping_get_tai_offset - Returns current TAI offset from UTC
- *
- */
-s32 timekeeping_get_tai_offset(void)
-{
-	struct timekeeper *tk = &tk_core.timekeeper;
-	unsigned int seq;
-	s32 ret;
-
-	do {
-		seq = read_seqcount_begin(&tk_core.seq);
-		ret = tk->tai_offset;
-	} while (read_seqcount_retry(&tk_core.seq, seq));
-
-	return ret;
-}
-
 /**
- * __timekeeping_set_tai_offset - Lock free worker function
+ * __timekeeping_set_tai_offset - Sets the TAI offset from UTC and monotonic
  *
  */
 static void __timekeeping_set_tai_offset(struct timekeeper *tk, s32 tai_offset)
@@ -1308,24 +1289,6 @@ static void __timekeeping_set_tai_offset(struct timekeeper *tk, s32 tai_offset)
 }
 
 /**
- * timekeeping_set_tai_offset - Sets the current TAI offset from UTC
- *
- */
-void timekeeping_set_tai_offset(s32 tai_offset)
-{
-	struct timekeeper *tk = &tk_core.timekeeper;
-	unsigned long flags;
-
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
-	write_seqcount_begin(&tk_core.seq);
-	__timekeeping_set_tai_offset(tk, tai_offset);
-	timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET);
-	write_seqcount_end(&tk_core.seq);
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
-	clock_was_set();
-}
-
-/**
  * change_clocksource - Swaps clocksources if a new one is available
  *
  * Accumulates current time interval and initializes new clocksource
diff --git a/kernel/time/timekeeping.h b/kernel/time/timekeeping.h
index 704f595ce83f..d0914676d4c5 100644
--- a/kernel/time/timekeeping.h
+++ b/kernel/time/timekeeping.h
@@ -11,8 +11,6 @@ extern ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq,
 extern int timekeeping_valid_for_hres(void);
 extern u64 timekeeping_max_deferment(void);
 extern int timekeeping_inject_offset(struct timespec *ts);
-extern s32 timekeeping_get_tai_offset(void);
-extern void timekeeping_set_tai_offset(s32 tai_offset);
 extern int timekeeping_suspend(void);
 extern void timekeeping_resume(void);
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH] timekeeping: Remove unused timekeeping_{get,set}_tai_offset()
  2016-12-07 22:33 [PATCH] timekeeping: Remove unused timekeeping_{get,set}_tai_offset() Stephen Boyd
@ 2016-12-08  5:23 ` John Stultz
  0 siblings, 0 replies; 2+ messages in thread
From: John Stultz @ 2016-12-08  5:23 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: Thomas Gleixner, lkml

On Wed, Dec 7, 2016 at 2:33 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> The last caller to timekeeping_set_tai_offset() was in commit
> 0b5154fb9040 (timekeeping: Simplify tai updating from
> do_adjtimex, 2013-03-22) and the last caller to
> timekeeping_get_tai_offset() was in commit 76f4108892d9 (hrtimer:
> Cleanup hrtimer accessors to the timekepeing state, 2014-07-16).
> Remove these unused functions now that we handle TAI offsets
> differently.
>
> Cc: John Stultz <john.stultz@linaro.org>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

Looks good! Thanks for sending this in. Its a little late, and doesn't
seem urgent, so I'll queue it for 4.11.

thanks
-john

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

end of thread, other threads:[~2016-12-08  5:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-07 22:33 [PATCH] timekeeping: Remove unused timekeeping_{get,set}_tai_offset() Stephen Boyd
2016-12-08  5:23 ` John Stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).