diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-09-22 11:08:19 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-09-26 09:23:22 +0200 |
commit | 9b9379eaf2407ac9fc913a476c74f52c785fc684 (patch) | |
tree | cf9bc093276476673c9f3cde52222ca5f5f5893e /scripts/imx | |
parent | 2096492765521d978968b4649da50f6ec56a143c (diff) | |
download | barebox-9b9379eaf2407ac9fc913a476c74f52c785fc684.tar.gz barebox-9b9379eaf2407ac9fc913a476c74f52c785fc684.tar.xz |
scripts: imx imx-usb-loader: Fix last transfer error message
When doing memory read transfers there will always be 64 bytes
transferred, even when less bytes are requested. This is expected
and there is a test skipping the error message in this case. The
test is wrong though since cnt is not decremented and will never
be equal to rem. Fix the test so that verifying memory does
not give a bogus error message.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts/imx')
-rw-r--r-- | scripts/imx/imx-usb-loader.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c index 499e8c8ec6..6052343e00 100644 --- a/scripts/imx/imx-usb-loader.c +++ b/scripts/imx/imx-usb-loader.c @@ -635,7 +635,7 @@ static int read_memory(unsigned addr, void *dest, unsigned cnt) break; } if ((last_trans > rem) || (last_trans > 64)) { - if ((last_trans == 64) && (cnt == rem)) { + if ((last_trans == 64) && (rem < 64)) { /* Last transfer is expected to be too large for HID */ } else { printf("err: %02x %02x %02x %02x cnt=%u rem=%d last_trans=%i\n", |