Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1448923 > unrolled thread

[PATCH 1/3] IB/mthca: Delete an unnecessary check before the function call "pci_dev_put"

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2016-07-23 13:00 +0200
Last post2016-07-25 15:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/3] IB/mthca: Delete an unnecessary check before the function  call "pci_dev_put" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-23 13:00 +0200
    Re: [PATCH 1/3] IB/mthca: Delete an unnecessary check before the  function call "pci_dev_put" Leon Romanovsky <leon@kernel.org> - 2016-07-25 15:20 +0200

#1448923 — [PATCH 1/3] IB/mthca: Delete an unnecessary check before the function call "pci_dev_put"

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-07-23 13:00 +0200
Subject[PATCH 1/3] IB/mthca: Delete an unnecessary check before the function call "pci_dev_put"
Message-ID<rY2OZ-1Mx-1@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 23 Jul 2016 10:05:12 +0200

The pci_dev_put() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/infiniband/hw/mthca/mthca_reset.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_reset.c b/drivers/infiniband/hw/mthca/mthca_reset.c
index 74c6a94..c521654 100644
--- a/drivers/infiniband/hw/mthca/mthca_reset.c
+++ b/drivers/infiniband/hw/mthca/mthca_reset.c
@@ -279,8 +279,7 @@ good:
 	}
 
 out:
-	if (bridge)
-		pci_dev_put(bridge);
+	pci_dev_put(bridge);
 	kfree(bridge_header);
 	kfree(hca_header);
 
-- 
2.9.2

[toc] | [next] | [standalone]


#1449465 — Re: [PATCH 1/3] IB/mthca: Delete an unnecessary check before the function call "pci_dev_put"

FromLeon Romanovsky <leon@kernel.org>
Date2016-07-25 15:20 +0200
SubjectRe: [PATCH 1/3] IB/mthca: Delete an unnecessary check before the function call "pci_dev_put"
Message-ID<rYNXz-51i-1@gated-at.bofh.it>
In reply to#1448923

[Multipart message — attachments visible in raw view] — view raw

On Sat, Jul 23, 2016 at 12:58:08PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 23 Jul 2016 10:05:12 +0200
> 
> The pci_dev_put() function tests whether its argument is NULL and then
> returns immediately. Thus the test around the call is not needed.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web