[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 13/17] megasas: remove unnecessary megasas_use_ms
From: |
Cao jin |
Subject: |
[Qemu-devel] [PATCH v8 13/17] megasas: remove unnecessary megasas_use_msi() |
Date: |
Fri, 10 Jun 2016 17:54:34 +0800 |
megasas overwrites user configuration when msi_init fail to flag internal msi
state, which is unsuitable. megasa_use_msi() is unnecessary, we can call
msi_uninit() directly when unrealize, even no need to call msi_enabled() first.
cc: Hannes Reinecke <address@hidden>
cc: Paolo Bonzini <address@hidden>
cc: Markus Armbruster <address@hidden>
cc: Marcel Apfelbaum <address@hidden>
cc: Michael S. Tsirkin <address@hidden>
Acked-by: Hannes Reinecke <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Cao jin <address@hidden>
---
hw/scsi/megasas.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 345783d..6a3f860 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -155,11 +155,6 @@ static bool megasas_use_queue64(MegasasState *s)
return s->flags & MEGASAS_MASK_USE_QUEUE64;
}
-static bool megasas_use_msi(MegasasState *s)
-{
- return s->msi != ON_OFF_AUTO_OFF;
-}
-
static bool megasas_use_msix(MegasasState *s)
{
return s->msix != ON_OFF_AUTO_OFF;
@@ -2310,9 +2305,7 @@ static void megasas_scsi_uninit(PCIDevice *d)
if (megasas_use_msix(s)) {
msix_uninit(d, &s->mmio_io, &s->mmio_io);
}
- if (megasas_use_msi(s)) {
- msi_uninit(d);
- }
+ msi_uninit(d);
}
static const struct SCSIBusInfo megasas_scsi_info = {
@@ -2343,7 +2336,7 @@ static void megasas_scsi_realize(PCIDevice *dev, Error
**errp)
/* Interrupt pin 1 */
pci_conf[PCI_INTERRUPT_PIN] = 0x01;
- if (megasas_use_msi(s)) {
+ if (s->msi != ON_OFF_AUTO_OFF) {
ret = msi_init(dev, 0x50, 1, true, false, &err);
/* Any error other than -ENOTSUP(board's MSI support is broken)
* is a programming error */
--
2.1.0
- [Qemu-devel] [PATCH v8 10/17] pci bridge dev: change msi property type, (continued)
- [Qemu-devel] [PATCH v8 17/17] e1000e: remove unnecessary internal msi state flag, Cao jin, 2016/06/10
- [Qemu-devel] [PATCH v8 16/17] vmxnet3: remove unnecessary internal msi state flag, Cao jin, 2016/06/10
- [Qemu-devel] [PATCH v8 13/17] megasas: remove unnecessary megasas_use_msi(),
Cao jin <=
- Re: [Qemu-devel] [PATCH v8 00/17] Add param Error ** for msi_init(), Markus Armbruster, 2016/06/13
- Re: [Qemu-devel] [PATCH v8 00/17] Add param Error ** for msi_init(), Michael S. Tsirkin, 2016/06/13