summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2012-11-10 07:35:01 +0400
committerBjorn Helgaas <bhelgaas@google.com>2012-11-10 08:40:09 +0400
commit1452cd76a97bf7b93a015586dcabc73fd935e692 (patch)
treec7165b369166199f793a40c0ab0695e073fb0945
parent6b136724691a6f247ada0c6a5f02370ed46de9f4 (diff)
downloadlinux-1452cd76a97bf7b93a015586dcabc73fd935e692.tar.xz
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>
-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);
*/
int pci_num_vf(struct pci_dev *dev)
{
- if (!dev || !dev->is_physfn)
+ if (!dev->is_physfn)
return 0;
- else
- return dev->sriov->num_VFs;
+
+ return dev->sriov->num_VFs;
}
EXPORT_SYMBOL_GPL(pci_num_vf);
@@ -750,7 +750,7 @@ EXPORT_SYMBOL_GPL(pci_num_vf);
*/
int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs)
{
- if (!dev || !dev->is_physfn || (numvfs > dev->sriov->total_VFs))
+ if (!dev->is_physfn || (numvfs > dev->sriov->total_VFs))
return -EINVAL;
/* Shouldn't change if VFs already enabled */
@@ -773,12 +773,12 @@ EXPORT_SYMBOL_GPL(pci_sriov_set_totalvfs);
*/
int pci_sriov_get_totalvfs(struct pci_dev *dev)
{
- if (!dev || !dev->is_physfn)
+ if (!dev->is_physfn)
return -EINVAL;
if (dev->sriov->driver_max_VFs)
return dev->sriov->driver_max_VFs;
- else
- return dev->sriov->total_VFs;
+
+ return dev->sriov->total_VFs;
}
EXPORT_SYMBOL_GPL(pci_sriov_get_totalvfs);