sim: mips: fix uninitialized register use
authorMike Frysinger <vapier@gentoo.org>
Tue, 15 Jun 2021 04:39:28 +0000 (00:39 -0400)
committerMike Frysinger <vapier@gentoo.org>
Wed, 16 Jun 2021 05:51:32 +0000 (01:51 -0400)
In the default case, this code will read from this variable before
it is initialized as a dummy access.  Set it to 0 to fix the compiler
warning.

sim/mips/ChangeLog
sim/mips/dv-tx3904irc.c

index fcc8ab347033be46eb2c8fe71f62b495dc2a0ed9..1e57fe54326ea41bceda20a6ad29bf7379039a42 100644 (file)
@@ -1,3 +1,8 @@
+2021-06-16  Mike Frysinger  <vapier@gentoo.org>
+
+       * dv-tx3904irc.c (tx3904irc_io_write_buffer): Initialize
+       register_value to 0.
+
 2021-06-16  Mike Frysinger  <vapier@gentoo.org>
 
        * configure: Regenerate.
index 0896b0fabb0b0c91fb92ec6de5d3ee2a37d8979b..6fbe61c7f548ad52da7676585005de3cc0284326 100644 (file)
@@ -381,7 +381,7 @@ tx3904irc_io_write_buffer (struct hw *me,
       int reg_number = (address - controller->base_address) / 4;
       int reg_offset = (address - controller->base_address) % 4;
       unsigned_4* register_ptr;
-      unsigned_4 register_value;
+      unsigned_4 register_value = 0;
 
       /* fill in entire register_value word */
       switch (reg_number)