[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240910154803.736951-2-lizetao1@huawei.com>
Date: Tue, 10 Sep 2024 23:48:03 +0800
From: Li Zetao <lizetao1@...wei.com>
To: <hverkuil-cisco@...all.nl>, <mchehab@...nel.org>,
<gregkh@...uxfoundation.org>, <ricardo@...liere.net>, <ruanjinjie@...wei.com>
CC: <lizetao1@...wei.com>, <linux-media@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH -next v3 2/2] media: siano: remove redundant null pointer checks in cec_devnode_init()
Since the debugfs_create_dir() never returns a null pointer, checking
the return value for a null pointer is redundant, Remove this check
since debugfs_create_file can handle IS_ERR pointers.
Signed-off-by: Li Zetao <lizetao1@...wei.com>
---
v2 -> v3: Drop the redundant variable d and assign it directly
v2: https://lore.kernel.org/all/20240907034400.3693797-2-lizetao1@huawei.com/
v1 -> v2: Remove this check since debugfs_create_file can
handle IS_ERR pointers.
v1: https://lore.kernel.org/all/20240903143607.2004802-2-lizetao1@huawei.com/
drivers/media/common/siano/smsdvb-debugfs.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c
index 73990e469df9..d14ba271db50 100644
--- a/drivers/media/common/siano/smsdvb-debugfs.c
+++ b/drivers/media/common/siano/smsdvb-debugfs.c
@@ -398,8 +398,6 @@ void smsdvb_debugfs_release(struct smsdvb_client_t *client)
void smsdvb_debugfs_register(void)
{
- struct dentry *d;
-
/*
* FIXME: This was written to debug Siano USB devices. So, it creates
* the debugfs node under <debugfs>/usb.
@@ -410,12 +408,7 @@ void smsdvb_debugfs_register(void)
* node for sdio-based boards, but this may need some logic at sdio
* subsystem.
*/
- d = debugfs_create_dir("smsdvb", usb_debug_root);
- if (IS_ERR_OR_NULL(d)) {
- pr_err("Couldn't create sysfs node for smsdvb\n");
- return;
- }
- smsdvb_debugfs_usb_root = d;
+ smsdvb_debugfs_usb_root = debugfs_create_dir("smsdvb", usb_debug_root);
}
void smsdvb_debugfs_unregister(void)
--
2.34.1
Powered by blists - more mailing lists