Message ID | 20240903143607.2004802-2-lizetao1@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [-next,1/2] media: cec: remove redundant null pointer checks in cec_devnode_init() | expand |
On Tue, Sep 03, 2024 at 10:36:07PM +0800, Li Zetao wrote: > Since the debugfs_create_dir() never returns a null pointer, checking > the return value for a null pointer is redundant, and using IS_ERR is > safe enough. > > Signed-off-by: Li Zetao <lizetao1@huawei.com> > --- > drivers/media/common/siano/smsdvb-debugfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c > index 73990e469df9..325d674c74d9 100644 > --- a/drivers/media/common/siano/smsdvb-debugfs.c > +++ b/drivers/media/common/siano/smsdvb-debugfs.c > @@ -411,7 +411,7 @@ void smsdvb_debugfs_register(void) > * subsystem. > */ > d = debugfs_create_dir("smsdvb", usb_debug_root); > - if (IS_ERR_OR_NULL(d)) { > + if (IS_ERR(d)) { > pr_err("Couldn't create sysfs node for smsdvb\n"); Again, just do not check. thanks, greg k-h
diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c index 73990e469df9..325d674c74d9 100644 --- a/drivers/media/common/siano/smsdvb-debugfs.c +++ b/drivers/media/common/siano/smsdvb-debugfs.c @@ -411,7 +411,7 @@ void smsdvb_debugfs_register(void) * subsystem. */ d = debugfs_create_dir("smsdvb", usb_debug_root); - if (IS_ERR_OR_NULL(d)) { + if (IS_ERR(d)) { pr_err("Couldn't create sysfs node for smsdvb\n"); return; }
Since the debugfs_create_dir() never returns a null pointer, checking the return value for a null pointer is redundant, and using IS_ERR is safe enough. Signed-off-by: Li Zetao <lizetao1@huawei.com> --- drivers/media/common/siano/smsdvb-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)