I'm okay with changing all the return codes to -1, but I'm not so sure about changing all the checks to only check for <0. As long as we don't have any valid responses >0, why not keep the old checks just to be safe? It makes for shorter code, too.

(Note that there is plenty of other precedent for using 1 instead of -1 as error returns in coreboot, e.g. plenty of platform_i2c_transfer() implementations. I'm worried that one of those might still have a chance to slip through into the EC code in some odd edge case we're overlooking.)

View Change

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I39f12502bc6982670dd200dcef0724e7eed2ed29
Gerrit-Change-Number: 31626
Gerrit-PatchSet: 1
Gerrit-Owner: YH Lin <yueherngl@google.com>
Gerrit-Reviewer: Aaron Durbin <adurbin@chromium.org>
Gerrit-Reviewer: Daisuke Nojiri <dnojiri@chromium.org>
Gerrit-Reviewer: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Reviewer: YH Lin <yueherngl@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Julius Werner <jwerner@chromium.org>
Gerrit-Comment-Date: Tue, 26 Feb 2019 21:55:56 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment