Patch Set 3:

Patch Set 3: Code-Review+1

these checks are useful, but checking that index isn't <0 or >= MAX_NUM_ROOT_PORTS would probably be a good idea too

Yeah, I think these limits are guaranteed by the loops themselves though. I'll see how this would look like once deduplicated.

Being a static function, it's also easier to audit the inputs passed to it. Right now, I can see it's only called from for loops looping from 0 to rpc.num_ports (assuming that's initialized already by this point).

Patch set 3:Code-Review +2

View Change

To view, visit change 45715. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I381f3cbf5fd18c952622f757135c0bde9ed6ed0d
Gerrit-Change-Number: 45715
Gerrit-PatchSet: 3
Gerrit-Owner: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier@gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak@chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Comment-Date: Tue, 13 Oct 2020 15:28:15 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment