All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IB/mthca: remove redundant inner check of mdev->mthca_flags
@ 2018-09-26 12:26 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2018-09-26 12:26 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe, Bart Van Assche, linux-rdma
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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>
---
 drivers/infiniband/hw/mthca/mthca_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c
index f3e80dec1334..f99c7e0b234c 100644
--- a/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/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);
 	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);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] IB/mthca: remove redundant inner check of mdev->mthca_flags
@ 2018-09-26 12:26 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2018-09-26 12:26 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe, Bart Van Assche, linux-rdma
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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>
---
 drivers/infiniband/hw/mthca/mthca_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c
index f3e80dec1334..f99c7e0b234c 100644
--- a/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/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);
 	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);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] IB/mthca: remove redundant inner check of mdev->mthca_flags
  2018-09-26 12:26 ` Colin King
@ 2018-09-26 22:34   ` Jason Gunthorpe
  -1 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2018-09-26 22:34 UTC (permalink / raw)
  To: Colin King
  Cc: Doug Ledford, Bart Van Assche, linux-rdma, kernel-janitors, linux-kernel

On Wed, Sep 26, 2018 at 01:26:08PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>
> ---
>  drivers/infiniband/hw/mthca/mthca_main.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] IB/mthca: remove redundant inner check of mdev->mthca_flags
@ 2018-09-26 22:34   ` Jason Gunthorpe
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2018-09-26 22:34 UTC (permalink / raw)
  To: Colin King
  Cc: Doug Ledford, Bart Van Assche, linux-rdma, kernel-janitors, linux-kernel

On Wed, Sep 26, 2018 at 01:26:08PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>
> ---
>  drivers/infiniband/hw/mthca/mthca_main.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-26 22:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26 12:26 [PATCH] IB/mthca: remove redundant inner check of mdev->mthca_flags Colin King
2018-09-26 12:26 ` Colin King
2018-09-26 22:34 ` Jason Gunthorpe
2018-09-26 22:34   ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.