]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
media: uvcvideo: Remove unnecessary NULL check before debugfs_remove_recursive
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Sun, 12 Nov 2017 08:18:59 +0000 (03:18 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 11 Sep 2018 12:42:10 +0000 (08:42 -0400)
debugfs_remove_recursive() accepts a NULL parameter and returns
immediately, there's no need for a NULL check in the caller.

This issue was detected with the help of Coccinelle.

[Reword commit message, address uvc_debugfs_cleanup_stream()]

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/usb/uvc/uvc_debugfs.c

index 368f8f8dfcb5c5917e63fbf1cf25bb80f1d4ed50..77e7c2419b9bc59735a993fbd7e85ebd2c160288 100644 (file)
@@ -106,9 +106,6 @@ void uvc_debugfs_init_stream(struct uvc_streaming *stream)
 
 void uvc_debugfs_cleanup_stream(struct uvc_streaming *stream)
 {
-       if (stream->debugfs_dir == NULL)
-               return;
-
        debugfs_remove_recursive(stream->debugfs_dir);
        stream->debugfs_dir = NULL;
 }
@@ -128,6 +125,5 @@ void uvc_debugfs_init(void)
 
 void uvc_debugfs_cleanup(void)
 {
-       if (uvc_debugfs_root_dir != NULL)
-               debugfs_remove_recursive(uvc_debugfs_root_dir);
+       debugfs_remove_recursive(uvc_debugfs_root_dir);
 }