Stefan Reinauer has uploaded this change for review. ( https://review.coreboot.org/c/em100/+/42571 )
Change subject: spi.c: Some fixes to the write_dfifo routine ......................................................................
spi.c: Some fixes to the write_dfifo routine
Change-Id: I25867012e644b825f0a352dacb20e9df3a0c0720 --- M spi.c 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/71/42571/1
diff --git a/spi.c b/spi.c index 1ac7004..c088a11 100644 --- a/spi.c +++ b/spi.c @@ -287,13 +287,13 @@ }
printf ("Transfer %s\n",bytes_sent == length ? "Succeeded" : "Failed"); - if (bytes_sent == length) + if (bytes_sent != length) printf("Warning: Sent %zd bytes, expected %zd\n", bytes_sent, length);
int len = get_response(em100->dev, data, 512);
- if (len == 1 && data[0] == length) { + if (len == 2 && (((size_t)data[0] << 8) | data[1]) == length) { return 1; } return 0;
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/em100/+/42571 )
Change subject: spi.c: Some fixes to the write_dfifo routine ......................................................................
Patch Set 1: Code-Review+2
(1 comment)
https://review.coreboot.org/c/em100/+/42571/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/em100/+/42571/1//COMMIT_MSG@7 PS1, Line 7: s spi.c: Fix logic errors in the `write_dfifo` routine
Hello build bot (Jenkins), Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/em100/+/42571
to look at the new patch set (#2).
Change subject: spi.c: Fix logic errors in write_dfifo function ......................................................................
spi.c: Fix logic errors in write_dfifo function
Change-Id: I25867012e644b825f0a352dacb20e9df3a0c0720 --- M spi.c 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/71/42571/2
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/em100/+/42571 )
Change subject: spi.c: Fix logic errors in write_dfifo function ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/em100/+/42571/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/em100/+/42571/1//COMMIT_MSG@7 PS1, Line 7: s
spi. […]
Done
Stefan Reinauer has submitted this change. ( https://review.coreboot.org/c/em100/+/42571 )
Change subject: spi.c: Fix logic errors in write_dfifo function ......................................................................
spi.c: Fix logic errors in write_dfifo function
Change-Id: I25867012e644b825f0a352dacb20e9df3a0c0720 Reviewed-on: https://review.coreboot.org/c/em100/+/42571 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M spi.c 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/spi.c b/spi.c index 1ac7004..c088a11 100644 --- a/spi.c +++ b/spi.c @@ -287,13 +287,13 @@ }
printf ("Transfer %s\n",bytes_sent == length ? "Succeeded" : "Failed"); - if (bytes_sent == length) + if (bytes_sent != length) printf("Warning: Sent %zd bytes, expected %zd\n", bytes_sent, length);
int len = get_response(em100->dev, data, 512);
- if (len == 1 && data[0] == length) { + if (len == 2 && (((size_t)data[0] << 8) | data[1]) == length) { return 1; } return 0;