Skip to content

Commit

Permalink
virtio: console: remove unnecessary null test before debugfs_remove_r…
Browse files Browse the repository at this point in the history
…ecursive

Fix checkpatch warning:
WARNING: debugfs_remove_recursive(NULL) is safe this check is probably not required

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: virtualization@lists.linux-foundation.org
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Fabian Frederick authored and Rusty Russell committed Jul 27, 2014
1 parent 15ba223 commit 5885e48
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -2262,8 +2262,7 @@ static int __init init(void)
unregister:
unregister_virtio_driver(&virtio_console);
free:
if (pdrvdata.debugfs_dir)
debugfs_remove_recursive(pdrvdata.debugfs_dir);
debugfs_remove_recursive(pdrvdata.debugfs_dir);
class_destroy(pdrvdata.class);
return err;
}
Expand All @@ -2276,8 +2275,7 @@ static void __exit fini(void)
unregister_virtio_driver(&virtio_rproc_serial);

class_destroy(pdrvdata.class);
if (pdrvdata.debugfs_dir)
debugfs_remove_recursive(pdrvdata.debugfs_dir);
debugfs_remove_recursive(pdrvdata.debugfs_dir);
}
module_init(init);
module_exit(fini);
Expand Down

0 comments on commit 5885e48

Please sign in to comment.