Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Li Zetao and committed by
Hans de Goede
f80d7100 cedf2335

-3
-3
drivers/platform/olpc/olpc-ec.c
··· 332 332 struct dentry *dbgfs_dir; 333 333 334 334 dbgfs_dir = debugfs_create_dir("olpc-ec", NULL); 335 - if (IS_ERR_OR_NULL(dbgfs_dir)) 336 - return NULL; 337 - 338 335 debugfs_create_file("cmd", 0600, dbgfs_dir, NULL, &ec_dbgfs_ops); 339 336 340 337 return dbgfs_dir;