IB/mthca: remove redundant inner check of mdev->mthca_flags
authorColin Ian King <colin.king@canonical.com>
Wed, 26 Sep 2018 12:26:08 +0000 (13:26 +0100)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 26 Sep 2018 22:34:11 +0000 (16:34 -0600)
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>
drivers/infiniband/hw/mthca/mthca_main.c

index f3e80de..f99c7e0 100644 (file)
@@ -1014,8 +1014,7 @@ static int __mthca_init_one(struct pci_dev *pdev, int hca_type)
 
        err = mthca_setup_hca(mdev);
        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;
 
                err = mthca_setup_hca(mdev);