From: "George Spelvin" <linux@horizon.com>
To: john.stultz@linaro.org
Cc: linux@horizon.com, linux-kernel@vger.kernel.org
Subject: [PATCH] ntp: make is_error_status() use its argument
Date: 12 May 2014 09:35:48 -0400 [thread overview]
Message-ID: <20140512133548.31421.qmail@ns.horizon.com> (raw)
It's an inline function always called with the global time_status as an
argument, so there's zero functional difference, but the non-CONFIG_SMP
version uses the passed-in argument, while the CONFIG_SMP one ignores
its argument and uses the global.
Make it use the argument always; shorter variable names are good.
Signed-off-by: George Spelvin <linux@horizon.com>
---
While poking about in the code, I came across this rather odd bit.
It looked worth fixing, on general principles.
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 419a52cecd..1a2aad3fff 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -165,21 +165,21 @@ static inline void pps_set_freq(s64 freq)
static inline int is_error_status(int status)
{
- return (time_status & (STA_UNSYNC|STA_CLOCKERR))
+ return (status & (STA_UNSYNC|STA_CLOCKERR))
/* PPS signal lost when either PPS time or
* PPS frequency synchronization requested
*/
- || ((time_status & (STA_PPSFREQ|STA_PPSTIME))
- && !(time_status & STA_PPSSIGNAL))
+ || ((status & (STA_PPSFREQ|STA_PPSTIME))
+ && !(status & STA_PPSSIGNAL))
/* PPS jitter exceeded when
* PPS time synchronization requested */
- || ((time_status & (STA_PPSTIME|STA_PPSJITTER))
+ || ((status & (STA_PPSTIME|STA_PPSJITTER))
== (STA_PPSTIME|STA_PPSJITTER))
/* PPS wander exceeded or calibration error when
* PPS frequency synchronization requested
*/
- || ((time_status & STA_PPSFREQ)
- && (time_status & (STA_PPSWANDER|STA_PPSERROR)));
+ || ((status & STA_PPSFREQ)
+ && (status & (STA_PPSWANDER|STA_PPSERROR)));
}
static inline void pps_fill_timex(struct timex *txc)
next reply other threads:[~2014-05-12 13:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-12 13:35 George Spelvin [this message]
2014-05-12 17:54 ` John Stultz
2014-05-12 20:10 ` Alexander Gordeev
2014-05-13 3:01 ` George Spelvin
2014-05-13 3:15 ` John Stultz
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=20140512133548.31421.qmail@ns.horizon.com \
--to=linux@horizon.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
/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®