Skip to content

Commit d7309aa

Browse files
Fabian FrederickMartin Schwidefsky
authored andcommitted
s390/dasd: remove unnecessary null test before debugfs_remove
This fixes checkpatch warning: "WARNING: debugfs_remove(NULL) is safe this check is probably not required" Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 852eb1a commit d7309aa

1 file changed

Lines changed: 8 additions & 17 deletions

File tree

‎drivers/s390/block/dasd.c‎

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,7 @@ static int dasd_state_basic_to_known(struct dasd_device *device)
283283

284284
if (device->block) {
285285
dasd_profile_exit(&device->block->profile);
286-
if (device->block->debugfs_dentry)
287-
debugfs_remove(device->block->debugfs_dentry);
286+
debugfs_remove(device->block->debugfs_dentry);
288287
dasd_gendisk_free(device->block);
289288
dasd_block_clear_timer(device->block);
290289
}
@@ -293,9 +292,7 @@ static int dasd_state_basic_to_known(struct dasd_device *device)
293292
return rc;
294293
dasd_device_clear_timer(device);
295294
dasd_profile_exit(&device->profile);
296-
if (device->debugfs_dentry)
297-
debugfs_remove(device->debugfs_dentry);
298-
295+
debugfs_remove(device->debugfs_dentry);
299296
DBF_DEV_EVENT(DBF_EMERG, device, "%p debug area deleted", device);
300297
if (device->debug_area != NULL) {
301298
debug_unregister(device->debug_area);
@@ -1111,23 +1108,17 @@ static void dasd_profile_init(struct dasd_profile *profile,
11111108
static void dasd_profile_exit(struct dasd_profile *profile)
11121109
{
11131110
dasd_profile_off(profile);
1114-
if (profile->dentry) {
1115-
debugfs_remove(profile->dentry);
1116-
profile->dentry = NULL;
1117-
}
1111+
debugfs_remove(profile->dentry);
1112+
profile->dentry = NULL;
11181113
}
11191114

11201115
static void dasd_statistics_removeroot(void)
11211116
{
11221117
dasd_global_profile_level = DASD_PROFILE_OFF;
1123-
if (dasd_global_profile_dentry) {
1124-
debugfs_remove(dasd_global_profile_dentry);
1125-
dasd_global_profile_dentry = NULL;
1126-
}
1127-
if (dasd_debugfs_global_entry)
1128-
debugfs_remove(dasd_debugfs_global_entry);
1129-
if (dasd_debugfs_root_entry)
1130-
debugfs_remove(dasd_debugfs_root_entry);
1118+
debugfs_remove(dasd_global_profile_dentry);
1119+
dasd_global_profile_dentry = NULL;
1120+
debugfs_remove(dasd_debugfs_global_entry);
1121+
debugfs_remove(dasd_debugfs_root_entry);
11311122
}
11321123

11331124
static void dasd_statistics_createroot(void)

0 commit comments

Comments
 (0)