[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/3] vfio-ccw: switch to warn_report_once_cond()
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PATCH 3/3] vfio-ccw: switch to warn_report_once_cond() |
Date: |
Tue, 28 Aug 2018 14:33:46 +0200 |
We can replace the local function with the new common interface.
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/vfio/ccw.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
index e96bbdc78b..9246729a75 100644
--- a/hw/vfio/ccw.c
+++ b/hw/vfio/ccw.c
@@ -37,24 +37,12 @@ typedef struct VFIOCCWDevice {
bool warned_orb_pfch;
} VFIOCCWDevice;
-static inline void warn_once(bool *warned, const char *fmt, ...)
-{
- va_list ap;
-
- if (!warned || *warned) {
- return;
- }
- *warned = true;
- va_start(ap, fmt);
- warn_vreport(fmt, ap);
- va_end(ap);
-}
-
static inline void warn_once_pfch(VFIOCCWDevice *vcdev, SubchDev *sch,
const char *msg)
{
- warn_once(&vcdev->warned_orb_pfch, "vfio-ccw (devno %x.%x.%04x): %s",
- sch->cssid, sch->ssid, sch->devno, msg);
+ warn_report_once_cond(&vcdev->warned_orb_pfch,
+ "vfio-ccw (devno %x.%x.%04x): %s",
+ sch->cssid, sch->ssid, sch->devno, msg);
}
static void vfio_ccw_compute_needs_reset(VFIODevice *vdev)
--
2.14.4