[coreboot-gerrit] Patch set updated for coreboot: intel/skylake: Init variable so GCC knows it's set

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Fri Jan 8 02:48:25 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 1c8543f01f90b853844882c56afbe637ddd66c66
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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/soc/intel/skylake/pcr.c b/src/soc/intel/skylake/pcr.c
index 7efbb25..0900510 100644
--- a/src/soc/intel/skylake/pcr.c
+++ b/src/soc/intel/skylake/pcr.c
@@ -63,6 +63,7 @@ static int pch_pcr_read(u8 pid, u16 offset, u32 size, void *data)
 		*(u8 *) data = read8(pcr_reg_address(pid, offset));
 		break;
 	default:
+        	return -1;
 		break;
 	}
 	return 0;
@@ -158,7 +159,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