diff options
author | Rouven Czerwinski <r.czerwinski@pengutronix.de> | 2019-06-25 09:31:46 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-06-27 11:14:23 +0200 |
commit | e7c33540d0c092c28b227d4b7602cef8ab203ef3 (patch) | |
tree | 314c19e65d5b0115a366473df8c795497620036a | |
parent | 3c226c7dde1f293d67662faaea0fe95af0d6f6ea (diff) | |
download | barebox-e7c33540d0c092c28b227d4b7602cef8ab203ef3.tar.gz barebox-e7c33540d0c092c28b227d4b7602cef8ab203ef3.tar.xz |
i.MX: HABv4: Reset index variable after error type
The index variable is used for each error type, it should be reset to 0
before retrieving the next error status, otherwise error messages are
skipped if the preceding error type incremented index.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/hab/habv4.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c index 496fbe3ccd..844fafed27 100644 --- a/drivers/hab/habv4.c +++ b/drivers/hab/habv4.c @@ -469,6 +469,7 @@ static int habv4_get_status(const struct habv4_rvt *rvt) } len = sizeof(data); + index = 0; while (rvt->report_event(HAB_STATUS_FAILURE, index, data, &len) == HAB_STATUS_SUCCESS) { pr_err("-------- HAB failure Event %d --------\n", index); pr_err("event data:\n"); @@ -480,6 +481,7 @@ static int habv4_get_status(const struct habv4_rvt *rvt) /* Check reason for stopping */ len = sizeof(data); + index = 0; if (rvt->report_event(HAB_STATUS_ANY, index, NULL, &len) == HAB_STATUS_SUCCESS) pr_err("ERROR: Recompile with larger event data buffer (at least %d bytes)\n\n", len); |