[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/11] s390x/kvm: make printf always compile in debug
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 02/11] s390x/kvm: make printf always compile in debug output |
Date: |
Fri, 21 Apr 2017 09:40:29 +0200 |
From: Danil Antonov <address@hidden>
Wrapped printf calls inside debug macros (DPRINTF) in `if` statement.
This will ensure that printf function will always compile even if debug
output is turned off and, in turn, will prevent bitrot of the format
strings.
Signed-off-by: Danil Antonov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
target/s390x/kvm.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index ac47154b83..1a249d8359 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -47,16 +47,16 @@
#include "exec/memattrs.h"
#include "hw/s390x/s390-virtio-ccw.h"
-/* #define DEBUG_KVM */
-
-#ifdef DEBUG_KVM
-#define DPRINTF(fmt, ...) \
- do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
- do { } while (0)
+#ifndef DEBUG_KVM
+#define DEBUG_KVM 0
#endif
+#define DPRINTF(fmt, ...) do { \
+ if (DEBUG_KVM) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
+
#define kvm_vm_check_mem_attr(s, attr) \
kvm_vm_check_attr(s, KVM_S390_VM_MEM_CTRL, attr)
--
2.11.0
- [Qemu-devel] [PULL 00/11] s390x patches for 2.10, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 01/11] s390x: introduce 2.10 compat machine, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 02/11] s390x/kvm: make printf always compile in debug output,
Cornelia Huck <=
- [Qemu-devel] [PULL 03/11] s390x/pci: make printf always compile in debug output, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 07/11] s390x: use enum for adapter type and standardize its naming, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 04/11] s390x/css: introduce read-only property type for device ids, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 06/11] s390x/css: consolidate the devno property for ccw devices, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 10/11] s390x: register I/O adapters per ISC during init, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 05/11] s390x/css: provide introspection for virtual subchannel and device busid, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 08/11] s390x: initialize flic before I/O subsystems, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 09/11] s390x/flic: cache flic in s390_get_flic, Cornelia Huck, 2017/04/21
- [Qemu-devel] [PULL 11/11] s390x: Drop useless casts, Cornelia Huck, 2017/04/21
- Re: [Qemu-devel] [PULL 00/11] s390x patches for 2.10, Peter Maydell, 2017/04/21