mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-30 21:42:06 -06:00
s390x/pci: make printf always compile in debug output
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 <g.danil.anto@gmail.com> Message-Id: <CA+KKJYBi31Bs7DtVdzZdwG2t+u5+FGiAhQpd3pqJzUX1O8Cprg@mail.gmail.com> [CH: remove now misleading comments] Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
parent
08564ecd4d
commit
229913f0ef
2 changed files with 18 additions and 14 deletions
|
@ -23,15 +23,17 @@
|
||||||
#include "hw/pci/msi.h"
|
#include "hw/pci/msi.h"
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
|
|
||||||
/* #define DEBUG_S390PCI_BUS */
|
#ifndef DEBUG_S390PCI_BUS
|
||||||
#ifdef DEBUG_S390PCI_BUS
|
#define DEBUG_S390PCI_BUS 0
|
||||||
#define DPRINTF(fmt, ...) \
|
|
||||||
do { fprintf(stderr, "S390pci-bus: " fmt, ## __VA_ARGS__); } while (0)
|
|
||||||
#else
|
|
||||||
#define DPRINTF(fmt, ...) \
|
|
||||||
do { } while (0)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define DPRINTF(fmt, ...) \
|
||||||
|
do { \
|
||||||
|
if (DEBUG_S390PCI_BUS) { \
|
||||||
|
fprintf(stderr, "S390pci-bus: " fmt, ## __VA_ARGS__); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
S390pciState *s390_get_phb(void)
|
S390pciState *s390_get_phb(void)
|
||||||
{
|
{
|
||||||
static S390pciState *phb;
|
static S390pciState *phb;
|
||||||
|
|
|
@ -20,15 +20,17 @@
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
#include "sysemu/hw_accel.h"
|
#include "sysemu/hw_accel.h"
|
||||||
|
|
||||||
/* #define DEBUG_S390PCI_INST */
|
#ifndef DEBUG_S390PCI_INST
|
||||||
#ifdef DEBUG_S390PCI_INST
|
#define DEBUG_S390PCI_INST 0
|
||||||
#define DPRINTF(fmt, ...) \
|
|
||||||
do { fprintf(stderr, "s390pci-inst: " fmt, ## __VA_ARGS__); } while (0)
|
|
||||||
#else
|
|
||||||
#define DPRINTF(fmt, ...) \
|
|
||||||
do { } while (0)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define DPRINTF(fmt, ...) \
|
||||||
|
do { \
|
||||||
|
if (DEBUG_S390PCI_INST) { \
|
||||||
|
fprintf(stderr, "s390pci-inst: " fmt, ## __VA_ARGS__); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
static void s390_set_status_code(CPUS390XState *env,
|
static void s390_set_status_code(CPUS390XState *env,
|
||||||
uint8_t r, uint64_t status_code)
|
uint8_t r, uint64_t status_code)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue