From d0d3469139958b54dad57f979bc3162fbd3fa638 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 16 Jul 2016 20:18:19 +0100 Subject: 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 Signed-off-by: Sami Kerola --- sys-utils/hwclock-cmos.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'sys-utils/hwclock-cmos.c') 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) -- cgit v1.2.3-55-g7522