[coreboot-gerrit] New patch to review for coreboot: intel/skylake: Init variable so GCC knows it's set

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Thu Jan 7 23:36:08 CET 2016


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12860

-gerrit

commit d86365d810f0f4326ad513470034016befbe79e9
Author: Martin Roth <martinroth at google.com>
Date:   Thu Jan 7 15:35:45 2016 -0700

    intel/skylake: Init variable so GCC knows it's set
    
    Even though the data32 variable was getting written by
    pch_pcr_read(), GCC still flagged it as being used while
    uninitialized and failed the build.
    
    Change-Id: Icd6e80d06b9bf4af506d62d55ffe4c5e98634b2b
    Signed-off-by: Martin Roth <martinroth at google.com>
---
 src/soc/intel/skylake/pcr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/soc/intel/skylake/pcr.c b/src/soc/intel/skylake/pcr.c
index 7efbb25..9c5a5a2 100644
--- a/src/soc/intel/skylake/pcr.c
+++ b/src/soc/intel/skylake/pcr.c
@@ -158,7 +158,7 @@ static int pcr_and_then_or(u8 pid, u16 offset, u32 size, u32 anddata,
 		   u32 ordata)
 {
 	u8 status;
-	u32 data32;
+	u32 data32 = 0;
 
 	status = pch_pcr_read(pid, offset, size, &data32);
 	if (status != 0)



More information about the coreboot-gerrit mailing list