Stefan Reinauer has uploaded this change for review. ( https://review.coreboot.org/c/em100/+/48598 )
Change subject: trace/console: factor out error handling ......................................................................
trace/console: factor out error handling
Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org Change-Id: I313dc6d3433921af38a7deea810dc51a45572ea6 --- M em100.c 1 file changed, 5 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/98/48598/1
diff --git a/em100.c b/em100.c index ca6e683..4b0a121 100644 --- a/em100.c +++ b/em100.c @@ -1233,14 +1233,14 @@ printf(". Press CTL-C to exit.\n\n");
while (!exit_requested && usb_errors < MAX_USB_ERRORS) { + int ret; if (trace) { - if (!read_spi_trace(em100, terminal, - address_offset)) - usb_errors++; + ret = read_spi_trace(em100, terminal, address_offset); } else { - if (!read_spi_terminal(em100, 0)) - usb_errors++; + ret = read_spi_terminal(em100, 0); } + if (ret == 0) + usb_errors++; } if (usb_errors >= MAX_USB_ERRORS) printf("Error: Bailed out with too many USB errors.\n");
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/em100/+/48598 )
Change subject: trace/console: factor out error handling ......................................................................
Patch Set 1: Code-Review+2
Stefan Reinauer has submitted this change. ( https://review.coreboot.org/c/em100/+/48598 )
Change subject: trace/console: factor out error handling ......................................................................
trace/console: factor out error handling
Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org Change-Id: I313dc6d3433921af38a7deea810dc51a45572ea6 Reviewed-on: https://review.coreboot.org/c/em100/+/48598 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M em100.c 1 file changed, 5 insertions(+), 5 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/em100.c b/em100.c index c4b6c01..ffed4d7 100644 --- a/em100.c +++ b/em100.c @@ -1233,14 +1233,14 @@ printf(". Press CTL-C to exit.\n\n");
while (!exit_requested && usb_errors < MAX_USB_ERRORS) { + int ret; if (trace) { - if (!read_spi_trace(em100, terminal, - address_offset)) - usb_errors++; + ret = read_spi_trace(em100, terminal, address_offset); } else { - if (!read_spi_terminal(em100, 0)) - usb_errors++; + ret = read_spi_terminal(em100, 0); } + if (ret == 0) + usb_errors++; } if (usb_errors >= MAX_USB_ERRORS) printf("Error: Bailed out with too many USB errors.\n");