[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: |
Sai Pavan Boddu |
Subject: |
Re: [Qemu-devel] [PATCH V2] sdhci: use PRIx64 for uint64_t type |
Date: |
Sun, 6 Sep 2015 17:41:24 +0000 |
> -----Original Message-----
> From: Eric Blake [mailto:address@hidden
> Sent: Saturday, September 05, 2015 6:12 PM
> To: Sai Pavan Boddu; address@hidden;
> address@hidden; address@hidden
> Cc: Sai Pavan Boddu; Edgar Iglesias; Alistair Francis
> Subject: Re: [Qemu-devel] [PATCH V2] sdhci: use PRIx64 for uint64_t type
>
> 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.
[Sai Pavan ] Yeah, never thought about this. Your suggestion will help in
preventing many issue like the same. I will fix this!!
Thanks,
Sai Pavan.
>
>
> --
> Eric Blake eblake redhat com +1-919-301-3266
> Libvirt virtualization library http://libvirt.org