From 7b162c4821045882e33910bddf5c4325e261707d Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 8 Apr 2013 15:44:09 +0200 Subject: [PATCH] clockadj: Remove clkid parameter from set_leap function. Signed-off-by: Miroslav Lichvar --- clock.c | 4 ++-- clockadj.c | 3 ++- clockadj.h | 5 ++--- phc2sys.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/clock.c b/clock.c index dedf8e0..cc692e9 100644 --- a/clock.c +++ b/clock.c @@ -508,7 +508,7 @@ static int clock_utc_correct(struct clock *c, tmv_t ingress) &leap, &utc_offset); if (c->leap_set != clock_leap) { if (c->kernel_leap) - clockadj_set_leap(c->clkid, clock_leap); + sysclk_set_leap(clock_leap); c->leap_set = clock_leap; } } @@ -593,7 +593,7 @@ struct clock *clock_create(int phc_index, struct interface *iface, int count, c->clkid = CLOCK_REALTIME; c->utc_timescale = 1; max_adj = sysclk_max_freq(); - clockadj_set_leap(c->clkid, 0); + sysclk_set_leap(0); } c->leap_set = 0; c->kernel_leap = dds->kernel_leap; diff --git a/clockadj.c b/clockadj.c index 870ee61..74963c8 100644 --- a/clockadj.c +++ b/clockadj.c @@ -71,8 +71,9 @@ void clockadj_step(clockid_t clkid, int64_t step) pr_err("failed to step clock: %m"); } -void clockadj_set_leap(clockid_t clkid, int leap) +void sysclk_set_leap(int leap) { + clockid_t clkid = CLOCK_REALTIME; struct timex tx; const char *m = NULL; memset(&tx, 0, sizeof(tx)); diff --git a/clockadj.h b/clockadj.h index d9a8a65..3779f03 100644 --- a/clockadj.h +++ b/clockadj.h @@ -45,12 +45,11 @@ double clockadj_get_freq(clockid_t clkid); void clockadj_step(clockid_t clkid, int64_t step); /** - * Insert/delete leap second at midnight. - * @param clkid CLOCK_REALTIME. + * Set the system clock to insert/delete leap second at midnight. * @param leap +1 to insert leap second, -1 to delete leap second, * 0 to reset the leap state. */ -void clockadj_set_leap(clockid_t clkid, int leap); +void sysclk_set_leap(int leap); /** * Read maximum frequency adjustment of the system clock (CLOCK_REALTIME). diff --git a/phc2sys.c b/phc2sys.c index 016a565..076840c 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -502,7 +502,7 @@ static int update_sync_offset(struct clock *clock, int64_t offset, uint64_t ts) if (clock->leap_set != clock_leap) { /* Only the system clock can leap. */ if (clock->clkid == CLOCK_REALTIME && clock->kernel_leap) - clockadj_set_leap(clock->clkid, clock_leap); + sysclk_set_leap(clock_leap); clock->leap_set = clock_leap; } @@ -702,8 +702,8 @@ int main(int argc, char *argv[]) /* The reading may silently fail and return 0, reset the frequency to make sure ppb is the actual frequency of the clock. */ clockadj_set_freq(dst_clock.clkid, ppb); - clockadj_set_leap(dst_clock.clkid, 0); if (dst_clock.clkid == CLOCK_REALTIME) { + sysclk_set_leap(0); max_ppb = sysclk_max_freq(); } else { max_ppb = phc_max_adj(dst_clock.clkid);