aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2012-11-09 22:35:01 -0500
committerBjorn Helgaas <bhelgaas@google.com>2012-11-09 23:40:09 -0500
commit1452cd76a97bf7b93a015586dcabc73fd935e692 (patch)
treec7165b369166199f793a40c0ab0695e073fb0945 /drivers/pci
parent6b136724691a6f247ada0c6a5f02370ed46de9f4 (diff)
PCI: Remove useless "!dev" tests
No need to check "!dev" when the caller should always supply a valid pointer. If the caller *doesn't* supply a valid pointer, it probably won't check for a failure return either. This way we'll oops and get a backtrace. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/iov.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index a32bd9ad0931..bafd2bbcaf65 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -729,10 +729,10 @@ EXPORT_SYMBOL_GPL(pci_sriov_migration);
729 */ 729 */
730int pci_num_vf(struct pci_dev *dev) 730int pci_num_vf(struct pci_dev *dev)
731{ 731{
732 if (!dev || !dev->is_physfn) 732 if (!dev->is_physfn)
733 return 0; 733 return 0;
734 else 734
735 return dev->sriov->num_VFs; 735 return dev->sriov->num_VFs;
736} 736}
737EXPORT_SYMBOL_GPL(pci_num_vf); 737EXPORT_SYMBOL_GPL(pci_num_vf);
738 738
@@ -750,7 +750,7 @@ EXPORT_SYMBOL_GPL(pci_num_vf);
750 */ 750 */
751int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) 751int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs)
752{ 752{
753 if (!dev || !dev->is_physfn || (numvfs > dev->sriov->total_VFs)) 753 if (!dev->is_physfn || (numvfs > dev->sriov->total_VFs))
754 return -EINVAL; 754 return -EINVAL;
755 755
756 /* Shouldn't change if VFs already enabled */ 756 /* Shouldn't change if VFs already enabled */
@@ -773,12 +773,12 @@ EXPORT_SYMBOL_GPL(pci_sriov_set_totalvfs);
773 */ 773 */
774int pci_sriov_get_totalvfs(struct pci_dev *dev) 774int pci_sriov_get_totalvfs(struct pci_dev *dev)
775{ 775{
776 if (!dev || !dev->is_physfn) 776 if (!dev->is_physfn)
777 return -EINVAL; 777 return -EINVAL;
778 778
779 if (dev->sriov->driver_max_VFs) 779 if (dev->sriov->driver_max_VFs)
780 return dev->sriov->driver_max_VFs; 780 return dev->sriov->driver_max_VFs;
781 else 781
782 return dev->sriov->total_VFs; 782 return dev->sriov->total_VFs;
783} 783}
784EXPORT_SYMBOL_GPL(pci_sriov_get_totalvfs); 784EXPORT_SYMBOL_GPL(pci_sriov_get_totalvfs);