diff options
author | Xin Long <lucien.xin@gmail.com> | 2017-08-05 08:00:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-07 00:33:42 -0400 |
commit | 61f0eb072294a148f707335d4d7f858b2af73770 (patch) | |
tree | 60607bb7a36c73e809634de8e29a67da7023bf63 | |
parent | 19cd1592a24754e16d48398812d5f69b63f674dd (diff) |
sctp: remove the typedef sctp_event_t
This patch is to remove the typedef sctp_event_t, and
replace with enum sctp_event in the places where it's
using this typedef.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/sctp/constants.h | 6 | ||||
-rw-r--r-- | include/net/sctp/sm.h | 12 | ||||
-rw-r--r-- | net/sctp/primitive.c | 2 | ||||
-rw-r--r-- | net/sctp/sm_sideeffect.c | 20 | ||||
-rw-r--r-- | net/sctp/sm_statetable.c | 2 |
5 files changed, 18 insertions, 24 deletions
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index fb931f07e83a..3181e0f95b60 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -71,14 +71,12 @@ enum { SCTP_DEFAULT_INSTREAMS = SCTP_MAX_STREAM }; | |||
71 | SCTP_NUM_AUTH_CHUNK_TYPES) | 71 | SCTP_NUM_AUTH_CHUNK_TYPES) |
72 | 72 | ||
73 | /* These are the different flavours of event. */ | 73 | /* These are the different flavours of event. */ |
74 | typedef enum { | 74 | enum sctp_event { |
75 | |||
76 | SCTP_EVENT_T_CHUNK = 1, | 75 | SCTP_EVENT_T_CHUNK = 1, |
77 | SCTP_EVENT_T_TIMEOUT, | 76 | SCTP_EVENT_T_TIMEOUT, |
78 | SCTP_EVENT_T_OTHER, | 77 | SCTP_EVENT_T_OTHER, |
79 | SCTP_EVENT_T_PRIMITIVE | 78 | SCTP_EVENT_T_PRIMITIVE |
80 | 79 | }; | |
81 | } sctp_event_t; | ||
82 | 80 | ||
83 | /* As a convenience for the state machine, we append SCTP_EVENT_* and | 81 | /* As a convenience for the state machine, we append SCTP_EVENT_* and |
84 | * SCTP_ULP_* to the list of possible chunks. | 82 | * SCTP_ULP_* to the list of possible chunks. |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 281e8d1e0752..96f54cff7964 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -176,7 +176,7 @@ sctp_state_fn_t sctp_sf_autoclose_timer_expire; | |||
176 | /* Prototypes for utility support functions. */ | 176 | /* Prototypes for utility support functions. */ |
177 | __u8 sctp_get_chunk_type(struct sctp_chunk *chunk); | 177 | __u8 sctp_get_chunk_type(struct sctp_chunk *chunk); |
178 | const sctp_sm_table_entry_t *sctp_sm_lookup_event(struct net *net, | 178 | const sctp_sm_table_entry_t *sctp_sm_lookup_event(struct net *net, |
179 | sctp_event_t event_type, | 179 | enum sctp_event event_type, |
180 | enum sctp_state state, | 180 | enum sctp_state state, |
181 | sctp_subtype_t event_subtype); | 181 | sctp_subtype_t event_subtype); |
182 | int sctp_chunk_iif(const struct sctp_chunk *); | 182 | int sctp_chunk_iif(const struct sctp_chunk *); |
@@ -312,12 +312,10 @@ struct sctp_chunk *sctp_process_strreset_resp( | |||
312 | 312 | ||
313 | /* Prototypes for statetable processing. */ | 313 | /* Prototypes for statetable processing. */ |
314 | 314 | ||
315 | int sctp_do_sm(struct net *net, sctp_event_t event_type, sctp_subtype_t subtype, | 315 | int sctp_do_sm(struct net *net, enum sctp_event event_type, |
316 | enum sctp_state state, | 316 | sctp_subtype_t subtype, enum sctp_state state, |
317 | struct sctp_endpoint *, | 317 | struct sctp_endpoint *ep, struct sctp_association *asoc, |
318 | struct sctp_association *asoc, | 318 | void *event_arg, gfp_t gfp); |
319 | void *event_arg, | ||
320 | gfp_t gfp); | ||
321 | 319 | ||
322 | /* 2nd level prototypes */ | 320 | /* 2nd level prototypes */ |
323 | void sctp_generate_t3_rtx_event(unsigned long peer); | 321 | void sctp_generate_t3_rtx_event(unsigned long peer); |
diff --git a/net/sctp/primitive.c b/net/sctp/primitive.c index 1fb5b9bb3c6d..c914166984b3 100644 --- a/net/sctp/primitive.c +++ b/net/sctp/primitive.c | |||
@@ -53,7 +53,7 @@ | |||
53 | int sctp_primitive_ ## name(struct net *net, struct sctp_association *asoc, \ | 53 | int sctp_primitive_ ## name(struct net *net, struct sctp_association *asoc, \ |
54 | void *arg) { \ | 54 | void *arg) { \ |
55 | int error = 0; \ | 55 | int error = 0; \ |
56 | sctp_event_t event_type; sctp_subtype_t subtype; \ | 56 | enum sctp_event event_type; sctp_subtype_t subtype; \ |
57 | enum sctp_state state; \ | 57 | enum sctp_state state; \ |
58 | struct sctp_endpoint *ep; \ | 58 | struct sctp_endpoint *ep; \ |
59 | \ | 59 | \ |
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 11a344896b71..b545c768cb9e 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include <net/sctp/sctp.h> | 51 | #include <net/sctp/sctp.h> |
52 | #include <net/sctp/sm.h> | 52 | #include <net/sctp/sm.h> |
53 | 53 | ||
54 | static int sctp_cmd_interpreter(sctp_event_t event_type, | 54 | static int sctp_cmd_interpreter(enum sctp_event event_type, |
55 | sctp_subtype_t subtype, | 55 | sctp_subtype_t subtype, |
56 | enum sctp_state state, | 56 | enum sctp_state state, |
57 | struct sctp_endpoint *ep, | 57 | struct sctp_endpoint *ep, |
@@ -60,7 +60,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, | |||
60 | sctp_disposition_t status, | 60 | sctp_disposition_t status, |
61 | sctp_cmd_seq_t *commands, | 61 | sctp_cmd_seq_t *commands, |
62 | gfp_t gfp); | 62 | gfp_t gfp); |
63 | static int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype, | 63 | static int sctp_side_effects(enum sctp_event event_type, sctp_subtype_t subtype, |
64 | enum sctp_state state, | 64 | enum sctp_state state, |
65 | struct sctp_endpoint *ep, | 65 | struct sctp_endpoint *ep, |
66 | struct sctp_association **asoc, | 66 | struct sctp_association **asoc, |
@@ -602,7 +602,7 @@ static void sctp_cmd_init_failed(sctp_cmd_seq_t *commands, | |||
602 | /* Worker routine to handle SCTP_CMD_ASSOC_FAILED. */ | 602 | /* Worker routine to handle SCTP_CMD_ASSOC_FAILED. */ |
603 | static void sctp_cmd_assoc_failed(sctp_cmd_seq_t *commands, | 603 | static void sctp_cmd_assoc_failed(sctp_cmd_seq_t *commands, |
604 | struct sctp_association *asoc, | 604 | struct sctp_association *asoc, |
605 | sctp_event_t event_type, | 605 | enum sctp_event event_type, |
606 | sctp_subtype_t subtype, | 606 | sctp_subtype_t subtype, |
607 | struct sctp_chunk *chunk, | 607 | struct sctp_chunk *chunk, |
608 | unsigned int error) | 608 | unsigned int error) |
@@ -1139,12 +1139,10 @@ static void sctp_cmd_send_asconf(struct sctp_association *asoc) | |||
1139 | * If you want to understand all of lksctp, this is a | 1139 | * If you want to understand all of lksctp, this is a |
1140 | * good place to start. | 1140 | * good place to start. |
1141 | */ | 1141 | */ |
1142 | int sctp_do_sm(struct net *net, sctp_event_t event_type, sctp_subtype_t subtype, | 1142 | int sctp_do_sm(struct net *net, enum sctp_event event_type, |
1143 | enum sctp_state state, | 1143 | sctp_subtype_t subtype, enum sctp_state state, |
1144 | struct sctp_endpoint *ep, | 1144 | struct sctp_endpoint *ep, struct sctp_association *asoc, |
1145 | struct sctp_association *asoc, | 1145 | void *event_arg, gfp_t gfp) |
1146 | void *event_arg, | ||
1147 | gfp_t gfp) | ||
1148 | { | 1146 | { |
1149 | sctp_cmd_seq_t commands; | 1147 | sctp_cmd_seq_t commands; |
1150 | const sctp_sm_table_entry_t *state_fn; | 1148 | const sctp_sm_table_entry_t *state_fn; |
@@ -1178,7 +1176,7 @@ int sctp_do_sm(struct net *net, sctp_event_t event_type, sctp_subtype_t subtype, | |||
1178 | /***************************************************************** | 1176 | /***************************************************************** |
1179 | * This the master state function side effect processing function. | 1177 | * This the master state function side effect processing function. |
1180 | *****************************************************************/ | 1178 | *****************************************************************/ |
1181 | static int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype, | 1179 | static int sctp_side_effects(enum sctp_event event_type, sctp_subtype_t subtype, |
1182 | enum sctp_state state, | 1180 | enum sctp_state state, |
1183 | struct sctp_endpoint *ep, | 1181 | struct sctp_endpoint *ep, |
1184 | struct sctp_association **asoc, | 1182 | struct sctp_association **asoc, |
@@ -1263,7 +1261,7 @@ bail: | |||
1263 | ********************************************************************/ | 1261 | ********************************************************************/ |
1264 | 1262 | ||
1265 | /* This is the side-effect interpreter. */ | 1263 | /* This is the side-effect interpreter. */ |
1266 | static int sctp_cmd_interpreter(sctp_event_t event_type, | 1264 | static int sctp_cmd_interpreter(enum sctp_event event_type, |
1267 | sctp_subtype_t subtype, | 1265 | sctp_subtype_t subtype, |
1268 | enum sctp_state state, | 1266 | enum sctp_state state, |
1269 | struct sctp_endpoint *ep, | 1267 | struct sctp_endpoint *ep, |
diff --git a/net/sctp/sm_statetable.c b/net/sctp/sm_statetable.c index f46c11bffea7..f7cdb7014244 100644 --- a/net/sctp/sm_statetable.c +++ b/net/sctp/sm_statetable.c | |||
@@ -78,7 +78,7 @@ static const sctp_sm_table_entry_t bug = { | |||
78 | }) | 78 | }) |
79 | 79 | ||
80 | const sctp_sm_table_entry_t *sctp_sm_lookup_event(struct net *net, | 80 | const sctp_sm_table_entry_t *sctp_sm_lookup_event(struct net *net, |
81 | sctp_event_t event_type, | 81 | enum sctp_event event_type, |
82 | enum sctp_state state, | 82 | enum sctp_state state, |
83 | sctp_subtype_t event_subtype) | 83 | sctp_subtype_t event_subtype) |
84 | { | 84 | { |