Skip to content

Commit a85bbeb

Browse files
lxindavem330
authored andcommitted
sctp: remove the typedef sctp_cmd_seq_t
This patch is to remove the typedef sctp_cmd_seq_t, and replace with struct sctp_cmd_seq in the places where it's using this typedef. Note that it doesn't fix many indents although it should, as sctp_disposition_t's removal would mess them up again. So better to fix them when removing sctp_disposition_t in the later patch. Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e2c3108 commit a85bbeb

5 files changed

Lines changed: 145 additions & 143 deletions

File tree

‎include/net/sctp/command.h‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ typedef enum {
110110
SCTP_CMD_LAST
111111
} sctp_verb_t;
112112

113-
/* How many commands can you put in an sctp_cmd_seq_t?
113+
/* How many commands can you put in an struct sctp_cmd_seq?
114114
* This is a rather arbitrary number, ideally derived from a careful
115115
* analysis of the state functions, but in reality just taken from
116116
* thin air in the hopes othat we don't trigger a kernel panic.
@@ -201,17 +201,17 @@ struct sctp_cmd {
201201
sctp_verb_t verb;
202202
};
203203

204-
typedef struct {
204+
struct sctp_cmd_seq {
205205
struct sctp_cmd cmds[SCTP_MAX_NUM_COMMANDS];
206206
struct sctp_cmd *last_used_slot;
207207
struct sctp_cmd *next_cmd;
208-
} sctp_cmd_seq_t;
208+
};
209209

210210

211211
/* Initialize a block of memory as a command sequence.
212212
* Return 0 if the initialization fails.
213213
*/
214-
static inline int sctp_init_cmd_seq(sctp_cmd_seq_t *seq)
214+
static inline int sctp_init_cmd_seq(struct sctp_cmd_seq *seq)
215215
{
216216
/* cmds[] is filled backwards to simplify the overflow BUG() check */
217217
seq->last_used_slot = seq->cmds + SCTP_MAX_NUM_COMMANDS;
@@ -220,12 +220,12 @@ static inline int sctp_init_cmd_seq(sctp_cmd_seq_t *seq)
220220
}
221221

222222

