diff options
author | Sami Kerola | 2016-07-17 12:30:40 +0200 |
---|---|---|
committer | Sami Kerola | 2017-02-05 00:39:37 +0100 |
commit | c6ea9ef6cbe3a7ec38f550b18239fc1b27eb5e41 (patch) | |
tree | c4a3a463b095221dba5a444e34a53babde549675 /sys-utils/hwclock.c | |
parent | hwclock: move error messages to determine_clock_access_method() (diff) | |
download | kernel-qcow2-util-linux-c6ea9ef6cbe3a7ec38f550b18239fc1b27eb5e41.tar.gz kernel-qcow2-util-linux-c6ea9ef6cbe3a7ec38f550b18239fc1b27eb5e41.tar.xz kernel-qcow2-util-linux-c6ea9ef6cbe3a7ec38f550b18239fc1b27eb5e41.zip |
hwclock: remove dead code and other minor fixes
Use #ifdef rather than #if to avoid undefined preprocessor identifier
warning.
Remove dead code. The #if 0 ensured the code has not been used for long
time, which is good because the linux/mc146818rtc.h is not been part of
user-api for long time.
Value of the adjtime_p->last_calib_time is checked if it has value of zero,
so testing none-zero bit later is necessarily true, and therefore does not
need to be checked.
And at the and remove unnecessary boolean variable.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/hwclock.c')
-rw-r--r-- | sys-utils/hwclock.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c index fc476c088..b08bd781a 100644 --- a/sys-utils/hwclock.c +++ b/sys-utils/hwclock.c @@ -972,7 +972,7 @@ adjust_drift_factor(const struct hwclock_control *ctl, printf(_("Not adjusting drift factor because it has " "been less than four hours since the last " "calibration.\n")); - } else if (adjtime_p->last_calib_time != 0) { + } else { /* * At adjustment time we drift correct the hardware clock * according to the contents of the adjtime file and refresh @@ -1221,8 +1221,6 @@ static int manipulate_clock(const struct hwclock_control *ctl, const time_t set_time, const struct timeval startup_time, struct adjtime *adjtime) { - /* Set if user lacks necessary authorization to access the clock */ - bool no_auth; /* The time at which we read the Hardware Clock */ struct timeval read_time; /* @@ -1240,11 +1238,9 @@ manipulate_clock(const struct hwclock_control *ctl, const time_t set_time, /* local return code */ int rc = 0; - if (!ctl->systz && !ctl->predict) { - no_auth = ur->get_permissions(); - if (no_auth) + if (!ctl->systz && !ctl->predict) + if (ur->get_permissions()) return EX_NOPERM; - } if ((ctl->set || ctl->systohc || ctl->adjust) && (adjtime->local_utc == UTC) != ctl->universal) { |