sky2: Remove redundant NULL check for debugfs_create_dir
authorRuan Jinjie <ruanjinjie@huawei.com>
Thu, 17 Aug 2023 07:30:17 +0000 (15:30 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 18 Aug 2023 22:31:46 +0000 (15:31 -0700)
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: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20230817073017.350002-1-ruanjinjie@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/sky2.c

index c4cca27..0772084 100644 (file)
@@ -4528,7 +4528,7 @@ static __init void sky2_debug_init(void)
        struct dentry *ent;
 
        ent = debugfs_create_dir("sky2", NULL);
-       if (!ent || IS_ERR(ent))
+       if (IS_ERR(ent))
                return;
 
        sky2_debug = ent;