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>
This commit is contained in:
parent
77e0baa6e9
commit
0fd179aeb1
|
@ -135,8 +135,9 @@ void rtc_read_clock(struct tm *time)
|
||||||
time->tm_hour = bcd2dec(reg8 & 0x7f);
|
time->tm_hour = bcd2dec(reg8 & 0x7f);
|
||||||
time->tm_hour += (reg8 & 0x80) ? 12 : 0;
|
time->tm_hour += (reg8 & 0x80) ? 12 : 0;
|
||||||
time->tm_hour %= 24;
|
time->tm_hour %= 24;
|
||||||
} else
|
} else {
|
||||||
time->tm_hour = bcd2dec(nvram_read(NVRAM_RTC_HOURS));
|
time->tm_hour = bcd2dec(nvram_read(NVRAM_RTC_HOURS));
|
||||||
|
}
|
||||||
time->tm_year = bcd2dec(nvram_read(NVRAM_RTC_YEAR));
|
time->tm_year = bcd2dec(nvram_read(NVRAM_RTC_YEAR));
|
||||||
} else {
|
} else {
|
||||||
time->tm_mon = nvram_read(NVRAM_RTC_MONTH) - 1;
|
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 & 0x7f;
|
||||||
time->tm_hour += (reg8 & 0x80) ? 12 : 0;
|
time->tm_hour += (reg8 & 0x80) ? 12 : 0;
|
||||||
time->tm_hour %= 24;
|
time->tm_hour %= 24;
|
||||||
} else
|
} else {
|
||||||
time->tm_hour = nvram_read(NVRAM_RTC_HOURS);
|
time->tm_hour = nvram_read(NVRAM_RTC_HOURS);
|
||||||
|
}
|
||||||
time->tm_year = nvram_read(NVRAM_RTC_YEAR);
|
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;
|
reg8 = dec2bcd(time->tm_hour - 12) | 0x80;
|
||||||
else
|
else
|
||||||
reg8 = dec2bcd(time->tm_hour);
|
reg8 = dec2bcd(time->tm_hour);
|
||||||
} else
|
} else {
|
||||||
reg8 = dec2bcd(time->tm_hour);
|
reg8 = dec2bcd(time->tm_hour);
|
||||||
|
}
|
||||||
nvram_write(reg8, NVRAM_RTC_HOURS);
|
nvram_write(reg8, NVRAM_RTC_HOURS);
|
||||||
nvram_write(dec2bcd(year), NVRAM_RTC_YEAR);
|
nvram_write(dec2bcd(year), NVRAM_RTC_YEAR);
|
||||||
} else {
|
} else {
|
||||||
|
@ -206,8 +209,9 @@ void rtc_write_clock(const struct tm *time)
|
||||||
reg8 = (time->tm_hour - 12) | 0x80;
|
reg8 = (time->tm_hour - 12) | 0x80;
|
||||||
else
|
else
|
||||||
reg8 = time->tm_hour;
|
reg8 = time->tm_hour;
|
||||||
} else
|
} else {
|
||||||
reg8 = time->tm_hour;
|
reg8 = time->tm_hour;
|
||||||
|
}
|
||||||
nvram_write(reg8, NVRAM_RTC_HOURS);
|
nvram_write(reg8, NVRAM_RTC_HOURS);
|
||||||
nvram_write(year, NVRAM_RTC_YEAR);
|
nvram_write(year, NVRAM_RTC_YEAR);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue