From: Li Zetao Date: Sat, 7 Sep 2024 03:09:59 +0000 (+0800) Subject: platform/olpc: Remove redundant null pointer checks in olpc_ec_setup_debugfs() X-Git-Tag: v6.12-rc1~131^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f80d7100f091e96b54beb32dc6d136520453582f;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://lore.kernel.org/r/20240907031009.3591057-2-lizetao1@huawei.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede --- diff --git a/drivers/platform/olpc/olpc-ec.c b/drivers/platform/olpc/olpc-ec.c index 921520475ff68..48e9861bb571f 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;