Skip to contentSkip to conversation

lm32: fix build breakage due to uninitialized variable 'r'

PATCH In review Anthony Liguori 2 participants 3 messages Apr 13, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lm32: fix build breakage due to uninitialized variable 'r'

gcc 4.5.2 correctly complains that r is potentially uninitialized in this function.

---
 hw/milkymist-pfpu.c |    2 +-
 roms/seabios        |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
hw/milkymist-pfpu.c +1 -1
index 4831e00..94e6315 100644
@@ -163,7 +163,7 @@ static int pfpu_decode_insn(MilkymistPFPUState *s)
     uint32_t reg_b = (insn >> 11) & 0x7f;
     uint32_t op = (insn >> 7) & 0xf;
     uint32_t reg_d = insn & 0x7f;
-    uint32_t r;
+    uint32_t r = 0;
     int latency = 0;
 
     switch (op) {
roms/seabios +1 -1
index cc97564..06d0bdd 160000
@@ -1 +1 @@
-Subproject commit cc975646af69f279396d4d5e1379ac6af80ee637
+Subproject commit 06d0bdd9e2e20377b3180e4986b14c8549b393e4
Signature · 1 line
1.7.4.1
#1 lore raw

roms/seabios line 1

Quoted 7 lines · Anthony Liguori
roms/seabios +1 -1
index cc97564..06d0bdd 160000
@@ -1 +1 @@
-Subproject commit cc975646af69f279396d4d5e1379ac6af80ee637
+Subproject commit 06d0bdd9e2e20377b3180e4986b14c8549b393e4

This doesn't look intentional.

I've had the same problem when using git commit -a. Any suggestions to avoid adding these submodule commits by mistake?

Stefan

#2 lore raw
Quoted 9 lines · Stefan Hajnoczi

roms/seabios line 1

Quoted 7 lines · Anthony Liguori
roms/seabios +1 -1
index cc97564..06d0bdd 160000
@@ -1 +1 @@
-Subproject commit cc975646af69f279396d4d5e1379ac6af80ee637
+Subproject commit 06d0bdd9e2e20377b3180e4986b14c8549b393e4

This doesn't look intentional.

!~@#!@#!@#

Quoted 2 lines

I've had the same problem when using git commit -a. Any suggestions to avoid adding these submodule commits by mistake?

I've been meaning to just look at fixing git submodule. The problem is that when you move between branches, the submodule doesn't get updated correctly.

Regards,

Anthony Liguori

Quoted 1 line

Stefan