Browse Source

IB/mthca: remove redundant inner check of mdev->mthca_flags

The inner check for mdev->mthca_flags & MTHCA_FLAG_MSI_X is redundant
as this is already true because of the previous identical check in
an outer if statement.  Remove it

Detected by cppcheck:
(warning) Identical inner 'if' condition is always true.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Colin Ian King 6 years ago
parent
commit
6e68c899e6
1 changed files with 1 additions and 2 deletions
  1. 1 2
      drivers/infiniband/hw/mthca/mthca_main.c

+ 1 - 2
drivers/infiniband/hw/mthca/mthca_main.c

@@ -1014,8 +1014,7 @@ static int __mthca_init_one(struct pci_dev *pdev, int hca_type)
 
 
 	err = mthca_setup_hca(mdev);
 	err = mthca_setup_hca(mdev);
 	if (err == -EBUSY && (mdev->mthca_flags & MTHCA_FLAG_MSI_X)) {
 	if (err == -EBUSY && (mdev->mthca_flags & MTHCA_FLAG_MSI_X)) {
-		if (mdev->mthca_flags & MTHCA_FLAG_MSI_X)
-			pci_free_irq_vectors(pdev);
+		pci_free_irq_vectors(pdev);
 		mdev->mthca_flags &= ~MTHCA_FLAG_MSI_X;
 		mdev->mthca_flags &= ~MTHCA_FLAG_MSI_X;
 
 
 		err = mthca_setup_hca(mdev);
 		err = mthca_setup_hca(mdev);