diff options
author | Sami Kerola | 2016-07-16 21:18:19 +0200 |
---|---|---|
committer | Sami Kerola | 2017-02-05 00:39:37 +0100 |
commit | d0d3469139958b54dad57f979bc3162fbd3fa638 (patch) | |
tree | ef4b5eeffc3b8b2e08f9d350f308d04f6bd55975 /sys-utils/hwclock-cmos.c | |
parent | hwclock: move command-line options to control structure (diff) | |
download | kernel-qcow2-util-linux-d0d3469139958b54dad57f979bc3162fbd3fa638.tar.gz kernel-qcow2-util-linux-d0d3469139958b54dad57f979bc3162fbd3fa638.tar.xz kernel-qcow2-util-linux-d0d3469139958b54dad57f979bc3162fbd3fa638.zip |
hwclock: clarify set_cmos_epoch() code
Variable set_epoc is unnecessary, and removal of it makes it obvious what is
happening in this function.
Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/hwclock-cmos.c')
-rw-r--r-- | sys-utils/hwclock-cmos.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/sys-utils/hwclock-cmos.c b/sys-utils/hwclock-cmos.c index 625da75c8..9d9a42a8b 100644 --- a/sys-utils/hwclock-cmos.c +++ b/sys-utils/hwclock-cmos.c @@ -178,7 +178,6 @@ static int is_in_cpuinfo(char *fmt, char *str) void set_cmos_epoch(const struct hwclock_control *ctl) { unsigned long epoch; - int set_epoc; /* Believe the user */ if (ctl->epoch_option) { @@ -219,25 +218,22 @@ void set_cmos_epoch(const struct hwclock_control *ctl) * different "epoch" ideas. */ if (is_in_cpuinfo("system serial number", "MILO")) { - set_epoc = 1; if (ctl->debug) printf(_("booted from MILO\n")); + /* + * See whether we are dealing with a RUFFIAN aka Alpha PC-164 + * UX (or BX), as they have REALLY different TOY (TimeOfYear) + * format: BCD, and not an ARC-style epoch. BCD is detected + * dynamically, but we must NOT adjust like ARC. + */ + if (is_in_cpuinfo("system type", "Ruffian")) { + if (debug) + printf(_("Ruffian BCD clock\n")); + return; + } } - /* - * See whether we are dealing with a RUFFIAN aka Alpha PC-164 UX (or - * BX), as they have REALLY different TOY (TimeOfYear) format: BCD, - * and not an ARC-style epoch. BCD is detected dynamically, but we - * must NOT adjust like ARC. - */ - if (set_epoc && is_in_cpuinfo("system type", "Ruffian")) { - set_epoc = 0; - if (ctl->debug) - printf(_("Ruffian BCD clock\n")); - } - - if (set_epoc) - cmos_epoch = 1980; + cmos_epoch = 1980; } void set_cmos_access(const struct hwclock_control *ctl) |