Since the debugfs_create_dir() never returns a null pointer, checking the return value for a null pointer is redundant, and using IS_ERR is safe enough. Signed-off-by: Li Zetao <lizetao1@xxxxxxxxxx> --- drivers/block/mtip32xx/mtip32xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index c6ef0546ffc9..56f3bb30165e 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -2275,7 +2275,7 @@ static int mtip_hw_debugfs_init(struct driver_data *dd) return -1; dd->dfs_node = debugfs_create_dir(dd->disk->disk_name, dfs_parent); - if (IS_ERR_OR_NULL(dd->dfs_node)) { + if (IS_ERR(dd->dfs_node)) { dev_warn(&dd->pdev->dev, "Error creating node %s under debugfs\n", dd->disk->disk_name); @@ -4043,7 +4043,7 @@ static int __init mtip_init(void) mtip_major = error; dfs_parent = debugfs_create_dir("rssd", NULL); - if (IS_ERR_OR_NULL(dfs_parent)) { + if (IS_ERR(dfs_parent)) { pr_warn("Error creating debugfs parent\n"); dfs_parent = NULL; } -- 2.34.1