From: Andrew Cooper Date: Wed, 26 Feb 2014 16:21:22 +0000 (+0100) Subject: x86/time: Remove redundant RTC REG_B read X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5544 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=565d6a734a440219f371c890af1b624081b6f54f;p=xen.git x86/time: Remove redundant RTC REG_B read RTC_ALWAYS_BCD is always defined by default, meaning that we will unconditionally enter the if statement. Reordering the condition allows short-circult evaluation to remove a redundant CMOS read. Signed-off-by: Andrew Cooper --- diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 6e31e1faed..82492c1784 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -661,7 +661,7 @@ static unsigned long __get_cmos_time(void) mon = CMOS_READ(RTC_MONTH); year = CMOS_READ(RTC_YEAR); - if ( !(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD ) + if ( RTC_ALWAYS_BCD || !(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) ) { BCD_TO_BIN(sec); BCD_TO_BIN(min);