From 67263b33af9506d78558b1edfa5a9bf976dc7b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sat, 22 Aug 2020 20:09:49 +0200 Subject: util/hexdump: Convert to take a void pointer argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Most uses of qemu_hexdump() do not take an array of char as input, forcing use of cast. Since we can use this helper to dump any kind of buffer, use a pointer to void argument instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Edgar E. Iglesias Reviewed-by: Li Qiang Reviewed-by: Stefano Garzarella Message-Id: <20200822180950.1343963-2-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- hw/sd/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/sd') diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 483c4f1..1c8f852 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1785,7 +1785,7 @@ send_response: } #ifdef DEBUG_SD - qemu_hexdump((const char *)response, stderr, "Response", rsplen); + qemu_hexdump(response, stderr, "Response", rsplen); #endif return rsplen; -- cgit v1.1 From b42581f5bb40489cb172829e9ab0d6d6dfa37026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sat, 22 Aug 2020 20:09:50 +0200 Subject: util/hexdump: Reorder qemu_hexdump() arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Reviewed-by: Stefano Garzarella Message-Id: <20200822180950.1343963-3-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- hw/sd/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/sd') diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 1c8f852..0012882 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1785,7 +1785,7 @@ send_response: } #ifdef DEBUG_SD - qemu_hexdump(response, stderr, "Response", rsplen); + qemu_hexdump(stderr, "Response", response, rsplen); #endif return rsplen; -- cgit v1.1