Skip to content

Commit ea54bca

Browse files
George Spelvinjohnstultz-work
authored andcommitted
ntp: Make is_error_status() use its argument
is_error_status() is an inline function always called with the global time_status as an argument, so there's zero functional difference with this change, but the non-CONFIG_NTP_PPS version uses the passed-in argument, while the CONFIG_NTP_PPS one ignores its argument and uses the global. Looks like is_error_status was refactored out, but someone forgot to change the logic to check the local argument value. Thus this patch makes it use the argument always; shorter variable names are good. Signed-off-by: George Spelvin <linux@horizon.com> [jstultz: Tweaked commit message] Signed-off-by: John Stultz <john.stultz@linaro.org>
1 parent cdafb93 commit ea54bca

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎kernel/time/ntp.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,21 +165,21 @@ static inline void pps_set_freq(s64 freq)
165165

166166
static inline int is_error_status(int status)
167167
{
168-
return (time_status & (STA_UNSYNC|STA_CLOCKERR))
168+
return (status & (STA_UNSYNC|STA_CLOCKERR))
169169
/* PPS signal lost when either PPS time or
170170
* PPS frequency synchronization requested
171171
*/
172-
|| ((time_status & (STA_PPSFREQ|STA_PPSTIME))
173-
&& !(time_status & STA_PPSSIGNAL))
172+
|| ((status & (STA_PPSFREQ|STA_PPSTIME))
173+
&& !(status & STA_PPSSIGNAL))
174174
/* PPS jitter exceeded when
175175
* PPS time synchronization requested */
176-
|| ((time_status & (STA_PPSTIME|STA_PPSJITTER))
176+
|| ((status & (STA_PPSTIME|STA_PPSJITTER))
177177
== (STA_PPSTIME|STA_PPSJITTER))
178178
/* PPS wander exceeded or calibration error when
179179
* PPS frequency synchronization requested
180180
*/
181-
|| ((time_status & STA_PPSFREQ)
182-
&& (time_status & (STA_PPSWANDER|STA_PPSERROR)));
181+
|| ((status & STA_PPSFREQ)
182+
&& (status & (STA_PPSWANDER|STA_PPSERROR)));
183183
}
184184

185185
static inline void pps_fill_timex(struct timex *txc)

0 commit comments

Comments
 (0)