aboutsummaryrefslogtreecommitdiff
path: root/hdata/hdif.c
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2017-01-06 11:42:06 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-01-10 14:17:43 +1100
commit8993ea78c27e6ebf5ac503cb23ed9b39abfc3490 (patch)
treec2e6b1809c95081c4a22f685da942a415ac7390d /hdata/hdif.c
parent6e1eb06aadd6a59caa75c4ceeec99f07918d57ce (diff)
downloadskiboot-8993ea78c27e6ebf5ac503cb23ed9b39abfc3490.zip
skiboot-8993ea78c27e6ebf5ac503cb23ed9b39abfc3490.tar.gz
skiboot-8993ea78c27e6ebf5ac503cb23ed9b39abfc3490.tar.bz2
hdat: make HDIF_child() print more useful errors
The HDAT has very fixed relationships between a parent and child structures. When parsing the HDAT we always know what type of child that we expect and we will error out if there is a mismatch between what we get and what expect. This patch just prints out what we got in addition to what we expected to help with debugging. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata/hdif.c')
-rw-r--r--hdata/hdif.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hdata/hdif.c b/hdata/hdif.c
index 25c0000..62ba69f 100644
--- a/hdata/hdif.c
+++ b/hdata/hdif.c
@@ -131,8 +131,8 @@ struct HDIF_common_hdr *HDIF_child(const struct HDIF_common_hdr *hdif,
ret = base + be32_to_cpu(child->offset)
+ be32_to_cpu(child->size) * idx;
if (!HDIF_check(ret, eyecatcher)) {
- prerror("HDIF: %s child #%i bad type\n",
- eyecatcher, idx);
+ prerror("HDIF: #%i bad type (wanted %6s, got %6s)\n",
+ idx, eyecatcher, ret->id);
return NULL;
}