mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] ntp: Refine ntp_get_next_leap implementation
@ 2023-11-23  4:08 Adrian Huang
  0 siblings, 0 replies; only message in thread
From: Adrian Huang @ 2023-11-23  4:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: John Stultz, Thomas Gleixner, Stephen Boyd, Adrian Huang, Adrian Huang

From: Adrian Huang <ahuang12@lenovo.com>

It is unnecessary to use the local variable 'ret' in the ntp_get_next_leap
implementation function - just return KTIME_MAX directly and get rid of
the local variable altogether.

Signed-off-by: Adrian Huang <ahuang12@lenovo.com>
---
 kernel/time/ntp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 406dccb79c2b..af1a7e0c0f9d 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -379,12 +379,10 @@ u64 ntp_tick_length(void)
  */
 ktime_t ntp_get_next_leap(void)
 {
-	ktime_t ret;
-
 	if ((time_state == TIME_INS) && (time_status & STA_INS))
 		return ktime_set(ntp_next_leap_sec, 0);
-	ret = KTIME_MAX;
-	return ret;
+
+	return KTIME_MAX;
 }
 
 /*
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-23  4:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-23  4:08 [PATCH 1/1] ntp: Refine ntp_get_next_leap implementation Adrian Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®