summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2016-05-04 05:55:02 (GMT)
committerchrome-bot <chrome-bot@chromium.org>2016-10-20 00:50:09 (GMT)
commitbc955768e284824b7a8f790873481979e2802787 (patch)
tree31f41716c47064b5ab6f52bd717189fa538cf17e /src
parent020010d103f37e0c5fdb9e5b960eb1bbdc5b91e4 (diff)
downloaddepthcharge-bc955768e284824b7a8f790873481979e2802787.tar.gz
depthcharge-bc955768e284824b7a8f790873481979e2802787.tar.xz
cros_ec: Use standard hexdump() instead of home-grown dumper
It also shows an ASCII representation, which can be useful. Since hexdump doesn't stop at exactly the given byte count, also emit the length of the segment. BUG=none BRANCH=none TEST=none Change-Id: Ica8532f27479eaff4491bd61ee799ee4ae148852 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: https://chromium-review.googlesource.com/342362 Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/ec/cros/ec.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/drivers/ec/cros/ec.c b/src/drivers/ec/cros/ec.c
index 9523057..9afbd51 100644
--- a/src/drivers/ec/cros/ec.c
+++ b/src/drivers/ec/cros/ec.c
@@ -54,14 +54,12 @@ void cros_ec_dump_data(const char *name, int cmd, const void *data, int len)
{
#ifdef DEBUG
const uint8_t *bytes = data;
- int i;
printf("%s: ", name);
if (cmd != -1)
printf("cmd=%#x: ", cmd);
- for (i = 0; i < len; i++)
- printf("%02x ", bytes[i]);
- printf("\n");
+ printf(" (%d/0x%x bytes)\n", len, len);
+ hexdump(bytes, len);
#endif
}