From 0fd179aeb1d63eeab414a47d38ad8dd8514edcb2 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Mon, 9 Mar 2020 09:13:09 +0100 Subject: [PATCH] libpayload/drivers/nvram: Fix coding style If one branch has braces all should have them. Change-Id: I94e70c6c6188768d9b37a2d154f4d5b8af31f78c Signed-off-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/c/coreboot/+/39396 Reviewed-by: HAOUAS Elyes Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) --- payloads/libpayload/drivers/nvram.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/payloads/libpayload/drivers/nvram.c b/payloads/libpayload/drivers/nvram.c index 0196bb5c7c..1a80efef24 100644 --- a/payloads/libpayload/drivers/nvram.c +++ b/payloads/libpayload/drivers/nvram.c @@ -135,8 +135,9 @@ void rtc_read_clock(struct tm *time) time->tm_hour = bcd2dec(reg8 & 0x7f); time->tm_hour += (reg8 & 0x80) ? 12 : 0; time->tm_hour %= 24; - } else + } else { time->tm_hour = bcd2dec(nvram_read(NVRAM_RTC_HOURS)); + } time->tm_year = bcd2dec(nvram_read(NVRAM_RTC_YEAR)); } else { time->tm_mon = nvram_read(NVRAM_RTC_MONTH) - 1; @@ -148,8 +149,9 @@ void rtc_read_clock(struct tm *time) time->tm_hour = reg8 & 0x7f; time->tm_hour += (reg8 & 0x80) ? 12 : 0; time->tm_hour %= 24; - } else + } else { time->tm_hour = nvram_read(NVRAM_RTC_HOURS); + } time->tm_year = nvram_read(NVRAM_RTC_YEAR); } @@ -192,8 +194,9 @@ void rtc_write_clock(const struct tm *time) reg8 = dec2bcd(time->tm_hour - 12) | 0x80; else reg8 = dec2bcd(time->tm_hour); - } else + } else { reg8 = dec2bcd(time->tm_hour); + } nvram_write(reg8, NVRAM_RTC_HOURS); nvram_write(dec2bcd(year), NVRAM_RTC_YEAR); } else { @@ -206,8 +209,9 @@ void rtc_write_clock(const struct tm *time) reg8 = (time->tm_hour - 12) | 0x80; else reg8 = time->tm_hour; - } else + } else { reg8 = time->tm_hour; + } nvram_write(reg8, NVRAM_RTC_HOURS); nvram_write(year, NVRAM_RTC_YEAR); }