qlcnic: Cleanup qlcnic_enable_msix() return values

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Himanshu Madhani <himanshu.madhani@qlogic.com>
Cc: Rajesh Borundia <rajesh.borundia@qlogic.com>
Cc: Shahed Shaikh <shahed.shaikh@qlogic.com>
Cc: linux-driver@qlogic.com
Cc: netdev@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Alexander Gordeev 2014-02-18 11:11:56 +01:00 committed by David S. Miller
parent 4a6768d3ed
commit 74a1fa45eb

View file

@ -684,7 +684,7 @@ int qlcnic_setup_tss_rss_intr(struct qlcnic_adapter *adapter)
int qlcnic_enable_msix(struct qlcnic_adapter *adapter, u32 num_msix) int qlcnic_enable_msix(struct qlcnic_adapter *adapter, u32 num_msix)
{ {
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
int err = -1, vector; int err, vector;
if (!adapter->msix_entries) { if (!adapter->msix_entries) {
adapter->msix_entries = kcalloc(num_msix, adapter->msix_entries = kcalloc(num_msix,
@ -706,7 +706,7 @@ int qlcnic_enable_msix(struct qlcnic_adapter *adapter, u32 num_msix)
adapter->flags |= QLCNIC_MSIX_ENABLED; adapter->flags |= QLCNIC_MSIX_ENABLED;
adapter->ahw->num_msix = num_msix; adapter->ahw->num_msix = num_msix;
dev_info(&pdev->dev, "using msi-x interrupts\n"); dev_info(&pdev->dev, "using msi-x interrupts\n");
return err; return 0;
} else if (err > 0) { } else if (err > 0) {
dev_info(&pdev->dev, dev_info(&pdev->dev,
"Unable to allocate %d MSI-X vectors, Available vectors %d\n", "Unable to allocate %d MSI-X vectors, Available vectors %d\n",
@ -715,12 +715,12 @@ int qlcnic_enable_msix(struct qlcnic_adapter *adapter, u32 num_msix)
if (qlcnic_82xx_check(adapter)) { if (qlcnic_82xx_check(adapter)) {
num_msix = rounddown_pow_of_two(err); num_msix = rounddown_pow_of_two(err);
if (err < QLCNIC_82XX_MINIMUM_VECTOR) if (err < QLCNIC_82XX_MINIMUM_VECTOR)
return -EIO; return -ENOSPC;
} else { } else {
num_msix = rounddown_pow_of_two(err - 1); num_msix = rounddown_pow_of_two(err - 1);
num_msix += 1; num_msix += 1;
if (err < QLCNIC_83XX_MINIMUM_VECTOR) if (err < QLCNIC_83XX_MINIMUM_VECTOR)
return -EIO; return -ENOSPC;
} }
if (qlcnic_82xx_check(adapter) && if (qlcnic_82xx_check(adapter) &&
@ -747,7 +747,7 @@ int qlcnic_enable_msix(struct qlcnic_adapter *adapter, u32 num_msix)
} }
} }
return err; return -EIO;
} }
static int qlcnic_82xx_calculate_msix_vector(struct qlcnic_adapter *adapter) static int qlcnic_82xx_calculate_msix_vector(struct qlcnic_adapter *adapter)