MIPS: IP32: Fix build error due to uninitialized variable.
authorRalf Baechle <ralf@linux-mips.org>
Fri, 22 May 2009 09:48:17 +0000 (10:48 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 22 May 2009 12:52:06 +0000 (13:52 +0100)
  CC      arch/mips/sgi-ip32/ip32-reset.o
cc1: warnings being treated as errors
arch/mips/sgi-ip32/ip32-reset.c: In function 'debounce':
arch/mips/sgi-ip32/ip32-reset.c:97: error: 'reg_a' is used uninitialized in this function

The issues is old but due to the volatile keyword gcc older than 4.4 did
not warn about this obvious bug.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/sgi-ip32/ip32-reset.c

index 667da932b7b284f7b7db7f586bb2414b49d5f4ee..cc549a9a99e8a062696a67e318d1284e20b025a8 100644 (file)
@@ -94,6 +94,7 @@ static void debounce(unsigned long data)
        volatile unsigned char reg_a, reg_c, xctrl_a;
 
        reg_c = CMOS_READ(RTC_INTR_FLAGS);
+       reg_a = CMOS_READ(RTC_REG_A);
        CMOS_WRITE(reg_a | DS_REGA_DV0, RTC_REG_A);
        wbflush();
        xctrl_a = CMOS_READ(DS_B1_XCTRL4A);