From: Adrian Huang <adrianhuang0701@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: John Stultz <jstultz@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Stephen Boyd <sboyd@kernel.org>,
Adrian Huang <adrianhuang0701@gmail.com>,
Adrian Huang <ahuang12@lenovo.com>
Subject: [PATCH 1/1] ntp: Refine ntp_get_next_leap implementation
Date: Thu, 23 Nov 2023 12:08:18 +0800 [thread overview]
Message-ID: <20231123040818.24905-1-adrianhuang0701@gmail.com> (raw)
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
reply other threads:[~2023-11-23 4:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231123040818.24905-1-adrianhuang0701@gmail.com \
--to=adrianhuang0701@gmail.com \
--cc=ahuang12@lenovo.com \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sboyd@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®