From: Rouven Czerwinski <r.czerwinski@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Subject: [PATCH 2/2] i.MX: HABv4: Reset index variable after error type
Date: Tue, 25 Jun 2019 09:31:46 +0200 [thread overview]
Message-ID: <20190625073146.26639-2-r.czerwinski@pengutronix.de> (raw)
In-Reply-To: <20190625073146.26639-1-r.czerwinski@pengutronix.de>
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>
---
drivers/hab/habv4.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c
index 2e3e349b0b..6a60be6853 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);
--
2.22.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2019-06-25 7:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-25 7:31 [PATCH 1/2] i.MX: HABv4: use min_t instead of min Rouven Czerwinski
2019-06-25 7:31 ` Rouven Czerwinski [this message]
2019-06-26 7:03 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190625073146.26639-2-r.czerwinski@pengutronix.de \
--to=r.czerwinski@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox