mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fabian Frederick <fabf@skynet.be>
To: linux-kernel@vger.kernel.org
Cc: wein@de.ibm.com, stefan.haberland@de.ibm.com,
	Fabian Frederick <fabf@skynet.be>
Subject: [PATCH 1/4] drivers/s390/block/dasd.c: remove unnecessary null test before debugfs_remove
Date: Thu, 26 Jun 2014 19:41:46 +0200	[thread overview]
Message-ID: <1403804509-9565-2-git-send-email-fabf@skynet.be> (raw)
In-Reply-To: <1403804509-9565-1-git-send-email-fabf@skynet.be>

This fixes checkpatch warning:
"WARNING: debugfs_remove(NULL) is safe this check is probably not required"

Cc: Stefan Weinhuber <wein@de.ibm.com>
Cc: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/s390/block/dasd.c | 25 ++++++++-----------------
 1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 1eef0f5..ea2729f 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -283,8 +283,7 @@ static int dasd_state_basic_to_known(struct dasd_device *device)
 
 	if (device->block) {
 		dasd_profile_exit(&device->block->profile);
-		if (device->block->debugfs_dentry)
-			debugfs_remove(device->block->debugfs_dentry);
+		debugfs_remove(device->block->debugfs_dentry);
 		dasd_gendisk_free(device->block);
 		dasd_block_clear_timer(device->block);
 	}
@@ -293,9 +292,7 @@ static int dasd_state_basic_to_known(struct dasd_device *device)
 		return rc;
 	dasd_device_clear_timer(device);
 	dasd_profile_exit(&device->profile);
-	if (device->debugfs_dentry)
-		debugfs_remove(device->debugfs_dentry);
-
+	debugfs_remove(device->debugfs_dentry);
 	DBF_DEV_EVENT(DBF_EMERG, device, "%p debug area deleted", device);
 	if (device->debug_area != NULL) {
 		debug_unregister(device->debug_area);
@@ -1111,23 +1108,17 @@ static void dasd_profile_init(struct dasd_profile *profile,
 static void dasd_profile_exit(struct dasd_profile *profile)
 {
 	dasd_profile_off(profile);
-	if (profile->dentry) {
-		debugfs_remove(profile->dentry);
-		profile->dentry = NULL;
-	}
+	debugfs_remove(profile->dentry);
+	profile->dentry = NULL;
 }
 
 static void dasd_statistics_removeroot(void)
 {
 	dasd_global_profile_level = DASD_PROFILE_OFF;
-	if (dasd_global_profile_dentry) {
-		debugfs_remove(dasd_global_profile_dentry);
-		dasd_global_profile_dentry = NULL;
-	}
-	if (dasd_debugfs_global_entry)
-		debugfs_remove(dasd_debugfs_global_entry);
-	if (dasd_debugfs_root_entry)
-		debugfs_remove(dasd_debugfs_root_entry);
+	debugfs_remove(dasd_global_profile_dentry);
+	dasd_global_profile_dentry = NULL;
+	debugfs_remove(dasd_debugfs_global_entry);
+	debugfs_remove(dasd_debugfs_root_entry);
 }
 
 static void dasd_statistics_createroot(void)
-- 
1.8.4.5


  reply	other threads:[~2014-06-26 17:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 17:41 [PATCH 0/4] drivers/s390/block/dasd.c: code clean-up Fabian Frederick
2014-06-26 17:41 ` Fabian Frederick [this message]
2014-06-26 17:41 ` [PATCH 2/4] drivers/s390/block/dasd.c: Move EXPORT_SYMBOL after function/variable Fabian Frederick
2014-06-26 17:41 ` [PATCH 3/4] drivers/s390/block/dasd.c: replace pr_warning by pr_warn Fabian Frederick
2014-06-26 17:41 ` [PATCH 4/4] drivers/s390/block/dasd.c: replace seq_printf by seq_puts Fabian Frederick
2014-07-01 12:43 ` [PATCH 0/4] drivers/s390/block/dasd.c: code clean-up Stefan Haberland

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=1403804509-9565-2-git-send-email-fabf@skynet.be \
    --to=fabf@skynet.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefan.haberland@de.ibm.com \
    --cc=wein@de.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

all inboxes | Powered by JetHome®