diff mbox series

[01/18] chardev: Move PARALLEL_CHARDEV macro to common code

Message ID 20200910194903.4104696-2-ehabkost@redhat.com
State New
Headers show
Series chardev: QOM cleanups | expand

Commit Message

Eduardo Habkost Sept. 10, 2020, 7:48 p.m. UTC
The macro is exactly the same for both Linux and BSD, so move its
definition outside the host OS #ifdef blocks.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 chardev/char-parallel.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/chardev/char-parallel.c b/chardev/char-parallel.c
index 05e7efbd6c..390d03506c 100644
--- a/chardev/char-parallel.c
+++ b/chardev/char-parallel.c
@@ -47,6 +47,9 @@ 
 #include "chardev/char-fd.h"
 #include "chardev/char-parallel.h"
 
+#define PARALLEL_CHARDEV(obj) \
+    OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL)
+
 #if defined(__linux__)
 
 typedef struct {
@@ -55,9 +58,6 @@  typedef struct {
     int mode;
 } ParallelChardev;
 
-#define PARALLEL_CHARDEV(obj) \
-    OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL)
-
 static int pp_hw_mode(ParallelChardev *s, uint16_t mode)
 {
     if (s->mode != mode) {
@@ -182,9 +182,6 @@  typedef struct {
     int fd;
 } ParallelChardev;
 
-#define PARALLEL_CHARDEV(obj)                                   \
-    OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL)
-
 static int pp_ioctl(Chardev *chr, int cmd, void *arg)
 {
     ParallelChardev *drv = PARALLEL_CHARDEV(chr);