diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2018-05-25 08:51:50 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-07-19 16:42:21 -0500 |
commit | 51259d0022f1965047bb61662f6f0d5a79a6ddb3 (patch) | |
tree | e308013029c7e92a8c7101a3888900a522db2ca9 /drivers/pci/iov.c | |
parent | 7ce3f912ae0a79e5d738a3ae1f158b281973e849 (diff) | |
download | linux-51259d0022f1965047bb61662f6f0d5a79a6ddb3.tar.gz |
PCI/IOV: Tidy pci_sriov_set_totalvfs()
Fix minor style issues in pci_sriov_set_totalvfs(). No functional change
intended.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/iov.c')
-rw-r--r-- | drivers/pci/iov.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index d0d73dbbd5ca..aee859971ba1 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -802,15 +802,15 @@ int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) { if (!dev->is_physfn) return -ENOSYS; + if (numvfs > dev->sriov->total_VFs) return -EINVAL; /* Shouldn't change if VFs already enabled */ if (dev->sriov->ctrl & PCI_SRIOV_CTRL_VFE) return -EBUSY; - else - dev->sriov->driver_max_VFs = numvfs; + dev->sriov->driver_max_VFs = numvfs; return 0; } EXPORT_SYMBOL_GPL(pci_sriov_set_totalvfs); |