aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhu Yanjun <yanjun.zhu@oracle.com>2017-03-03 00:44:26 -0500
committerDavid S. Miller <davem@davemloft.net>2017-03-03 12:51:22 -0500
commita8d63a53b3eac8626f62336dcc327c18f1bbca78 (patch)
tree774e26f9fd85f6bc59afad87104dd99f8633dee3
parent37411cad633f5e41f8a13007654909d21b19363a (diff)
rds: remove unnecessary returned value check
The function rds_trans_register always returns 0. As such, it is not necessary to check the returned value. Cc: Joe Jin <joe.jin@oracle.com> Cc: Junxiao Bi <junxiao.bi@oracle.com> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/rds/ib.c6
-rw-r--r--net/rds/rds.h2
-rw-r--r--net/rds/tcp.c6
-rw-r--r--net/rds/transport.c4
4 files changed, 4 insertions, 14 deletions
diff --git a/net/rds/ib.c b/net/rds/ib.c
index 0f557b243311..7a64c8db81ab 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -438,16 +438,12 @@ int rds_ib_init(void)
438 if (ret) 438 if (ret)
439 goto out_sysctl; 439 goto out_sysctl;
440 440
441 ret = rds_trans_register(&rds_ib_transport); 441 rds_trans_register(&rds_ib_transport);
442 if (ret)
443 goto out_recv;
444 442
445 rds_info_register_func(RDS_INFO_IB_CONNECTIONS, rds_ib_ic_info); 443 rds_info_register_func(RDS_INFO_IB_CONNECTIONS, rds_ib_ic_info);
446 444
447 goto out; 445 goto out;
448 446
449out_recv:
450 rds_ib_recv_exit();
451out_sysctl: 447out_sysctl:
452 rds_ib_sysctl_exit(); 448 rds_ib_sysctl_exit();
453out_ibreg: 449out_ibreg:
diff --git a/net/rds/rds.h b/net/rds/rds.h
index 07fff73dd4f3..6f523ddfe1fb 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -910,7 +910,7 @@ void rds_connect_path_complete(struct rds_conn_path *conn, int curr);
910void rds_connect_complete(struct rds_connection *conn); 910void rds_connect_complete(struct rds_connection *conn);
911 911
912/* transport.c */ 912/* transport.c */
913int rds_trans_register(struct rds_transport *trans); 913void rds_trans_register(struct rds_transport *trans);
914void rds_trans_unregister(struct rds_transport *trans); 914void rds_trans_unregister(struct rds_transport *trans);
915struct rds_transport *rds_trans_get_preferred(struct net *net, __be32 addr); 915struct rds_transport *rds_trans_get_preferred(struct net *net, __be32 addr);
916void rds_trans_put(struct rds_transport *trans); 916void rds_trans_put(struct rds_transport *trans);
diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index 5438f6725092..a973d3b4dff0 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
@@ -652,16 +652,12 @@ static int rds_tcp_init(void)
652 if (ret) 652 if (ret)
653 goto out_pernet; 653 goto out_pernet;
654 654
655 ret = rds_trans_register(&rds_tcp_transport); 655 rds_trans_register(&rds_tcp_transport);
656 if (ret)
657 goto out_recv;
658 656
659 rds_info_register_func(RDS_INFO_TCP_SOCKETS, rds_tcp_tc_info); 657 rds_info_register_func(RDS_INFO_TCP_SOCKETS, rds_tcp_tc_info);
660 658
661 goto out; 659 goto out;
662 660
663out_recv:
664 rds_tcp_recv_exit();
665out_pernet: 661out_pernet:
666 unregister_pernet_subsys(&rds_tcp_net_ops); 662 unregister_pernet_subsys(&rds_tcp_net_ops);
667out_notifier: 663out_notifier:
diff --git a/net/rds/transport.c b/net/rds/transport.c
index 2ffd3e30c643..0b188dd0a344 100644
--- a/net/rds/transport.c
+++ b/net/rds/transport.c
@@ -40,7 +40,7 @@
40static struct rds_transport *transports[RDS_TRANS_COUNT]; 40static struct rds_transport *transports[RDS_TRANS_COUNT];
41static DECLARE_RWSEM(rds_trans_sem); 41static DECLARE_RWSEM(rds_trans_sem);
42 42
43int rds_trans_register(struct rds_transport *trans) 43void rds_trans_register(struct rds_transport *trans)
44{ 44{
45 BUG_ON(strlen(trans->t_name) + 1 > TRANSNAMSIZ); 45 BUG_ON(strlen(trans->t_name) + 1 > TRANSNAMSIZ);
46 46
@@ -55,8 +55,6 @@ int rds_trans_register(struct rds_transport *trans)
55 } 55 }
56 56
57 up_write(&rds_trans_sem); 57 up_write(&rds_trans_sem);
58
59 return 0;
60} 58}
61EXPORT_SYMBOL_GPL(rds_trans_register); 59EXPORT_SYMBOL_GPL(rds_trans_register);
62 60