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

login
register
mail settings
Submitter Anthony Liguori
Date April 13, 2011, 12:43 p.m.
Message ID <1302698625-26136-1-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/91001/
State New
Headers show

Comments

Anthony Liguori - April 13, 2011, 12:43 p.m.
gcc 4.5.2 correctly complains that r is potentially uninitialized in this
function.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/milkymist-pfpu.c |    2 +-
 roms/seabios        |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Stefan Hajnoczi - April 13, 2011, 1:04 p.m.
On Wed, Apr 13, 2011 at 1:43 PM, Anthony Liguori <aliguori@us.ibm.com> wrote:
> diff --git a/roms/seabios b/roms/seabios
> index cc97564..06d0bdd 160000
> --- a/roms/seabios
> +++ b/roms/seabios
> @@ -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
Anthony Liguori - April 13, 2011, 1:18 p.m.
On 04/13/2011 08:04 AM, Stefan Hajnoczi wrote:
> On Wed, Apr 13, 2011 at 1:43 PM, Anthony Liguori<aliguori@us.ibm.com>  wrote:
>> diff --git a/roms/seabios b/roms/seabios
>> index cc97564..06d0bdd 160000
>> --- a/roms/seabios
>> +++ b/roms/seabios
>> @@ -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?

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

> Stefan

Patch

diff --git a/hw/milkymist-pfpu.c b/hw/milkymist-pfpu.c
index 4831e00..94e6315 100644
--- a/hw/milkymist-pfpu.c
+++ b/hw/milkymist-pfpu.c
@@ -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) {
diff --git a/roms/seabios b/roms/seabios
index cc97564..06d0bdd 160000
--- a/roms/seabios
+++ b/roms/seabios
@@ -1 +1 @@ 
-Subproject commit cc975646af69f279396d4d5e1379ac6af80ee637
+Subproject commit 06d0bdd9e2e20377b3180e4986b14c8549b393e4