public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Amitoj Kaur Chawla <amitoj1606@gmail.com>
To: sebott@linux.vnet.ibm.com, gerald.schaefer@de.ibm.com,
	schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: julia.lawall@lip6.fr
Subject: [PATCH] s390/pci: Remove unnecessary if condition
Date: Fri, 29 Jul 2016 14:01:50 +0530	[thread overview]
Message-ID: <20160729083150.GA8819@amitoj-Inspiron-3542> (raw)

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

             reply	other threads:[~2016-07-29  8:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29  8:31 Amitoj Kaur Chawla [this message]
2016-07-29  8:39 ` [PATCH] s390/pci: Remove unnecessary if condition Sebastian Ott
2016-07-29  8:46   ` Julia Lawall
2016-07-29  9:46     ` Sebastian Ott
2016-08-01  6:39       ` Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160729083150.GA8819@amitoj-Inspiron-3542 \
    --to=amitoj1606@gmail.com \
    --cc=gerald.schaefer@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=sebott@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox