All of lore.kernel.org
 help / color / mirror / Atom feed
From: J William Piggott <elseifthen@gmx.com>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: [PATCH 1/8] hwclock: move systz above init clocks read
Date: Tue, 1 Aug 2017 09:11:31 -0400	[thread overview]
Message-ID: <5eb1bcb1-c50f-f952-c0a0-a2a3027a0172@gmx.com> (raw)
In-Reply-To: <e1d514d0-132d-d142-41fb-cf179de5606a@gmx.com>


The systz option is all about speed, so move it to the
top and simplify the init clocks read test.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
---
 sys-utils/hwclock.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index c74e0e2..cec712d 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -1046,8 +1046,11 @@ manipulate_clock(const struct hwclock_control *ctl, const time_t set_time,
 		adjtime->dirty = TRUE;
 	}
 
+	if (ctl->systz)
+		return set_system_clock_timezone(ctl);
+
 	if (ctl->show || ctl->get || ctl->adjust || ctl->hctosys
-	    || (!ctl->noadjfile && !ctl->systz && !ctl->predict)) {
+	    || (!ctl->noadjfile && !ctl->predict)) {
 		/* data from HW-clock are required */
 		rc = synchronize_to_clock_tick(ctl);
 
@@ -1123,8 +1126,6 @@ manipulate_clock(const struct hwclock_control *ctl, const time_t set_time,
 					    hclock_valid, hclocktime);
 	} else if (ctl->hctosys) {
 		return set_system_clock(ctl, hclock_valid, hclocktime);
-	} else if (ctl->systz) {
-		return set_system_clock_timezone(ctl);
 	} else if (ctl->predict) {
 		hclocktime = time_inc(hclocktime, (double)
 				      -(tdrift.tv_sec + tdrift.tv_usec / 1E6));

  reply	other threads:[~2017-08-01 13:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-01 13:10 [PATCH 0/8] Pull Request J William Piggott
2017-08-01 13:11 ` J William Piggott [this message]
2017-08-01 13:13 ` [PATCH 2/8] hwclock: move rtc permissions test J William Piggott
2017-08-01 13:35   ` [PATCH 7/8] hwclock: restore select() timeout warning J William Piggott
2017-08-01 13:16 ` [PATCH 3/8] hwclock: move drift correction and --predict J William Piggott
2017-08-01 13:17 ` [PATCH 4/8] hwclock: fix RTC read logic J William Piggott
2017-08-01 18:42   ` J William Piggott
2017-08-02  8:21   ` Karel Zak
2017-08-01 13:18 ` [PATCH 5/8] hwclock: correlate hclocktime instead of set_time J William Piggott
2017-08-01 13:20 ` [PATCH 6/8] hwclock: update man page J William Piggott
2017-08-02  8:24   ` Karel Zak
2017-08-01 13:37 ` [PATCH 8/8] hwclock: remove busywait tristate return status J William Piggott
2017-08-03  0:01 ` [PATCH 9/8] hwclock: fix hclock_valid test and error messages J William Piggott
2017-08-04 13:33   ` [v2 PATCH " J William Piggott
2017-08-07  7:54 ` [PATCH 0/8] Pull Request Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5eb1bcb1-c50f-f952-c0a0-a2a3027a0172@gmx.com \
    --to=elseifthen@gmx.com \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.