Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/c/em100/+/58427 )
Change subject: trace: Avoid propagating unintended sign extension ......................................................................
trace: Avoid propagating unintended sign extension
The alternative would be to add casts to unsigned types in the preceding statements (pretty much everywhere), so this seems like the easier approach.
Signed-off-by: Patrick Georgi pgeorgi@google.com Change-Id: I1dba945ce86fc6a080725fd2f913abbbbc10191e --- M trace.c 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/27/58427/1
diff --git a/trace.c b/trace.c index c04afcc..038488a 100644 --- a/trace.c +++ b/trace.c @@ -275,6 +275,9 @@ + (data[i * 8 + 7] << 8) + data[i * 8 + 8];
+ /* truncate any potential sign extension */ + address &= 0xffffffff; + /* skip address bytes and padding */ j += address_bytes + spi_cmd_vals->pad_bytes;