public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Wang Weidong <wangweidong1@huawei•com>
To: David Miller <davem@davemloft•net>
Cc: <chien.yen@oracle•com>, <rds-devel@oss•oracle.com>,
	<netdev@vger•kernel.org>
Subject: [PATCH net-next] rds: remove the unneed NULL checking
Date: Thu, 8 May 2014 17:01:53 +0800	[thread overview]
Message-ID: <536B4801.9020802@huawei.com> (raw)

unregister_net_sysctl_table will check the ctl_table_header,
so remove the unneed checking

Signed-off-by: Wang Weidong <wangweidong1@huawei•com>
---
 net/rds/iw_sysctl.c | 3 +--
 net/rds/sysctl.c    | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/rds/iw_sysctl.c b/net/rds/iw_sysctl.c
index 89c9151..139239d 100644
--- a/net/rds/iw_sysctl.c
+++ b/net/rds/iw_sysctl.c
@@ -111,8 +111,7 @@ static struct ctl_table rds_iw_sysctl_table[] = {
 
 void rds_iw_sysctl_exit(void)
 {
-	if (rds_iw_sysctl_hdr)
-		unregister_net_sysctl_table(rds_iw_sysctl_hdr);
+	unregister_net_sysctl_table(rds_iw_sysctl_hdr);
 }
 
 int rds_iw_sysctl_init(void)
diff --git a/net/rds/sysctl.c b/net/rds/sysctl.c
index b5cb2aa..c3b0cd4 100644
--- a/net/rds/sysctl.c
+++ b/net/rds/sysctl.c
@@ -94,8 +94,7 @@ static struct ctl_table rds_sysctl_rds_table[] = {
 
 void rds_sysctl_exit(void)
 {
-	if (rds_sysctl_reg_table)
-		unregister_net_sysctl_table(rds_sysctl_reg_table);
+	unregister_net_sysctl_table(rds_sysctl_reg_table);
 }
 
 int rds_sysctl_init(void)
-- 
1.7.12

             reply	other threads:[~2014-05-08  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08  9:01 Wang Weidong [this message]
2014-05-09 20:00 ` [PATCH net-next] rds: remove the unneed NULL checking David Miller

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=536B4801.9020802@huawei.com \
    --to=wangweidong1@huawei$(echo .)com \
    --cc=chien.yen@oracle$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=rds-devel@oss$(echo .)oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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