mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH 7/7] vga_switcheroo: Remove unnecessary checks
Date: Fri,  8 May 2015 12:50:49 +0200	[thread overview]
Message-ID: <1431082249-18681-8-git-send-email-thierry.reding@gmail.com> (raw)
In-Reply-To: <1431082249-18681-1-git-send-email-thierry.reding@gmail.com>

From: Thierry Reding <treding@nvidia.com>

debugfs_remove() gracefully ignores NULL parameters, so the explicit
checks can be removed.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpu/vga/vga_switcheroo.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

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)
-- 
2.3.5


      parent reply	other threads:[~2015-05-08 10:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08 10:50 [PATCH 0/7] vga: Miscellaneous cleanups Thierry Reding
2015-05-08 10:50 ` [PATCH 1/7] vgaarb: Use vgaarb: prefix consistently in messages Thierry Reding
2015-05-08 10:50 ` [PATCH 2/7] vgaarb: Fix a few checkpatch errors and warnings Thierry Reding
2015-05-08 10:50 ` [PATCH 3/7] vga_switcheroo: Use pr_*() instead of printk() Thierry Reding
2015-05-08 10:50 ` [PATCH 4/7] vga_switcheroo: Cleanup header comment Thierry Reding
2015-05-08 10:50 ` [PATCH 5/7] vga_switcheroo: Use pr_fmt() Thierry Reding
2015-05-08 10:50 ` [PATCH 6/7] vga_switcheroo: Wrap overly long lines Thierry Reding
2015-05-08 10:50 ` Thierry Reding [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431082249-18681-8-git-send-email-thierry.reding@gmail.com \
    --to=thierry.reding@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®