summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Roth <martinroth@google.com>2017-07-22 18:04:08 -0600
committerMartin Roth <martinroth@google.com>2017-08-01 13:20:15 +0000
commit6c581bc43ffd857d626b0918b580d6e14f2c5906 (patch)
tree861edbd803d4fcad5ee0aa87de3ebbb47ed842cc /src
parentba973bd2de8bf91cc83431333519124bf0f1fd72 (diff)
soc/dmp/vortex86: Fix CMOS read and random RTC reset
The array of CMOS values that was passed into the read routine was never getting updated. GCC 7.1 gives a warning on this: error: may be used uninitialized in this function Change-Id: I2f7c9b6455761a38598467b001efb0603fd14c32 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/20700 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/soc/dmp/vortex86ex/southbridge.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/soc/dmp/vortex86ex/southbridge.c b/src/soc/dmp/vortex86ex/southbridge.c
index 451aea67c0..1d3c897103 100644
--- a/src/soc/dmp/vortex86ex/southbridge.c
+++ b/src/soc/dmp/vortex86ex/southbridge.c
@@ -457,14 +457,14 @@ static void read_cmos_rtc(u8 rtc[7])
{
/* Read RTC twice and check update-in-progress flag, to make
* sure RTC is correct */
- u8 rtc_old[7], rtc_new[7];
+ u8 rtc_new[7];
while (get_rtc_update_in_progress()) ;
unsafe_read_cmos_rtc(rtc_new);
do {
- memcpy(rtc_old, rtc_new, 7);
+ memcpy(rtc, rtc_new, 7);
while (get_rtc_update_in_progress()) ;
unsafe_read_cmos_rtc(rtc_new);
- } while (memcmp(rtc_new, rtc_old, 7) != 0);
+ } while (memcmp(rtc_new, rtc, 7) != 0);
}
/*