[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus. |
Date: |
Mon, 26 Nov 2012 15:45:09 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121025 Thunderbird/16.0.2 |
Am 26.11.2012 15:33, schrieb Anthony Liguori:
> address@hidden writes:
>> +#define DEBUG_VIRTIO_BUS 1
>> +
>> +#define DPRINTF(fmt, ...) if (DEBUG_VIRTIO_BUS) { \
>> + printf("virtio_bus: " fmt , ## __VA_ARGS__); \
>> + }
>
> #ifdef DEBUG_VIRTIO_BUS
> #define DPRINTF(fmt, ...) ...
> #else
> #define DPRINTF(fmt, ...) do { } while (0)
> #endif
>
> You're leaving a dangling if clause which can do very strange things if
> used before an else statement.
If you look at the change history, this was a change in a reaction to me
pointing to a proposal by Samsung. I see your point with the else
statement, that can be circumvented by adding else {}. The reason is to
avoid DPRINTF()s bitrotting because your "do { } while (0)" performs no
compile-tests on "fmt, ..." arguments.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., (continued)
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Andreas Färber, 2012/11/24
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Anthony Liguori, 2012/11/26
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Peter Maydell, 2012/11/26
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Anthony Liguori, 2012/11/26
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Konrad Frederic, 2012/11/29
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Peter Maydell, 2012/11/29
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Konrad Frederic, 2012/11/29
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Peter Maydell, 2012/11/29
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Andreas Färber, 2012/11/29
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Anthony Liguori, 2012/11/29
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.,
Andreas Färber <=
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Anthony Liguori, 2012/11/26
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Konrad Frederic, 2012/11/26
- Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus., Stefan Hajnoczi, 2012/11/26
[Qemu-devel] [RFC PATCH v2 3/3] virtio-blk : add the virtio-blk device., fred . konrad, 2012/11/22
Re: [Qemu-devel] [RFC PATCH v2 0/3] Virtio-refactoring., Peter Maydell, 2012/11/22
Re: [Qemu-devel] [RFC PATCH v2 0/3] Virtio-refactoring., Stefan Hajnoczi, 2012/11/23