[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL 9/9] pci: msix: move 'MSIX_CAP_LENGTH' to header file
From: |
Laurent Vivier |
Subject: |
[qemu-s390x] [PULL 9/9] pci: msix: move 'MSIX_CAP_LENGTH' to header file |
Date: |
Wed, 22 May 2019 18:07:23 +0200 |
From: Li Qiang <address@hidden>
'MSIX_CAP_LENGTH' is defined in two .c file. Move it
to hw/pci/msix.h file to reduce duplicated code.
CC: address@hidden
Signed-off-by: Li Qiang <address@hidden>
Message-Id: <address@hidden>
Acked-by: Alex Williamson <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Eric Auger <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
---
hw/pci/msix.c | 2 --
hw/vfio/pci.c | 2 --
include/hw/pci/msix.h | 2 ++
3 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/pci/msix.c b/hw/pci/msix.c
index 4e336416a78a..d39dcf32e8c9 100644
--- a/hw/pci/msix.c
+++ b/hw/pci/msix.c
@@ -24,8 +24,6 @@
#include "qapi/error.h"
#include "trace.h"
-#define MSIX_CAP_LENGTH 12
-
/* MSI enable bit and maskall bit are in byte 1 in FLAGS register */
#define MSIX_CONTROL_OFFSET (PCI_MSIX_FLAGS + 1)
#define MSIX_ENABLE_MASK (PCI_MSIX_FLAGS_ENABLE >> 8)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 08729e5875a9..8e555db12ec0 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -35,8 +35,6 @@
#include "trace.h"
#include "qapi/error.h"
-#define MSIX_CAP_LENGTH 12
-
#define TYPE_VFIO_PCI "vfio-pci"
#define PCI_VFIO(obj) OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI)
diff --git a/include/hw/pci/msix.h b/include/hw/pci/msix.h
index 1f27658d352f..08acfa836e49 100644
--- a/include/hw/pci/msix.h
+++ b/include/hw/pci/msix.h
@@ -4,6 +4,8 @@
#include "qemu-common.h"
#include "hw/pci/pci.h"
+#define MSIX_CAP_LENGTH 12
+
void msix_set_message(PCIDevice *dev, int vector, MSIMessage msg);
MSIMessage msix_get_message(PCIDevice *dev, unsigned int vector);
int msix_init(PCIDevice *dev, unsigned short nentries,
--
2.20.1
- [qemu-s390x] [PULL 0/9] Trivial branch patches, Laurent Vivier, 2019/05/22
- [qemu-s390x] [PULL 4/9] migration: Fix typo in migrate_add_blocker() error message, Laurent Vivier, 2019/05/22
- [qemu-s390x] [PULL 5/9] configure: Fix spelling of sdl-image in --help, Laurent Vivier, 2019/05/22
- [qemu-s390x] [PULL 2/9] roms: Correct the EDK2_BASETOOLS_OPTFLAGS variable description, Laurent Vivier, 2019/05/22
- [qemu-s390x] [PULL 3/9] roms: List and describe the Makefile 'clean' rule, Laurent Vivier, 2019/05/22
- [qemu-s390x] [PULL 6/9] vfio: pci: make "vfio-pci-nohotplug" as MACRO, Laurent Vivier, 2019/05/22
- [qemu-s390x] [PULL 1/9] hw/virtio/virtio-mmio: Convert DPRINTF to trace and log, Laurent Vivier, 2019/05/22
- [qemu-s390x] [PULL 9/9] pci: msix: move 'MSIX_CAP_LENGTH' to header file,
Laurent Vivier <=
- [qemu-s390x] [PULL 8/9] vfio: platform: fix a typo, Laurent Vivier, 2019/05/22
- [qemu-s390x] [PULL 7/9] hw: vfio: drop TYPE_FOO MACRO in VMStateDescription, Laurent Vivier, 2019/05/22
- Re: [qemu-s390x] [Qemu-devel] [PULL 0/9] Trivial branch patches, Peter Maydell, 2019/05/23