From 473ec35974185ad8ab74b6de63fa08f74fdda22e Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 26 Aug 2017 13:38:07 +0100 Subject: 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 --- sys-utils/hwclock-cmos.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'sys-utils/hwclock-cmos.c') 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; } -- cgit v1.2.3-55-g7522