Skip to contentSkip to conversation

ntp: Refine ntp_get_next_leap implementation

PATCH New Adrian Huang 1 participant 1 message Nov 23, 2023 Timekeeping, clocksource core, NTP, alarmtimer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ntp: Refine ntp_get_next_leap implementation

From: Adrian Huang <[email protected]>

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.

---
 kernel/time/ntp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
kernel/time/ntp.c +2 -4
index 406dccb79c2b..af1a7e0c0f9d 100644
@@ -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;
 }
 
 /*
Signature · 1 line
2.25.1