All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Longpeng (Mike)" <longpeng2@huawei.com>
Subject: [PULL 01/11] vfio: simplify the conditional statements in vfio_msi_enable
Date: Fri, 06 May 2022 14:46:47 -0600	[thread overview]
Message-ID: <165186999562.4166595.6841345826661840962.stgit@omen> (raw)
In-Reply-To: <165186988363.4166595.3147442303200167674.stgit@omen>

From: Longpeng(Mike) <longpeng2@huawei.com>

It's unnecessary to test against the specific return value of
VFIO_DEVICE_SET_IRQS, since any positive return is an error
indicating the number of vectors we should retry with.

Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
Link: https://lore.kernel.org/r/20220326060226.1892-2-longpeng2@huawei.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 hw/vfio/pci.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 9fd9faee1d14..cab1a6ef57f1 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -653,7 +653,7 @@ retry:
     if (ret) {
         if (ret < 0) {
             error_report("vfio: Error: Failed to setup MSI fds: %m");
-        } else if (ret != vdev->nr_vectors) {
+        } else {
             error_report("vfio: Error: Failed to enable %d "
                          "MSI vectors, retry with %d", vdev->nr_vectors, ret);
         }
@@ -671,7 +671,7 @@ retry:
         g_free(vdev->msi_vectors);
         vdev->msi_vectors = NULL;
 
-        if (ret > 0 && ret != vdev->nr_vectors) {
+        if (ret > 0) {
             vdev->nr_vectors = ret;
             goto retry;
         }




  reply	other threads:[~2022-05-06 20:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06 20:46 [PULL 00/11] Series short description Alex Williamson
2022-05-06 20:46 ` Alex Williamson [this message]
2022-05-06 20:46 ` [PULL 02/11] vfio: move re-enabling INTX out of the common helper Alex Williamson
2022-05-06 20:47 ` [PULL 03/11] vfio: simplify the failure path in vfio_msi_enable Alex Williamson
2022-05-06 20:47 ` [PULL 04/11] Revert "vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration" Alex Williamson
2022-05-06 20:47 ` [PULL 05/11] vfio: defer to commit kvm irq routing when enable msi/msix Alex Williamson
2022-05-06 20:48 ` [PULL 06/11] vfio/common: Fix a small boundary issue of a trace Alex Williamson
2022-05-06 20:48 ` [PULL 07/11] sysemu: tpm: Add a stub function for TPM_IS_CRB Alex Williamson
2022-05-19  0:46   ` Stefan Berger
2022-05-19  1:17     ` Alex Williamson
2022-05-19  1:31       ` Stefan Berger
2022-05-06 20:48 ` [PULL 08/11] vfio/common: remove spurious tpm-crb-cmd misalignment warning Alex Williamson
2022-05-06 20:48 ` [PULL 09/11] hw/vfio/pci: fix vfio_pci_hot_reset_result trace point Alex Williamson
2022-05-06 20:49 ` [PULL 10/11] vfio/pci: Use vbasedev local variable in vfio_realize() Alex Williamson
2022-05-06 20:49 ` [PULL 11/11] vfio/common: Rename VFIOGuestIOMMU::iommu into ::iommu_mr Alex Williamson
2022-05-07  2:37 ` [PULL 00/11] Series short description Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=165186999562.4166595.6841345826661840962.stgit@omen \
    --to=alex.williamson@redhat.com \
    --cc=longpeng2@huawei.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.