]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
greybus: eliminate unneeded null check
authorAlex Elder <elder@linaro.org>
Tue, 24 May 2016 18:34:49 +0000 (13:34 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 27 May 2016 18:28:16 +0000 (11:28 -0700)
Coccinelle points out that debugfs_remove_recursive() handles a null
argument properly, so there's no need to check for NULL before
making the call.  I have verified this is true of the kernel we're
now working with (arche-6.0).

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/camera.c

index dda871912c10869cf39130cadaf287ad756571dd..d5496f8a7b89d6e554147cd274b8dc28abfac06d 100644 (file)
@@ -883,8 +883,7 @@ static int gb_camera_debugfs_init(struct gb_camera *gcam)
 
 static void gb_camera_debugfs_cleanup(struct gb_camera *gcam)
 {
-       if (gcam->debugfs.root)
-               debugfs_remove_recursive(gcam->debugfs.root);
+       debugfs_remove_recursive(gcam->debugfs.root);
 
        vfree(gcam->debugfs.buffers);
 }