lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1490598390-13812-4-git-send-email-yanjun.zhu@oracle.com>
Date:   Mon, 27 Mar 2017 03:06:28 -0400
From:   Zhu Yanjun <yanjun.zhu@...cle.com>
To:     yanjun.zhu@...cle.com, santosh.shilimkar@...cle.com,
        netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
        rds-devel@....oracle.com, junxiao.bi@...cle.com, joe.jin@...cle.com
Subject: [PATCH 3/5] rds: remove unnecessary returned value check

In the function rds_stats_init, the returned value
is always zero. As such, it is not necessary to check it.
And change the return type to void.

Signed-off-by: Zhu Yanjun <yanjun.zhu@...cle.com>
---
 net/rds/af_rds.c | 5 +----
 net/rds/rds.h    | 2 +-
 net/rds/stats.c  | 3 +--
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
index b405f77..a696096 100644
--- a/net/rds/af_rds.c
+++ b/net/rds/af_rds.c
@@ -658,9 +658,7 @@ static int rds_init(void)
 	ret = rds_sysctl_init();
 	if (ret)
 		goto out_threads;
-	ret = rds_stats_init();
-	if (ret)
-		goto out_sysctl;
+	rds_stats_init();
 	ret = proto_register(&rds_proto, 1);
 	if (ret)
 		goto out_stats;
@@ -677,7 +675,6 @@ static int rds_init(void)
 	proto_unregister(&rds_proto);
 out_stats:
 	rds_stats_exit();
-out_sysctl:
 	rds_sysctl_exit();
 out_threads:
 	rds_threads_exit();
diff --git a/net/rds/rds.h b/net/rds/rds.h
index 82d38cc..82a8856 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -870,7 +870,7 @@ DECLARE_PER_CPU_SHARED_ALIGNED(struct rds_statistics, rds_stats);
 	put_cpu();					\
 } while (0)
 #define rds_stats_add(member, count) rds_stats_add_which(rds_stats, member, count)
-int rds_stats_init(void);
+void rds_stats_init(void);
 void rds_stats_exit(void);
 void rds_stats_info_copy(struct rds_info_iterator *iter,
 			 uint64_t *values, const char *const *names,
diff --git a/net/rds/stats.c b/net/rds/stats.c
index 73be187..e83b4bb 100644
--- a/net/rds/stats.c
+++ b/net/rds/stats.c
@@ -145,8 +145,7 @@ void rds_stats_exit(void)
 	rds_info_deregister_func(RDS_INFO_COUNTERS, rds_stats_info);
 }
 
-int rds_stats_init(void)
+void rds_stats_init(void)
 {
 	rds_info_register_func(RDS_INFO_COUNTERS, rds_stats_info);
-	return 0;
 }
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