Thread (14 messages) 14 messages, 2 authors, 2024-09-11
STALE651d LANDED

[PATCH -next v2] platform/olpc: Remove redundant null pointer checks in olpc_ec_setup_debugfs()

From: Li Zetao <hidden>
Date: 2024-09-07 03:01:23
Also in: linux-arm-kernel, linux-media, linux-rockchip, linux-sunxi, platform-driver-x86
Subsystem: the rest, x86 platform drivers · Maintainers: Linus Torvalds, Hans de Goede, Ilpo Järvinen

Since the debugfs_create_dir() never returns a null pointer, checking
the return value for a null pointer is redundant. Since
debugfs_create_file() can deal with a ERR_PTR() style pointer, drop
the check.

Signed-off-by: Li Zetao <redacted>
---
v1 -> v2:
v1:
https://lore.kernel.org/all/20240903143714.2004947-1-lizetao1@huawei.com/ (local)

 drivers/platform/olpc/olpc-ec.c | 3 ---
 1 file changed, 3 deletions(-)
diff --git a/drivers/platform/olpc/olpc-ec.c b/drivers/platform/olpc/olpc-ec.c
index 921520475ff6..48e9861bb571 100644
--- a/drivers/platform/olpc/olpc-ec.c
+++ b/drivers/platform/olpc/olpc-ec.c
@@ -332,9 +332,6 @@ static struct dentry *olpc_ec_setup_debugfs(void)
 	struct dentry *dbgfs_dir;
 
 	dbgfs_dir = debugfs_create_dir("olpc-ec", NULL);
-	if (IS_ERR_OR_NULL(dbgfs_dir))
-		return NULL;
-
 	debugfs_create_file("cmd", 0600, dbgfs_dir, NULL, &ec_dbgfs_ops);
 
 	return dbgfs_dir;
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help