[PATCH] PCI: handle pci_sriov_set_totalvfs(dev, 0)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make a driver_max_VFs of 0 mean 0, instead of total_VFs as previously.
Initialise driver_max_VFs to total_VFs instead of 0.

Signed-off-by: Edward Cree <ecree@xxxxxxxxxxxxxx>
---
Only existing callers are ixgbe and igb, and neither passes 0, so this
doesn't break existing users.
---
 drivers/pci/iov.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index cb6f247..fb51467 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -381,7 +381,7 @@ found:
        iov->pos = pos;
        iov->nres = nres;
        iov->ctrl = ctrl;
-       iov->total_VFs = total;
+       iov->driver_max_VFs = iov->total_VFs = total;
        iov->offset = offset;
        iov->stride = stride;
        iov->pgsz = pgsz;
@@ -686,9 +686,6 @@ int pci_sriov_get_totalvfs(struct pci_dev *dev)
        if (!dev->is_physfn)
                return 0;

-       if (dev->sriov->driver_max_VFs)
-               return dev->sriov->driver_max_VFs;
-
-       return dev->sriov->total_VFs;
+       return dev->sriov->driver_max_VFs;
 }
 EXPORT_SYMBOL_GPL(pci_sriov_get_totalvfs);
--
1.7.11.7
The information contained in this message is confidential and is intended for the addressee(s) only. If you have received this message in error, please notify the sender immediately and delete the message. Unless you are an addressee (or authorized to receive for an addressee), you may not use, copy or disclose to anyone this message or any information contained in this message. The unauthorized use, disclosure, copying or alteration of this message is strictly prohibited.
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux