[coreboot-gerrit] Change in coreboot[master]: kbc1126_ec_dump: fix signed integer error

Iru Cai (Code Review) gerrit at coreboot.org
Tue Aug 15 09:00:41 CEST 2017


Iru Cai has uploaded this change for review. ( https://review.coreboot.org/21013


Change subject: kbc1126_ec_dump: fix signed integer error
......................................................................

kbc1126_ec_dump: fix signed integer error

The error is found when using kbc1126_ec_dump on coreboot.rom which
uses different EC firmware offsets from vendor firmware.

Change-Id: Iacc4ea50515ea219bc1868dae0446d576e8dce0c
Signed-off-by: Iru Cai <mytbk920423 at gmail.com>
---
M util/kbc1126/kbc1126_ec_dump.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/21013/1

diff --git a/util/kbc1126/kbc1126_ec_dump.c b/util/kbc1126/kbc1126_ec_dump.c
index 7470012..cfa4b64 100644
--- a/util/kbc1126/kbc1126_ec_dump.c
+++ b/util/kbc1126/kbc1126_ec_dump.c
@@ -111,8 +111,8 @@
 	assert(offs[1] + offs[3] == '\xff');
 	assert(offs[4] + offs[6] == '\xff');
 	assert(offs[5] + offs[7] == '\xff');
-	long offw1 = (offs[0] << 16) | (offs[1] << 8);
-	long offw2 = (offs[4] << 16) | (offs[5] << 8);
+	long offw1 = ((offs[0] << 16) & 0xff0000) | ((offs[1] << 8) & 0xff00);
+	long offw2 = ((offs[4] << 16) & 0xff0000) | ((offs[5] << 8) & 0xff00);
 
 	dump_fw(fw1, fp, offw1);
 	dump_fw(fw2, fp, offw2);

-- 
To view, visit https://review.coreboot.org/21013
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iacc4ea50515ea219bc1868dae0446d576e8dce0c
Gerrit-Change-Number: 21013
Gerrit-PatchSet: 1
Gerrit-Owner: Iru Cai <mytbk920423 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170815/d72bb123/attachment.html>


More information about the coreboot-gerrit mailing list