[-next,2/2] media: siano: remove redundant null pointer checks in cec_devnode_init()
Checks
Context |
Check |
Description |
media-ci/HTML_report |
success
|
Link
|
media-ci/report |
success
|
Link
|
media-ci/virtme32 |
success
|
Link
|
media-ci/virtme64 |
fail
|
Link
|
media-ci/bisect |
success
|
Link
|
media-ci/doc |
success
|
Link
|
media-ci/build |
success
|
Link
|
media-ci/static-upstream |
success
|
Link
|
media-ci/abi |
success
|
Link
|
media-ci/media-patchstyle |
success
|
Link
|
media-ci/checkpatch |
success
|
Link
|
Commit Message
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(-)
Comments
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
@@ -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;
}