Lee Leahy has posted comments on this change. ( https://review.coreboot.org/19643 )
Change subject: drivers/storage: Fix array references
......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/19643/2/src/drivers/storage/storage.c
File src/drivers/storage/storage.c:
PS2, Line 77: ARRAY_SIZE(decimal_list) - 1
> Why is it minus 1? If the '1' entries don't matter remove them? And just ch
The less than ensures that index only references actual elements of the array. The minus one handles the case where capacity is zero and returns an index of (ARRAY_SIZE(array) - 1) which is the last element of the array with a divisor of 1 and units of bytes. This eliminates the need for special case code to handle the zero capacity case. Coverity should be happy now since all possible exits from the loop have a valid index value.
--
To view, visit https://review.coreboot.org/19643
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie5c96e78417b667438a00ee22c70894a00d13291
Gerrit-PatchSet: 2
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Lee Leahy <leroy.p.leahy(a)intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Lee Leahy <leroy.p.leahy(a)intel.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-HasComments: Yes
Patrick Georgi has uploaded a new change for review. ( https://review.coreboot.org/19660 )
Change subject: xcompile: Also try clang variants under the $triplet-clang scheme
......................................................................
xcompile: Also try clang variants under the $triplet-clang scheme
That seems to be the more reliable way to build clang cross compilers
for now.
Change-Id: I14fe767d20f91b64e96c909291760bddcd108e5c
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
M util/xcompile/xcompile
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/19660/1
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index 6986b53..3f6641d7 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -423,14 +423,16 @@
fi
for clang_arch in $TCLIST invalid; do
- testcc "${XGCCPATH}clang" "-target ${clang_arch}-$TABI -c" && break
+ for clang_prefix in $search $XGCCPATH ""; do
+ testcc "${clang_prefix}clang" "-target ${clang_arch}-$TABI -c" && break 2
+ done
done
if [ "invalid" != "$clang_arch" ]; then
# FIXME: this may break in a clang && !gcc configuration,
# but that's more of a clang limitation. Let's be optimistic
# that this will change in the future.
- CLANG="${XGCCPATH}clang"
+ CLANG="${clang_prefix}clang"
CFLAGS_CLANG="-target ${clang_arch}-${TABI} $CFLAGS_CLANG -ccc-gcc-name ${GCC}"
fi
}
--
To view, visit https://review.coreboot.org/19660
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I14fe767d20f91b64e96c909291760bddcd108e5c
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>