aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo A. R. Silva <[email protected]>2017-11-12 08:18:59 +0000
committerMauro Carvalho Chehab <[email protected]>2018-09-11 12:42:10 +0000
commit829682b3dba16120c3366d8eaef620a8a41e5fb8 (patch)
treecf61202d9492fa01afa2c0e20746890e3c4ef2e3
parentmedia: uvcvideo: Make uvc_control_mapping menu_info field const (diff)
downloadkernel-829682b3dba16120c3366d8eaef620a8a41e5fb8.tar.gz
kernel-829682b3dba16120c3366d8eaef620a8a41e5fb8.zip
media: uvcvideo: Remove unnecessary NULL check before debugfs_remove_recursive
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 <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r--drivers/media/usb/uvc/uvc_debugfs.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/media/usb/uvc/uvc_debugfs.c b/drivers/media/usb/uvc/uvc_debugfs.c
index 368f8f8dfcb5..77e7c2419b9b 100644
--- a/drivers/media/usb/uvc/uvc_debugfs.c
+++ b/drivers/media/usb/uvc/uvc_debugfs.c
@@ -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);
}