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


Groups > linux.kernel > #1452321 > unrolled thread

[PATCH] s390/pci: Remove unnecessary if condition

Started byAmitoj Kaur Chawla <amitoj1606@gmail.com>
First post2016-07-29 10:40 +0200
Last post2016-07-29 10:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] s390/pci: Remove unnecessary if condition Amitoj Kaur Chawla <amitoj1606@gmail.com> - 2016-07-29 10:40 +0200

#1452321 — [PATCH] s390/pci: Remove unnecessary if condition

FromAmitoj Kaur Chawla <amitoj1606@gmail.com>
Date2016-07-29 10:40 +0200
Subject[PATCH] s390/pci: Remove unnecessary if condition
Message-ID<s0buO-2d6-21@gated-at.bofh.it>
Remove unnecessary error handling because the only failure value that
can be returned is NULL and so the test can never be true.

The Coccinelle semantic patch used to make this change is as follows:
@@
expression e;
@@

  e = debugfs_create_file(...);
- if(IS_ERR(e)) { e = NULL; }

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 arch/s390/pci/pci_debug.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/s390/pci/pci_debug.c b/arch/s390/pci/pci_debug.c
index 4129b0a..8a25b04 100644
--- a/arch/s390/pci/pci_debug.c
+++ b/arch/s390/pci/pci_debug.c
@@ -139,8 +139,6 @@ void zpci_debug_init_device(struct zpci_dev *zdev)
 				S_IFREG | S_IRUGO | S_IWUSR,
 				zdev->debugfs_dev, zdev,
 				&debugfs_pci_perf_fops);
-	if (IS_ERR(zdev->debugfs_perf))
-		zdev->debugfs_perf = NULL;
 }
 
 void zpci_debug_exit_device(struct zpci_dev *zdev)
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web