Since debugfs_create_dir() returns ERR_PTR, IS_ERR() is enough to check whether the directory is successfully created. So remove the redundant NULL check. Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx> --- drivers/s390/block/dasd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 215597f73be4..2788f6fd6499 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -219,7 +219,7 @@ static struct dentry *dasd_debugfs_setup(const char *name, if (!base_dentry) return NULL; pde = debugfs_create_dir(name, base_dentry); - if (!pde || IS_ERR(pde)) + if (IS_ERR(pde)) return NULL; return pde; } @@ -1071,11 +1071,11 @@ static void dasd_statistics_createroot(void) dasd_debugfs_root_entry = NULL; pde = debugfs_create_dir("dasd", NULL); - if (!pde || IS_ERR(pde)) + if (IS_ERR(pde)) goto error; dasd_debugfs_root_entry = pde; pde = debugfs_create_dir("global", dasd_debugfs_root_entry); - if (!pde || IS_ERR(pde)) + if (IS_ERR(pde)) goto error; dasd_debugfs_global_entry = pde; dasd_profile_init(&dasd_global_profile, dasd_debugfs_global_entry); -- 2.34.1