aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-08-22 20:09:50 +0200
committerLaurent Vivier <laurent@vivier.eu>2020-09-11 21:25:59 +0200
commitb42581f5bb40489cb172829e9ab0d6d6dfa37026 (patch)
tree53386cbc9808337c4bcc4d902f16f86942254271 /util
parent67263b33af9506d78558b1edfa5a9bf976dc7b3d (diff)
util/hexdump: Reorder qemu_hexdump() arguments
qemu_hexdump()'s pointer to the buffer and length of the buffer are closely related arguments but are widely separated in the argument list order (also, the format of <stdio.h> function prototypes is usually to have the FILE* argument coming first). Reorder the arguments as "fp, prefix, buf, size" which is more logical. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Message-Id: <20200822180950.1343963-3-f4bug@amsat.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'util')
-rw-r--r--util/hexdump.c4
-rw-r--r--util/iov.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/util/hexdump.c b/util/hexdump.c
index 053f05d416..0b4662e701 100644
--- a/util/hexdump.c
+++ b/util/hexdump.c
@@ -16,8 +16,8 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
-void qemu_hexdump(const void *bufptr, FILE *fp,
- const char *prefix, size_t size)
+void qemu_hexdump(FILE *fp, const char *prefix,
+ const void *bufptr, size_t size)
{
const char *buf = bufptr;
unsigned int b, len, i, c;
diff --git a/util/iov.c b/util/iov.c
index 45ef3043ee..ae61d696aa 100644
--- a/util/iov.c
+++ b/util/iov.c
@@ -237,7 +237,7 @@ void iov_hexdump(const struct iovec *iov, const unsigned int iov_cnt,
size = size > limit ? limit : size;
buf = g_malloc(size);
iov_to_buf(iov, iov_cnt, 0, buf, size);
- qemu_hexdump(buf, fp, prefix, size);
+ qemu_hexdump(fp, prefix, buf, size);
g_free(buf);
}