David Hendricks has uploaded this change for review. ( https://review.coreboot.org/20937
Change subject: ich_descriptors: Fix off-by-one error
......................................................................
ich_descriptors: Fix off-by-one error
The "number of masters" (NM) reflects the value that begins at 1. This
value is compared with the constant MAX_NUM_MASTERS, which also begins
with 1. So we really do want the raw value of NM to be used in the
comparison. This fixes problems that arise when the actual NM value and
MAX_NUM_MASTERS are equal.
Also, the return value then gets used as an upper limit for for loops
with counters beginning at 0. So adding 1 to the return value makes it
even more wrong than it was before.
Change-Id: I92627332265cf79720b98241d73bc36b1f6a7167
Signed-off-by: David Hendricks <dhendricks(a)fb.com>
---
M ich_descriptors.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/37/20937/1
diff --git a/ich_descriptors.c b/ich_descriptors.c
index a2f8edf..542e1ec 100644
--- a/ich_descriptors.c
+++ b/ich_descriptors.c
@@ -66,8 +66,8 @@
ssize_t ich_number_of_masters(const enum ich_chipset cs, const struct ich_desc_content *const cont)
{
- if (cont->NM < MAX_NUM_MASTERS)
- return cont->NM + 1;
+ if (cont->NM <= MAX_NUM_MASTERS)
+ return cont->NM;
else
return -1;
}
--
To view, visit https://review.coreboot.org/20937
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: newchange
Gerrit-Change-Id: I92627332265cf79720b98241d73bc36b1f6a7167
Gerrit-Change-Number: 20937
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/20923 )
Change subject: chipset_enable: Mark Braswell as tested
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://review.coreboot.org/20923
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: comment
Gerrit-Change-Id: Iaf7558af8737af36401f577ca7aba9fd7114a3df
Gerrit-Change-Number: 20923
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Stefan Tauner <stefan.tauner(a)gmx.at>
Gerrit-Comment-Date: Wed, 09 Aug 2017 06:57:54 +0000
Gerrit-HasComments: No
David Hendricks has removed Stefan Tauner from this change. ( https://review.coreboot.org/20923 )
Change subject: chipset_enable: Mark Braswell as tested
......................................................................
Removed reviewer Stefan Tauner.
--
To view, visit https://review.coreboot.org/20923
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: deleteReviewer
Gerrit-Change-Id: Iaf7558af8737af36401f577ca7aba9fd7114a3df
Gerrit-Change-Number: 20923
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>