diff mbox

[10/38] ivshmem: Compile debug prints unconditionally to prevent bit-rot

Message ID 1456771254-17511-11-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster Feb. 29, 2016, 6:40 p.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/misc/ivshmem.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Marc-André Lureau March 1, 2016, 12:22 p.m. UTC | #1
On Mon, Feb 29, 2016 at 7:40 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

(apparently, there are other places in qemu where this conversion could be done)

>  hw/misc/ivshmem.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
> index b74b02c..395f357 100644
> --- a/hw/misc/ivshmem.c
> +++ b/hw/misc/ivshmem.c
> @@ -48,13 +48,13 @@
>
>  #define IVSHMEM_REG_BAR_SIZE 0x100
>
> -//#define DEBUG_IVSHMEM
> -#ifdef DEBUG_IVSHMEM
> -#define IVSHMEM_DPRINTF(fmt, ...)        \
> -    do {printf("IVSHMEM: " fmt, ## __VA_ARGS__); } while (0)
> -#else
> -#define IVSHMEM_DPRINTF(fmt, ...)
> -#endif
> +#define IVSHMEM_DEBUG 0
> +#define IVSHMEM_DPRINTF(fmt, ...)                       \
> +    do {                                                \
> +        if (IVSHMEM_DEBUG) {                            \
> +            printf("IVSHMEM: " fmt, ## __VA_ARGS__);    \
> +        }                                               \
> +    } while (0)
>
>  #define TYPE_IVSHMEM "ivshmem"
>  #define IVSHMEM(obj) \
> --
> 2.4.3
>
>
Eric Blake March 1, 2016, 3:49 p.m. UTC | #2
On 03/01/2016 05:22 AM, Marc-André Lureau wrote:
> On Mon, Feb 29, 2016 at 7:40 PM, Markus Armbruster <armbru@redhat.com> wrote:
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
> 
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> (apparently, there are other places in qemu where this conversion could be done)

Yep. I try to flag them when I see someone touch one, but a global
search-and-replace would be a nice beginner's project.
Markus Armbruster March 2, 2016, 9:51 a.m. UTC | #3
Eric Blake <eblake@redhat.com> writes:

> On 03/01/2016 05:22 AM, Marc-André Lureau wrote:
>> On Mon, Feb 29, 2016 at 7:40 PM, Markus Armbruster <armbru@redhat.com> wrote:
>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>> ---
>> 
>> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> 
>> (apparently, there are other places in qemu where this conversion could be done)
>
> Yep. I try to flag them when I see someone touch one, but a global
> search-and-replace would be a nice beginner's project.

Would you like to add it http://wiki.qemu.org/BiteSizedTasks ?
Eric Blake March 2, 2016, 3:52 p.m. UTC | #4
On 03/02/2016 02:51 AM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
> 
>> On 03/01/2016 05:22 AM, Marc-André Lureau wrote:
>>> On Mon, Feb 29, 2016 at 7:40 PM, Markus Armbruster <armbru@redhat.com> wrote:
>>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>>> ---
>>>
>>> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>>>
>>> (apparently, there are other places in qemu where this conversion could be done)
>>
>> Yep. I try to flag them when I see someone touch one, but a global
>> search-and-replace would be a nice beginner's project.
> 
> Would you like to add it http://wiki.qemu.org/BiteSizedTasks ?
> 

Done.
diff mbox

Patch

diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index b74b02c..395f357 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -48,13 +48,13 @@ 
 
 #define IVSHMEM_REG_BAR_SIZE 0x100
 
-//#define DEBUG_IVSHMEM
-#ifdef DEBUG_IVSHMEM
-#define IVSHMEM_DPRINTF(fmt, ...)        \
-    do {printf("IVSHMEM: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define IVSHMEM_DPRINTF(fmt, ...)
-#endif
+#define IVSHMEM_DEBUG 0
+#define IVSHMEM_DPRINTF(fmt, ...)                       \
+    do {                                                \
+        if (IVSHMEM_DEBUG) {                            \
+            printf("IVSHMEM: " fmt, ## __VA_ARGS__);    \
+        }                                               \
+    } while (0)
 
 #define TYPE_IVSHMEM "ivshmem"
 #define IVSHMEM(obj) \