[Qemu-devel] [PATCH v3 04/12] sdcard: replace fprintf() by qemu_hexdump()

Philippe Mathieu-Daudé posted 12 patches 8 years ago
There is a newer version of this series
[Qemu-devel] [PATCH v3 04/12] sdcard: replace fprintf() by qemu_hexdump()
Posted by Philippe Mathieu-Daudé 8 years ago
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/sd/sd.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 3590099ce8..03263e08ae 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -44,13 +44,6 @@
 
 //#define DEBUG_SD 1
 
-#ifdef DEBUG_SD
-#define DPRINTF(fmt, ...) \
-do { fprintf(stderr, "SD: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) do {} while(0)
-#endif
-
 #define ACMD41_ENQUIRY_MASK     0x00ffffff
 #define OCR_POWER_UP            0x80000000
 #define OCR_POWER_DELAY_NS      500000 /* 0.5ms */
@@ -1630,13 +1623,7 @@ send_response:
     }
 
 #ifdef DEBUG_SD
-    if (rsplen) {
-        int i;
-        DPRINTF("Response:");
-        for (i = 0; i < rsplen; i++)
-            fprintf(stderr, " %02x", response[i]);
-        fputc('\n', stderr);
-    }
+    qemu_hexdump((const char *)response, stderr, "Response", rsplen);
 #endif
 
     return rsplen;
-- 
2.15.1


Re: [Qemu-devel] [PATCH v3 04/12] sdcard: replace fprintf() by qemu_hexdump()
Posted by Alistair Francis 8 years ago
On Mon, Jan 22, 2018 at 7:21 PM, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>

Alistair

> ---
>  hw/sd/sd.c | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
>
> diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> index 3590099ce8..03263e08ae 100644
> --- a/hw/sd/sd.c
> +++ b/hw/sd/sd.c
> @@ -44,13 +44,6 @@
>
>  //#define DEBUG_SD 1
>
> -#ifdef DEBUG_SD
> -#define DPRINTF(fmt, ...) \
> -do { fprintf(stderr, "SD: " fmt , ## __VA_ARGS__); } while (0)
> -#else
> -#define DPRINTF(fmt, ...) do {} while(0)
> -#endif
> -
>  #define ACMD41_ENQUIRY_MASK     0x00ffffff
>  #define OCR_POWER_UP            0x80000000
>  #define OCR_POWER_DELAY_NS      500000 /* 0.5ms */
> @@ -1630,13 +1623,7 @@ send_response:
>      }
>
>  #ifdef DEBUG_SD
> -    if (rsplen) {
> -        int i;
> -        DPRINTF("Response:");
> -        for (i = 0; i < rsplen; i++)
> -            fprintf(stderr, " %02x", response[i]);
> -        fputc('\n', stderr);
> -    }
> +    qemu_hexdump((const char *)response, stderr, "Response", rsplen);
>  #endif
>
>      return rsplen;
> --
> 2.15.1
>
>