summaryrefslogtreecommitdiff
path: root/payloads
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2020-03-09 09:13:09 +0100
committerPatrick Georgi <pgeorgi@google.com>2020-03-23 08:35:56 +0000
commit0fd179aeb1d63eeab414a47d38ad8dd8514edcb2 (patch)
tree01f56dce78934b24416eea487223397661f391cf /payloads
parent77e0baa6e99761462af4c69c7beda0af9571525e (diff)
downloadcoreboot-0fd179aeb1d63eeab414a47d38ad8dd8514edcb2.tar.xz
libpayload/drivers/nvram: Fix coding style
If one branch has braces all should have them. Change-Id: I94e70c6c6188768d9b37a2d154f4d5b8af31f78c Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39396 Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'payloads')
-rw-r--r--payloads/libpayload/drivers/nvram.c12
1 files 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);
}