sky2: Remove redundant NULL check for debugfs_create_dir
PATCH 1/1 sky2: Remove redundant NULL check for debugfs_create_dir
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.
--- drivers/net/ethernet/marvell/sky2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/sky2.c +1 -1
@@ -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;
Signature · 1 line
2.34.1
Quoted 9 lines · Ruan Jinjie
Since
debugfs_create_dir()returnsERR_PTR,IS_ERR()is enough to check whether the directory is successfully created. So remove the redundant NULL check.Signed-off-by Ruan Jinjie <[email protected]>--- drivers/net/ethernet/marvell/sky2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks,
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Thu, 17 Aug 2023 15:30:17 +0800 you wrote:
Since
debugfs_create_dir()returnsERR_PTR,IS_ERR()is enough to check whether the directory is successfully created. So remove the redundant NULL check.Signed-off-by Ruan Jinjie <[email protected]>--- 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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html