Message ID | 20230817073017.350002-1-ruanjinjie@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Commit | ee09e9deefac842a66cbbd39fd2f03aff6e2a656 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] sky2: Remove redundant NULL check for debugfs_create_dir | expand |
On Thu, Aug 17, 2023 at 03:30:17PM +0800, Ruan Jinjie wrote: > 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> > --- > drivers/net/ethernet/marvell/sky2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Thanks, Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Thu, 17 Aug 2023 15:30:17 +0800 you wrote: > 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> > --- > drivers/net/ethernet/marvell/sky2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Here is the summary with links: - [net-next] sky2: Remove redundant NULL check for debugfs_create_dir https://git.kernel.org/netdev/net-next/c/ee09e9deefac You are awesome, thank you!
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c index c4cca27fb0d5..07720841a8d7 100644 --- a/drivers/net/ethernet/marvell/sky2.c +++ b/drivers/net/ethernet/marvell/sky2.c @@ -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;
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> --- drivers/net/ethernet/marvell/sky2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)