Commit d633d167 authored by Alessandro Rubini's avatar Alessandro Rubini Committed by Adam Wujek

audit: remove needless '-x' FLAG_NO_RESET

The idea that somebody wants to steer time for >1s offsets is
perverse.  Let's simplify (if any, we may want to jump for <1s offsets
that are bigger than a few milliseconds).
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent e5ddf2cc
......@@ -32,10 +32,8 @@ struct pp_runtime_opts {
* Flags for the above structure
*/
#define PP_FLAG_NO_ADJUST 0x01
#define PP_FLAG_NO_RESET 0x02
/* I'd love to use inlines, but we still miss some structure at this point*/
#define pp_can_adjust(ppi) (!(OPTS(ppi)->flags & PP_FLAG_NO_ADJUST))
#define pp_can_reset_clock(ppi) (!(OPTS(ppi)->flags & PP_FLAG_NO_RESET))
/* slave_only:1, -- moved to ppi, no more global */
/* master_only:1, -- moved to ppi, no more global */
......
......@@ -27,7 +27,6 @@ static struct cmd_line_opt cmd_line_list[] = {
{"-f FILE", "read configuration file"},
{"-d STRING", "diagnostic level (see diag-macros.h)"},
CMD_LINE_SEPARATOR,
{"-x", "do not reset the clock if off by more than one second"},
{"-t", "do not adjust the system clock"},
{"-w NUMBER", "specify meanPathDelay filter stiffness"},
CMD_LINE_SEPARATOR,
......@@ -84,9 +83,6 @@ int pp_parse_cmdline(struct pp_globals *ppg, int argc, char **argv)
if (pp_config_file(ppg, 1, argv[++i]) != 0)
return -1;
break;
case 'x':
GOPTS(ppg)->flags |= PP_FLAG_NO_RESET;
break;
case 't':
GOPTS(ppg)->flags |= PP_FLAG_NO_ADJUST;
break;
......
......@@ -284,22 +284,12 @@ int pp_servo_offset_master(struct pp_instance *ppi, TimeInternal * mpd,
/* if secs, reset clock or set freq adjustment to max */
if (pp_can_adjust(ppi)) {
if (pp_can_reset_clock(ppi)) {
/* Can't use adjust, limited to +/- 2s */
time_tmp = ppi->t4;
add_TimeInternal(&time_tmp, &time_tmp,
&DSCUR(ppi)->meanPathDelay);
ppi->t_ops->set(ppi, &time_tmp);
pp_servo_init(ppi);
} else {
adj = ofm->nanoseconds > 0
? PP_ADJ_FREQ_MAX : -PP_ADJ_FREQ_MAX;
if (ppi->t_ops->adjust_freq)
ppi->t_ops->adjust_freq(ppi, -adj);
else
ppi->t_ops->adjust_offset(ppi, -adj);
}
/* Can't use adjust, limited to +/- 2s */
time_tmp = ppi->t4;
add_TimeInternal(&time_tmp, &time_tmp,
&DSCUR(ppi)->meanPathDelay);
ppi->t_ops->set(ppi, &time_tmp);
pp_servo_init(ppi);
}
return 1; /* done */
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment