From: Sami Kerola Date: Sat, 16 Jul 2016 19:18:19 +0000 (+0100) Subject: hwclock: clarify set_cmos_epoch() code X-Git-Tag: v2.30-rc1~267^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0d3469139958b54dad57f979bc3162fbd3fa638;p=thirdparty%2Futil-linux.git 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 --- diff --git a/sys-utils/hwclock-cmos.c b/sys-utils/hwclock-cmos.c index 625da75c82..9d9a42a8b8 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)