summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2018-03-01 11:57:50 +1030
committerAndrew Jeffery <andrew@aj.id.au>2018-03-19 10:56:03 +1030
commitee7af88352486863cbf046886c5e3493bd024766 (patch)
treec71ca4e1ff6116f864361431ce3e626d3392b060
parentc3144042b9f050c3d880f4ae5464a2a21617fe7d (diff)
downloadphosphor-mboxd-ee7af88352486863cbf046886c5e3493bd024766.tar.gz
phosphor-mboxd-ee7af88352486863cbf046886c5e3493bd024766.zip
test: mbox: Type buf parameter to dump_buf() as `const void *`
This makes it a bit more ergonomic to use by not forcing the caller to cast. Change-Id: I5d40715f4de84f174157a39d459dc1b40a94a949 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
-rw-r--r--test/mbox.c5
-rw-r--r--test/mbox.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/test/mbox.c b/test/mbox.c
index 6fe7277..c3b3574 100644
--- a/test/mbox.c
+++ b/test/mbox.c
@@ -39,8 +39,9 @@
#define STEP 16
-void dump_buf(const uint8_t *buf, size_t len)
+void dump_buf(const void *buf, size_t len)
{
+ const uint8_t *buf8 = buf;
int i;
for (i = 0; i < len; i += STEP) {
@@ -53,7 +54,7 @@ void dump_buf(const uint8_t *buf, size_t len)
printf("0x%08x:\t", i);
for (j = 0; j < max; j++)
- printf("0x%02x, ", buf[i + j]);
+ printf("0x%02x, ", buf8[i + j]);
printf("\n");
}
diff --git a/test/mbox.h b/test/mbox.h
index 0eef28c..929ca22 100644
--- a/test/mbox.h
+++ b/test/mbox.h
@@ -44,6 +44,6 @@ int mbox_command_dispatch(struct mbox_context *context, const uint8_t *command,
size_t len);
/* Helpers */
-void dump_buf(const uint8_t *buf, size_t len);
+void dump_buf(const void *buf, size_t len);
#endif /* TEST_MBOX_H */
OpenPOWER on IntegriCloud