From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCXkz-0001z9-Pd for qemu-devel@nongnu.org; Mon, 13 Jun 2016 15:42:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCXkv-00062F-JX for qemu-devel@nongnu.org; Mon, 13 Jun 2016 15:42:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCXkv-00062B-B1 for qemu-devel@nongnu.org; Mon, 13 Jun 2016 15:42:41 -0400 Date: Mon, 13 Jun 2016 22:42:36 +0300 From: "Michael S. Tsirkin" Message-ID: <20160613224151-mutt-send-email-mst@redhat.com> References: <1465552478-5540-1-git-send-email-caoj.fnst@cn.fujitsu.com> <1465552478-5540-16-git-send-email-caoj.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1465552478-5540-16-git-send-email-caoj.fnst@cn.fujitsu.com> Subject: Re: [Qemu-devel] [PATCH v8 15/17] vmw_pvscsi: remove unnecessary internal msi state flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cao jin Cc: qemu-devel@nongnu.org, Paolo Bonzini , Dmitry Fleytman , Markus Armbruster , Marcel Apfelbaum On Fri, Jun 10, 2016 at 05:54:36PM +0800, Cao jin wrote: > Internal flag msi_used is uncesessary, msi_uninit() could be called > directly, msi_enabled() is enough to check device msi state. > > cc: Paolo Bonzini > cc: Dmitry Fleytman > cc: Markus Armbruster > cc: Marcel Apfelbaum > cc: Michael S. Tsirkin > > Reviewed-by: Markus Armbruster > Signed-off-by: Cao jin > --- > hw/scsi/vmw_pvscsi.c | 12 ++---------- > 1 file changed, 2 insertions(+), 10 deletions(-) > > diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c > index ecd6077..363a7ed 100644 > --- a/hw/scsi/vmw_pvscsi.c > +++ b/hw/scsi/vmw_pvscsi.c > @@ -121,8 +121,6 @@ typedef struct { > uint8_t msg_ring_info_valid; /* Whether message ring initialized */ > uint8_t use_msg; /* Whether to use message ring */ > > - uint8_t msi_used; /* Whether MSI support was installed successfully */ > - > PVSCSIRingInfo rings; /* Data transfer rings manager */ > uint32_t resetting; /* Reset in progress */ > > @@ -362,7 +360,7 @@ pvscsi_update_irq_status(PVSCSIState *s) > trace_pvscsi_update_irq_level(should_raise, s->reg_interrupt_enabled, > s->reg_interrupt_status); > > - if (s->msi_used && msi_enabled(d)) { > + if (msi_enabled(d)) { > if (should_raise) { > trace_pvscsi_update_irq_msi(); > msi_notify(d, PVSCSI_VECTOR_COMPLETION); > @@ -1066,9 +1064,6 @@ pvscsi_init_msi(PVSCSIState *s) > PVSCSI_USE_64BIT, PVSCSI_PER_VECTOR_MASK, NULL); > if (res < 0) { > trace_pvscsi_init_msi_fail(res); > - s->msi_used = false; > - } else { > - s->msi_used = true; > } > } > > @@ -1077,9 +1072,7 @@ pvscsi_cleanup_msi(PVSCSIState *s) > { > PCIDevice *d = PCI_DEVICE(s); > > - if (s->msi_used) { > - msi_uninit(d); > - } > + msi_uninit(d); > } > > static const MemoryRegionOps pvscsi_ops = { > @@ -1222,7 +1215,6 @@ static const VMStateDescription vmstate_pvscsi = { > VMSTATE_STRUCT_TEST(parent_obj, PVSCSIState, > pvscsi_vmstate_test_pci_device, 0, > vmstate_pci_device, PCIDevice), > - VMSTATE_UINT8(msi_used, PVSCSIState), > VMSTATE_UINT32(resetting, PVSCSIState), > VMSTATE_UINT64(reg_interrupt_status, PVSCSIState), > VMSTATE_UINT64(reg_interrupt_enabled, PVSCSIState), This change will break cross-version migration, we can't make it. > -- > 2.1.0 > >