diff mbox series

[net-next] sky2: Remove redundant NULL check for debugfs_create_dir

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

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1337 this patch: 1337
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 1353 this patch: 1353
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1360 this patch: 1360
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jinjie Ruan Aug. 17, 2023, 7:30 a.m. UTC
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(-)

Comments

Leon Romanovsky Aug. 17, 2023, 8:03 a.m. UTC | #1
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>
patchwork-bot+netdevbpf@kernel.org Aug. 19, 2023, 12:10 a.m. UTC | #2
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 mbox series

Patch

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;