linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cyril Roelandt <tipecaml@gmail.com>
To: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Cc: Cyril Roelandt <tipecaml@gmail.com>,
	gregkh@linuxfoundation.org, wfp5p@virginia.edu,
	tt.rantala@gmail.com, jslaby@suse.cz, sfr@canb.auug.org.au,
	devel@driverdev.osuosl.org
Subject: [PATCH 3/5] staging: dgrp: remove redundant NULL check before unregister_dgrp_device().
Date: Tue, 12 Feb 2013 05:01:51 +0100	[thread overview]
Message-ID: <1360641713-24895-4-git-send-email-tipecaml@gmail.com> (raw)
In-Reply-To: <1360641713-24895-1-git-send-email-tipecaml@gmail.com>


unregister_dgrp_device on a NULL pointer is a no-op, so the NULL checks in
dgrp_remove_nd() can be removed.

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
---
 drivers/staging/dgrp/dgrp_specproc.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/dgrp/dgrp_specproc.c b/drivers/staging/dgrp/dgrp_specproc.c
index dfdaede..13c7ccf 100644
--- a/drivers/staging/dgrp/dgrp_specproc.c
+++ b/drivers/staging/dgrp/dgrp_specproc.c
@@ -777,14 +777,11 @@ static int dgrp_remove_nd(struct nd_struct *nd)
 		dgrp_remove_node_class_sysfs_files(nd);
 	}
 
-	if (nd->nd_mon_de)
-		unregister_dgrp_device(nd->nd_mon_de);
+	unregister_dgrp_device(nd->nd_mon_de);
 
-	if (nd->nd_ports_de)
-		unregister_dgrp_device(nd->nd_ports_de);
+	unregister_dgrp_device(nd->nd_ports_de);
 
-	if (nd->nd_dpa_de)
-		unregister_dgrp_device(nd->nd_dpa_de);
+	unregister_dgrp_device(nd->nd_dpa_de);
 
 	dgrp_tty_uninit(nd);
 
-- 
1.7.10.4


  parent reply	other threads:[~2013-02-12  4:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-12  4:01 [PATCH 0/5] Remove redundant NULL checks Cyril Roelandt
2013-02-12  4:01 ` [PATCH 1/5] radeon: Remove redundant NULL check before radeon_i2c_destroy() Cyril Roelandt
2013-02-12  4:01 ` [PATCH 2/5] iommu: remove redundant NULL check before dma_ops_domain_free() Cyril Roelandt
2013-02-13 11:13   ` Joerg Roedel
2013-02-12  4:01 ` Cyril Roelandt [this message]
2013-02-12  4:01 ` [PATCH 4/5] staging: tidspbridge: remove redundant NULL check before delete_msg_mgr() Cyril Roelandt
2013-02-12  4:01 ` [PATCH 5/5] xen: remove redundant NULL check before unregister_and_remove_pcpu() Cyril Roelandt

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=1360641713-24895-4-git-send-email-tipecaml@gmail.com \
    --to=tipecaml@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=tt.rantala@gmail.com \
    --cc=wfp5p@virginia.edu \
    /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;
as well as URLs for NNTP newsgroup(s).