diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2006-03-20 20:20:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-20 20:20:23 -0500 |
commit | 411447019ab583c659600b0519db5658a2444f11 (patch) | |
tree | 3bf3e7c655c91097cead92c65334a4ebbb51906e /net | |
parent | 02bcf28c82c8e4b72c4b89bddbbb6fea1a646d07 (diff) |
[DCCP] CCID: Allow ccid_{init,exit} to be NULL
Testing if the ccid being instantiated has these methods in
ccid_init().
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/dccp/ccid.c | 5 | ||||
-rw-r--r-- | net/dccp/ccids/ccid3.c | 11 |
2 files changed, 1 insertions, 15 deletions
diff --git a/net/dccp/ccid.c b/net/dccp/ccid.c index 9d8fc0e289ea..06b191a5740b 100644 --- a/net/dccp/ccid.c +++ b/net/dccp/ccid.c | |||
@@ -59,9 +59,6 @@ int ccid_register(struct ccid *ccid) | |||
59 | { | 59 | { |
60 | int err; | 60 | int err; |
61 | 61 | ||
62 | if (ccid->ccid_init == NULL) | ||
63 | return -1; | ||
64 | |||
65 | ccids_write_lock(); | 62 | ccids_write_lock(); |
66 | err = -EEXIST; | 63 | err = -EEXIST; |
67 | if (ccids[ccid->ccid_id] == NULL) { | 64 | if (ccids[ccid->ccid_id] == NULL) { |
@@ -106,7 +103,7 @@ struct ccid *ccid_init(unsigned char id, struct sock *sk) | |||
106 | if (!try_module_get(ccid->ccid_owner)) | 103 | if (!try_module_get(ccid->ccid_owner)) |
107 | goto out_err; | 104 | goto out_err; |
108 | 105 | ||
109 | if (ccid->ccid_init(sk) != 0) | 106 | if (ccid->ccid_init != NULL && ccid->ccid_init(sk) != 0) |
110 | goto out_module_put; | 107 | goto out_module_put; |
111 | out: | 108 | out: |
112 | ccids_read_unlock(); | 109 | ccids_read_unlock(); |
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index 35d1d347541c..3c4779fa9432 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -76,15 +76,6 @@ static struct dccp_tx_hist *ccid3_tx_hist; | |||
76 | static struct dccp_rx_hist *ccid3_rx_hist; | 76 | static struct dccp_rx_hist *ccid3_rx_hist; |
77 | static struct dccp_li_hist *ccid3_li_hist; | 77 | static struct dccp_li_hist *ccid3_li_hist; |
78 | 78 | ||
79 | static int ccid3_init(struct sock *sk) | ||
80 | { | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | static void ccid3_exit(struct sock *sk) | ||
85 | { | ||
86 | } | ||
87 | |||
88 | /* TFRC sender states */ | 79 | /* TFRC sender states */ |
89 | enum ccid3_hc_tx_states { | 80 | enum ccid3_hc_tx_states { |
90 | TFRC_SSTATE_NO_SENT = 1, | 81 | TFRC_SSTATE_NO_SENT = 1, |
@@ -1182,8 +1173,6 @@ static struct ccid ccid3 = { | |||
1182 | .ccid_id = 3, | 1173 | .ccid_id = 3, |
1183 | .ccid_name = "ccid3", | 1174 | .ccid_name = "ccid3", |
1184 | .ccid_owner = THIS_MODULE, | 1175 | .ccid_owner = THIS_MODULE, |
1185 | .ccid_init = ccid3_init, | ||
1186 | .ccid_exit = ccid3_exit, | ||
1187 | .ccid_hc_tx_init = ccid3_hc_tx_init, | 1176 | .ccid_hc_tx_init = ccid3_hc_tx_init, |
1188 | .ccid_hc_tx_exit = ccid3_hc_tx_exit, | 1177 | .ccid_hc_tx_exit = ccid3_hc_tx_exit, |
1189 | .ccid_hc_tx_send_packet = ccid3_hc_tx_send_packet, | 1178 | .ccid_hc_tx_send_packet = ccid3_hc_tx_send_packet, |