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


Groups > linux.kernel > #1444899

[PATCH] s390/pci: Delete an unnecessary check before the function call "pci_dev_put"

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH] s390/pci: Delete an unnecessary check before the function call "pci_dev_put"
Date 2016-07-16 20:50 +0200
Message-ID <rVCP0-7iw-17@gated-at.bofh.it> (permalink)
References (12 earlier) <mSsDN-4wa-59@gated-at.bofh.it> <mSsDN-4wa-61@gated-at.bofh.it> <mSsDN-4wa-63@gated-at.bofh.it> <mSsDN-4wa-65@gated-at.bofh.it> <mSsDN-4wa-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 20:15:17 +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>
---
 arch/s390/pci/pci_event.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/s390/pci/pci_event.c b/arch/s390/pci/pci_event.c
index fb2a9a5..c2b27ad 100644
--- a/arch/s390/pci/pci_event.c
+++ b/arch/s390/pci/pci_event.c
@@ -145,8 +145,7 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
 	default:
 		break;
 	}
-	if (pdev)
-		pci_dev_put(pdev);
+	pci_dev_put(pdev);
 }
 
 void zpci_event_availability(void *data)
-- 
2.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] s390/pci: Delete an unnecessary check before the function  call "pci_dev_put" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-16 20:50 +0200
  Re: [PATCH] s390/pci: Delete an unnecessary check before the  function call "pci_dev_put" Martin Schwidefsky <schwidefsky@de.ibm.com> - 2016-07-18 09:10 +0200

csiph-web