diff options
author | Sami Kerola | 2016-07-17 17:14:16 +0200 |
---|---|---|
committer | Sami Kerola | 2017-02-05 00:39:37 +0100 |
commit | 0f32118e70c097f54fe706cb34adeaf9010a6a7a (patch) | |
tree | 50fef94261958921abdb01dfcdd09b4349ee3663 /sys-utils/hwclock-cmos.c | |
parent | hwclock: initialize struct adjtime members (diff) | |
download | kernel-qcow2-util-linux-0f32118e70c097f54fe706cb34adeaf9010a6a7a.tar.gz kernel-qcow2-util-linux-0f32118e70c097f54fe706cb34adeaf9010a6a7a.tar.xz kernel-qcow2-util-linux-0f32118e70c097f54fe706cb34adeaf9010a6a7a.zip |
hwclock: use symbolic magic values passed in between functions
The manipulate_clock() is seeing return value from
busywait_for_rtc_clock_tick().
And the get_permissions_cmos() can see i386_iopl() return value.
Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/hwclock-cmos.c')
-rw-r--r-- | sys-utils/hwclock-cmos.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys-utils/hwclock-cmos.c b/sys-utils/hwclock-cmos.c index 6595725fd..30f8765a5 100644 --- a/sys-utils/hwclock-cmos.c +++ b/sys-utils/hwclock-cmos.c @@ -104,6 +104,8 @@ static int inb(int c __attribute__ ((__unused__))) #define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) #define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10) +#define IOPL_NOT_IMPLEMENTED -2 + /* * The epoch. * @@ -633,7 +635,7 @@ static int i386_iopl(const int level __attribute__ ((__unused__))) #else static int i386_iopl(const int level __attribute__ ((__unused__))) { - return -2; + return IOPL_NOT_IMPLEMENTED; } #endif @@ -649,7 +651,7 @@ static int get_permissions_cmos(void) rc = 0; } else { rc = i386_iopl(3); - if (rc == -2) { + if (rc == IOPL_NOT_IMPLEMENTED) { warnx(_("I failed to get permission because I didn't try.")); } else if (rc != 0) { rc = errno; |