From: Thierry Reding Date: Wed, 12 Aug 2015 14:32:12 +0000 (+0200) Subject: vga_switcheroo: Remove unnecessary checks X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=798ae0f6693deac4a07377d0c45b4325b7026278;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git vga_switcheroo: Remove unnecessary checks debugfs_remove() gracefully ignores NULL parameters, so the explicit checks can be removed. Signed-off-by: Thierry Reding Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index c7771466595f..21060668fd25 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c @@ -525,14 +525,11 @@ static const struct file_operations vga_switcheroo_debugfs_fops = { static void vga_switcheroo_debugfs_fini(struct vgasr_priv *priv) { - if (priv->switch_file) { - debugfs_remove(priv->switch_file); - priv->switch_file = NULL; - } - if (priv->debugfs_root) { - debugfs_remove(priv->debugfs_root); - priv->debugfs_root = NULL; - } + debugfs_remove(priv->switch_file); + priv->switch_file = NULL; + + debugfs_remove(priv->debugfs_root); + priv->debugfs_root = NULL; } static int vga_switcheroo_debugfs_init(struct vgasr_priv *priv)