diff options
author | Sami Kerola | 2017-08-26 14:38:07 +0200 |
---|---|---|
committer | Karel Zak | 2017-08-30 11:21:56 +0200 |
commit | 473ec35974185ad8ab74b6de63fa08f74fdda22e (patch) | |
tree | ab448f37e2bc9604d87a2468790ca3ab0c5f1853 /sys-utils/hwclock-cmos.c | |
parent | fdisk: use strutils to trim whitespace from input (diff) | |
download | kernel-qcow2-util-linux-473ec35974185ad8ab74b6de63fa08f74fdda22e.tar.gz kernel-qcow2-util-linux-473ec35974185ad8ab74b6de63fa08f74fdda22e.tar.xz kernel-qcow2-util-linux-473ec35974185ad8ab74b6de63fa08f74fdda22e.zip |
hwclock: remove bool type definition
Use plain int instead of type defining it to a boolean, and use numbers to
signify true or false as we do everywhere else in this source tree. And in
hwclock-cmos.c file booleans weren't even needed, to the related code is
removed.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/hwclock-cmos.c')
-rw-r--r-- | sys-utils/hwclock-cmos.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys-utils/hwclock-cmos.c b/sys-utils/hwclock-cmos.c index cdbc88b03..f7e8a1811 100644 --- a/sys-utils/hwclock-cmos.c +++ b/sys-utils/hwclock-cmos.c @@ -277,10 +277,9 @@ static int synchronize_to_clock_tick_cmos(const struct hwclock_control *ctl static int read_hardware_clock_cmos(const struct hwclock_control *ctl __attribute__((__unused__)), struct tm *tm) { - bool got_time = FALSE; unsigned char status = 0, pmbit = 0; - while (!got_time) { + while (1) { /* * Bit 7 of Byte 10 of the Hardware Clock value is the * Update In Progress (UIP) bit, which is on while and 244 @@ -310,7 +309,7 @@ static int read_hardware_clock_cmos(const struct hwclock_control *ctl * consider this a good clock read . */ if (tm->tm_sec == hclock_read(0)) - got_time = TRUE; + break; } /* * Yes, in theory we could have been running for 60 seconds @@ -403,16 +402,13 @@ static struct clock_ops cmos_interface = { }; /* - * return &cmos if cmos clock present, NULL otherwise choose this - * construction to avoid gcc messages about unused variables + * return &cmos if cmos clock present, NULL otherwise. */ struct clock_ops *probe_for_cmos_clock(void) { - static const int have_cmos = #if defined(__i386__) || defined(__x86_64__) - TRUE; + return &cmos_interface; #else - FALSE; + return NULL; #endif - return have_cmos ? &cmos_interface : NULL; } |