Skip to content

Commit f80d710

Browse files
Li Zetaojwrdegoede
authored andcommitted
platform/olpc: Remove redundant null pointer checks in olpc_ec_setup_debugfs()
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 <lizetao1@huawei.com> Link: https://lore.kernel.org/r/20240907031009.3591057-2-lizetao1@huawei.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent cedf233 commit f80d710

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/platform/olpc/olpc-ec.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,6 @@ static struct dentry *olpc_ec_setup_debugfs(void)
332332
struct dentry *dbgfs_dir;
333333

334334
dbgfs_dir = debugfs_create_dir("olpc-ec", NULL);
335-
if (IS_ERR_OR_NULL(dbgfs_dir))
336-
return NULL;
337-
338335
debugfs_create_file("cmd", 0600, dbgfs_dir, NULL, &ec_dbgfs_ops);
339336

340337
return dbgfs_dir;

0 commit comments

Comments
 (0)