Skip to content

Commit

Permalink
sky2: Remove redundant NULL check for debugfs_create_dir
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ruan Jinjie authored and kuba-moo committed Aug 18, 2023
1 parent 2f48b1d commit ee09e9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/marvell/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ee09e9d

Please sign in to comment.