[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230817073017.350002-1-ruanjinjie@huawei.com>
Date: Thu, 17 Aug 2023 15:30:17 +0800
From: Ruan Jinjie <ruanjinjie@...wei.com>
To: <netdev@...r.kernel.org>, Mirko Lindner <mlindner@...vell.com>, Stephen
Hemminger <stephen@...workplumber.org>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH net-next] 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.
Signed-off-by: Ruan Jinjie <ruanjinjie@...wei.com>
---
drivers/net/ethernet/marvell/sky2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.34.1
Powered by blists - more mailing lists