qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V2] sdhci: use PRIx64 for uint64_t type


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH V2] sdhci: use PRIx64 for uint64_t type
Date: Sat, 5 Sep 2015 06:41:33 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

On 09/05/2015 03:12 AM, Sai Pavan Boddu wrote:
> Fix compile time warnings, because of type mismatch for unsigned long
> long type.
> 
> Signed-off-by: Sai Pavan Boddu <address@hidden>
> ---
> Changes for V2:
>     Fix commit message.
>     Correct line lenght.
> ---

> +#include <inttypes.h>
>  #include "hw/hw.h"
>  #include "sysemu/block-backend.h"
>  #include "sysemu/blockdev.h"
> @@ -719,7 +720,8 @@ static void sdhci_do_adma(SDHCIState *s)
>              break;
>          case SDHC_ADMA_ATTR_ACT_LINK:   /* link to next descriptor table */
>              s->admasysaddr = dscr.addr;
> -            DPRINT_L1("ADMA link: admasysaddr=0x%lx\n", s->admasysaddr);
> +            DPRINT_L1("ADMA link: admasysaddr=0x%" PRIx64 "\n",
> +                      s->admasysaddr);

Please also fix the real problem. This sort of bitrot will keep
occurring unless DPRINT_L1() is fixed to unconditionally compile its
arguments.  In other words, do something like:

#define DPRINT_L1(fmt, ...) \
    do { \
        if (SDHC_DEBUG) { \
            fprintf(stderr, "QEMU SDHC: " fmt, ##__VA_ARGS__); \
        } \
    } while (0)
#define DPRINT_L2(fmt, ...) \
    do { \
        if (SDHC_DEBUG > 1) { \
            fprintf(stderr, "QEMU SDHC: " fmt, ##__VA_ARGS__); \
        } \
    } while (0)
#define ERRPRINT(fmt, ...) \
    do {
        if (SDHC_DEBUG) { \
            fprintf(stderr, "QEMU SDHC ERROR: " fmt, ##__VA_ARGS__); \
        } \
    } while (0)

rather than the current junk that eliminates the fprintf entirely when
SDHC_DEBUG is at its default of 0.


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]