diff mbox series

[02/18] chardev: Move ParallelChardev typedef to common code

Message ID 20200910194903.4104696-3-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 struct itself may have a different definition on each OS, but
we can define the typedef in common code, outside the host OS #ifdefs.

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

Patch

diff --git a/chardev/char-parallel.c b/chardev/char-parallel.c
index 390d03506c..e32aa2d226 100644
--- a/chardev/char-parallel.c
+++ b/chardev/char-parallel.c
@@ -47,16 +47,17 @@ 
 #include "chardev/char-fd.h"
 #include "chardev/char-parallel.h"
 
+typedef struct ParallelChardev ParallelChardev;
 #define PARALLEL_CHARDEV(obj) \
     OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL)
 
 #if defined(__linux__)
 
-typedef struct {
+struct ParallelChardev {
     Chardev parent;
     int fd;
     int mode;
-} ParallelChardev;
+};
 
 static int pp_hw_mode(ParallelChardev *s, uint16_t mode)
 {
@@ -177,10 +178,10 @@  static void qemu_chr_open_pp_fd(Chardev *chr,
 
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 
-typedef struct {
+struct ParallelChardev {
     Chardev parent;
     int fd;
-} ParallelChardev;
+};
 
 static int pp_ioctl(Chardev *chr, int cmd, void *arg)
 {