lkml.org 
[lkml]   [2005]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [RFC][PATCH - 4/13] NTP cleanup: Breakup ntp_adjtimex()
From
Date
On Wed, 2005-08-10 at 18:27 -0700, john stultz wrote:
> All,
> This patch breaks up the complex nesting of code in ntp_adjtimex() by
> creating a ntp_hardupdate() function and simplifying some of the logic.
> This also mimics the documented NTP spec somewhat better.
>
> Any comments or feedback would be greatly appreciated.

Ugh. I just caught a bug where I misplaced the parens.

> - } /* STA_PLL */
> + else if (ntp_hardupdate(txc->offset, xtime))
> + result = TIME_ERROR;
> + }
> } /* txc->modes & ADJ_OFFSET */

That's wrong. The following patch fixes it.

thanks
-john


diff --git a/kernel/ntp.c b/kernel/ntp.c
--- a/kernel/ntp.c
+++ b/kernel/ntp.c
@@ -388,9 +388,8 @@ int ntp_adjtimex(struct timex *txc)
/* adjtime() is independent from ntp_adjtime() */
if ((time_next_adjust = txc->offset) == 0)
time_adjust = 0;
- else if (ntp_hardupdate(txc->offset, xtime))
- result = TIME_ERROR;
- }
+ } else if (ntp_hardupdate(txc->offset, xtime))
+ result = TIME_ERROR;
} /* txc->modes & ADJ_OFFSET */

if (txc->modes & ADJ_TICK) {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-16 04:11    [W:0.067 / U:13.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site