223-
/* Add a command to an sctp_cmd_seq_t.
223+
/* Add a command to an struct sctp_cmd_seq.
224224
*
225225
* Use the SCTP_* constructors defined by SCTP_ARG_CONSTRUCTOR() above
226226
* to wrap data which goes in the obj argument.
227227
*/
228-
static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb,
228+
static inline void sctp_add_cmd_sf(struct sctp_cmd_seq *seq, sctp_verb_t verb,
229229
sctp_arg_t obj)
230230
{
231231
struct sctp_cmd *cmd = seq->last_used_slot - 1;
@@ -240,7 +240,7 @@ static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb,
240240
/* Return the next command structure in an sctp_cmd_seq.
241241
* Return NULL at the end of the sequence.
242242
*/
243-
static inline struct sctp_cmd *sctp_next_cmd(sctp_cmd_seq_t *seq)
243+
static inline struct sctp_cmd *sctp_next_cmd(struct sctp_cmd_seq *seq)
244244
{
245245
if (seq->next_cmd <= seq->last_used_slot)
246246
return NULL;

‎include/net/sctp/sm.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ typedef sctp_disposition_t (sctp_state_fn_t) (struct net *,
7575
const struct sctp_association *,
7676
const union sctp_subtype type,
7777
void *arg,
78-
sctp_cmd_seq_t *);
78+
struct sctp_cmd_seq *);
7979
typedef void (sctp_timer_event_t) (unsigned long);
8080
typedef struct {
8181
sctp_state_fn_t *fn;

‎net/sctp/probe.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static sctp_disposition_t jsctp_sf_eat_sack(struct net *net,
132132
const struct sctp_association *asoc,
133133
const union sctp_subtype type,
134134
void *arg,
135-
sctp_cmd_seq_t *commands)
135+
struct sctp_cmd_seq *commands)
136136
{
137137
struct sctp_chunk *chunk = arg;
138138
struct sk_buff *skb = chunk->skb;

‎net/sctp/sm_sideeffect.c‎

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int sctp_cmd_interpreter(enum sctp_event event_type,
5858
struct sctp_association *asoc,
5959
void *event_arg,
6060
sctp_disposition_t status,
61-
sctp_cmd_seq_t *commands,
61+
struct sctp_cmd_seq *commands,
6262
gfp_t gfp);
6363
static int sctp_side_effects(enum sctp_event event_type,
6464
union sctp_subtype subtype,
@@ -67,7 +67,7 @@ static int sctp_side_effects(enum sctp_event event_type,
6767
struct sctp_association **asoc,
6868
void *event_arg,
6969
sctp_disposition_t status,
70-
sctp_cmd_seq_t *commands,
70+
struct sctp_cmd_seq *commands,
7171
gfp_t gfp);
7272

7373
/********************************************************************
@@ -150,7 +150,7 @@ static void sctp_do_ecn_cwr_work(struct sctp_association *asoc,
150150

151151
/* Generate SACK if necessary. We call this at the end of a packet. */
152152
static int sctp_gen_sack(struct sctp_association *asoc, int force,
153-
sctp_cmd_seq_t *commands)
153+
struct sctp_cmd_seq *commands)
154154
{
155155
__u32 ctsn, max_tsn_seen;
156156
struct sctp_chunk *sack;
@@ -506,7 +506,7 @@ sctp_timer_event_t *sctp_timer_events[SCTP_NUM_TIMEOUT_TYPES] = {
506506
* notification SHOULD be sent to the upper layer.
507507
*
508508
*/
509-
static void sctp_do_8_2_transport_strike(sctp_cmd_seq_t *commands,
509+
static void sctp_do_8_2_transport_strike(struct sctp_cmd_seq *commands,
510510
struct sctp_association *asoc,
511511
struct sctp_transport *transport,
512512
int is_hb)
@@ -578,7 +578,7 @@ static void sctp_do_8_2_transport_strike(sctp_cmd_seq_t *commands,
578578
}
579579

580580
/* Worker routine to handle INIT command failure. */
581-
static void sctp_cmd_init_failed(sctp_cmd_seq_t *commands,
581+
static void sctp_cmd_init_failed(struct sctp_cmd_seq *commands,
582582
struct sctp_association *asoc,
583583
unsigned int error)
584584
{
@@ -601,7 +601,7 @@ static void sctp_cmd_init_failed(sctp_cmd_seq_t *commands,
601601
}
602602

603603
/* Worker routine to handle SCTP_CMD_ASSOC_FAILED. */
604-
static void sctp_cmd_assoc_failed(sctp_cmd_seq_t *commands,
604+
static void sctp_cmd_assoc_failed(struct sctp_cmd_seq *commands,
605605
struct sctp_association *asoc,
606606
enum sctp_event event_type,
607607
union sctp_subtype subtype,
@@ -645,7 +645,7 @@ static void sctp_cmd_assoc_failed(sctp_cmd_seq_t *commands,
645645
* since all other cases use "temporary" associations and can do all
646646
* their work in statefuns directly.
647647
*/
648-
static int sctp_cmd_process_init(sctp_cmd_seq_t *commands,
648+
static int sctp_cmd_process_init(struct sctp_cmd_seq *commands,
649649
struct sctp_association *asoc,
650650
struct sctp_chunk *chunk,
651651
struct sctp_init_chunk *peer_init,
@@ -667,7 +667,7 @@ static int sctp_cmd_process_init(sctp_cmd_seq_t *commands,
667667
}
668668

669669
/* Helper function to break out starting up of heartbeat timers. */
670-
static void sctp_cmd_hb_timers_start(sctp_cmd_seq_t *cmds,
670+
static void sctp_cmd_hb_timers_start(struct sctp_cmd_seq *cmds,
671671
struct sctp_association *asoc)
672672
{
673673
struct sctp_transport *t;
@@ -680,7 +680,7 @@ static void sctp_cmd_hb_timers_start(sctp_cmd_seq_t *cmds,
680680
sctp_transport_reset_hb_timer(t);
681681
}
682682

683-
static void sctp_cmd_hb_timers_stop(sctp_cmd_seq_t *cmds,
683+
static void sctp_cmd_hb_timers_stop(struct sctp_cmd_seq *cmds,
684684
struct sctp_association *asoc)
685685
{
686686
struct sctp_transport *t;
@@ -695,7 +695,7 @@ static void sctp_cmd_hb_timers_stop(sctp_cmd_seq_t *cmds,
695695
}
696696

697697
/* Helper function to stop any pending T3-RTX timers */
698-
static void sctp_cmd_t3_rtx_timers_stop(sctp_cmd_seq_t *cmds,
698+
static void sctp_cmd_t3_rtx_timers_stop(struct sctp_cmd_seq *cmds,
699699
struct sctp_association *asoc)
700700
{
701701
struct sctp_transport *t;
@@ -709,7 +709,7 @@ static void sctp_cmd_t3_rtx_timers_stop(sctp_cmd_seq_t *cmds,
709709

710710

711711
/* Helper function to handle the reception of an HEARTBEAT ACK. */
712-
static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
712+
static void sctp_cmd_transport_on(struct sctp_cmd_seq *cmds,
713713
struct sctp_association *asoc,
714714
struct sctp_transport *t,
715715
struct sctp_chunk *chunk)
@@ -780,7 +780,7 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
780780

781781

782782
/* Helper function to process the process SACK command. */
783-
static int sctp_cmd_process_sack(sctp_cmd_seq_t *cmds,
783+
static int sctp_cmd_process_sack(struct sctp_cmd_seq *cmds,
784784
struct sctp_association *asoc,
785785
struct sctp_chunk *chunk)
786786
{
@@ -802,7 +802,7 @@ static int sctp_cmd_process_sack(sctp_cmd_seq_t *cmds,
802802
/* Helper function to set the timeout value for T2-SHUTDOWN timer and to set
803803
* the transport for a shutdown chunk.
804804
*/
805-
static void sctp_cmd_setup_t2(sctp_cmd_seq_t *cmds,
805+
static void sctp_cmd_setup_t2(struct sctp_cmd_seq *cmds,
806806
struct sctp_association *asoc,
807807
struct sctp_chunk *chunk)
808808
{
@@ -819,7 +819,7 @@ static void sctp_cmd_setup_t2(sctp_cmd_seq_t *cmds,
819819
asoc->timeouts[SCTP_EVENT_TIMEOUT_T2_SHUTDOWN] = t->rto;
820820
}
821821

822-
static void sctp_cmd_assoc_update(sctp_cmd_seq_t *cmds,
822+
static void sctp_cmd_assoc_update(struct sctp_cmd_seq *cmds,
823823
struct sctp_association *asoc,
824824
struct sctp_association *new)
825825
{
@@ -842,7 +842,7 @@ static void sctp_cmd_assoc_update(sctp_cmd_seq_t *cmds,
842842
}
843843

844844
/* Helper function to change the state of an association. */
845-
static void sctp_cmd_new_state(sctp_cmd_seq_t *cmds,
845+
static void sctp_cmd_new_state(struct sctp_cmd_seq *cmds,
846846
struct sctp_association *asoc,
847847
enum sctp_state state)
848848
{
@@ -902,7 +902,7 @@ static void sctp_cmd_new_state(sctp_cmd_seq_t *cmds,
902902
}
903903

904904
/* Helper function to delete an association. */
905-
static void sctp_cmd_delete_tcb(sctp_cmd_seq_t *cmds,
905+
static void sctp_cmd_delete_tcb(struct sctp_cmd_seq *cmds,
906906
struct sctp_association *asoc)
907907
{
908908
struct sock *sk = asoc->base.sk;
@@ -924,9 +924,9 @@ static void sctp_cmd_delete_tcb(sctp_cmd_seq_t *cmds,
924924
* destination address (we use active path instead of primary path just
925925
* because primary path may be inactive.
926926
*/
927-
static void sctp_cmd_setup_t4(sctp_cmd_seq_t *cmds,
928-
struct sctp_association *asoc,
929-
struct sctp_chunk *chunk)
927+
static void sctp_cmd_setup_t4(struct sctp_cmd_seq *cmds,
928+
struct sctp_association *asoc,
929+
struct sctp_chunk *chunk)
930930
{
931931
struct sctp_transport *t;
932932

@@ -936,7 +936,7 @@ static void sctp_cmd_setup_t4(sctp_cmd_seq_t *cmds,
936936
}
937937

938938
/* Process an incoming Operation Error Chunk. */
939-
static void sctp_cmd_process_operr(sctp_cmd_seq_t *cmds,
939+
static void sctp_cmd_process_operr(struct sctp_cmd_seq *cmds,
940940
struct sctp_association *asoc,
941941
struct sctp_chunk *chunk)
942942
{
@@ -1025,9 +1025,9 @@ static void sctp_cmd_set_sk_err(struct sctp_association *asoc, int error)
10251025
}
10261026

10271027
/* Helper function to generate an association change event */
1028-
static void sctp_cmd_assoc_change(sctp_cmd_seq_t *commands,
1029-
struct sctp_association *asoc,
1030-
u8 state)
1028+
static void sctp_cmd_assoc_change(struct sctp_cmd_seq *commands,
1029+
struct sctp_association *asoc,
1030+
u8 state)
10311031
{
10321032
struct sctp_ulpevent *ev;
10331033

@@ -1040,7 +1040,7 @@ static void sctp_cmd_assoc_change(sctp_cmd_seq_t *commands,
10401040
}
10411041

10421042
/* Helper function to generate an adaptation indication event */
1043-
static void sctp_cmd_adaptation_ind(sctp_cmd_seq_t *commands,
1043+
static void sctp_cmd_adaptation_ind(struct sctp_cmd_seq *commands,
10441044
struct sctp_association *asoc)
10451045
{
10461046
struct sctp_ulpevent *ev;
@@ -1145,7 +1145,7 @@ int sctp_do_sm(struct net *net, enum sctp_event event_type,
11451145
struct sctp_endpoint *ep, struct sctp_association *asoc,
11461146
void *event_arg, gfp_t gfp)
11471147
{
1148-
sctp_cmd_seq_t commands;
1148+
struct sctp_cmd_seq commands;
11491149
const sctp_sm_table_entry_t *state_fn;
11501150
sctp_disposition_t status;
11511151
int error = 0;
@@ -1184,7 +1184,7 @@ static int sctp_side_effects(enum sctp_event event_type,
11841184
struct sctp_association **asoc,
11851185
void *event_arg,
11861186
sctp_disposition_t status,
1187-
sctp_cmd_seq_t *commands,
1187+
struct sctp_cmd_seq *commands,
11881188
gfp_t gfp)
11891189
{
11901190
int error;
@@ -1270,7 +1270,7 @@ static int sctp_cmd_interpreter(enum sctp_event event_type,
12701270
struct sctp_association *asoc,
12711271
void *event_arg,
12721272
sctp_disposition_t status,
1273-
sctp_cmd_seq_t *commands,
1273+
struct sctp_cmd_seq *commands,
12741274
gfp_t gfp)
12751275
{
12761276
struct sock *sk = ep->base.sk;

0 commit comments

Comments
 (0)