diff options
author | wangweidong <wangweidong1@huawei.com> | 2013-12-22 23:16:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-26 13:47:47 -0500 |
commit | cb3f837ba95d7774978e86fc17ddf970cf7d15a4 (patch) | |
tree | 6d65728a0446cf0830da1d599f6fcbb45d3d799d /net | |
parent | 4c99aa409a56ae6517b2ae3c23f685d502daa992 (diff) |
sctp: fix checkpatch errors with space required or prohibited
fix checkpatch errors while the space is required or prohibited
to the "=,()++..."
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sctp/auth.c | 6 | ||||
-rw-r--r-- | net/sctp/chunk.c | 4 | ||||
-rw-r--r-- | net/sctp/input.c | 4 | ||||
-rw-r--r-- | net/sctp/ipv6.c | 2 | ||||
-rw-r--r-- | net/sctp/outqueue.c | 8 | ||||
-rw-r--r-- | net/sctp/sm_make_chunk.c | 4 | ||||
-rw-r--r-- | net/sctp/sm_sideeffect.c | 4 | ||||
-rw-r--r-- | net/sctp/sm_statefuns.c | 20 | ||||
-rw-r--r-- | net/sctp/socket.c | 30 | ||||
-rw-r--r-- | net/sctp/ulpqueue.c | 4 |
10 files changed, 43 insertions, 43 deletions
diff --git a/net/sctp/auth.c b/net/sctp/auth.c index 5c9f64c1c906..78767aa20435 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c | |||
@@ -41,7 +41,7 @@ static struct sctp_hmac sctp_hmac_list[SCTP_AUTH_NUM_HMACS] = { | |||
41 | }, | 41 | }, |
42 | { | 42 | { |
43 | .hmac_id = SCTP_AUTH_HMAC_ID_SHA1, | 43 | .hmac_id = SCTP_AUTH_HMAC_ID_SHA1, |
44 | .hmac_name="hmac(sha1)", | 44 | .hmac_name = "hmac(sha1)", |
45 | .hmac_len = SCTP_SHA1_SIG_SIZE, | 45 | .hmac_len = SCTP_SHA1_SIG_SIZE, |
46 | }, | 46 | }, |
47 | { | 47 | { |
@@ -51,7 +51,7 @@ static struct sctp_hmac sctp_hmac_list[SCTP_AUTH_NUM_HMACS] = { | |||
51 | #if defined (CONFIG_CRYPTO_SHA256) || defined (CONFIG_CRYPTO_SHA256_MODULE) | 51 | #if defined (CONFIG_CRYPTO_SHA256) || defined (CONFIG_CRYPTO_SHA256_MODULE) |
52 | { | 52 | { |
53 | .hmac_id = SCTP_AUTH_HMAC_ID_SHA256, | 53 | .hmac_id = SCTP_AUTH_HMAC_ID_SHA256, |
54 | .hmac_name="hmac(sha256)", | 54 | .hmac_name = "hmac(sha256)", |
55 | .hmac_len = SCTP_SHA256_SIG_SIZE, | 55 | .hmac_len = SCTP_SHA256_SIG_SIZE, |
56 | } | 56 | } |
57 | #endif | 57 | #endif |
@@ -163,7 +163,7 @@ static int sctp_auth_compare_vectors(struct sctp_auth_bytes *vector1, | |||
163 | * lead-zero padded. If it is not, it | 163 | * lead-zero padded. If it is not, it |
164 | * is automatically larger numerically. | 164 | * is automatically larger numerically. |
165 | */ | 165 | */ |
166 | for (i = 0; i < abs(diff); i++ ) { | 166 | for (i = 0; i < abs(diff); i++) { |
167 | if (longer[i] != 0) | 167 | if (longer[i] != 0) |
168 | return diff; | 168 | return diff; |
169 | } | 169 | } |
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c index 5573e425b0c0..158701da2d31 100644 --- a/net/sctp/chunk.c +++ b/net/sctp/chunk.c | |||
@@ -254,7 +254,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, | |||
254 | SCTP_INC_STATS_USER(sock_net(asoc->base.sk), SCTP_MIB_FRAGUSRMSGS); | 254 | SCTP_INC_STATS_USER(sock_net(asoc->base.sk), SCTP_MIB_FRAGUSRMSGS); |
255 | 255 | ||
256 | /* Create chunks for all the full sized DATA chunks. */ | 256 | /* Create chunks for all the full sized DATA chunks. */ |
257 | for (i=0, len=first_len; i < whole; i++) { | 257 | for (i = 0, len = first_len; i < whole; i++) { |
258 | frag = SCTP_DATA_MIDDLE_FRAG; | 258 | frag = SCTP_DATA_MIDDLE_FRAG; |
259 | 259 | ||
260 | if (0 == i) | 260 | if (0 == i) |
@@ -317,7 +317,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, | |||
317 | goto errout; | 317 | goto errout; |
318 | } | 318 | } |
319 | 319 | ||
320 | err = sctp_user_addto_chunk(chunk, offset, over,msgh->msg_iov); | 320 | err = sctp_user_addto_chunk(chunk, offset, over, msgh->msg_iov); |
321 | 321 | ||
322 | /* Put the chunk->skb back into the form expected by send. */ | 322 | /* Put the chunk->skb back into the form expected by send. */ |
323 | __skb_pull(chunk->skb, (__u8 *)chunk->chunk_hdr | 323 | __skb_pull(chunk->skb, (__u8 *)chunk->chunk_hdr |
diff --git a/net/sctp/input.c b/net/sctp/input.c index e978235c34fc..44f8793d91df 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -119,7 +119,7 @@ int sctp_rcv(struct sk_buff *skb) | |||
119 | struct sctp_af *af; | 119 | struct sctp_af *af; |
120 | struct net *net = dev_net(skb->dev); | 120 | struct net *net = dev_net(skb->dev); |
121 | 121 | ||
122 | if (skb->pkt_type!=PACKET_HOST) | 122 | if (skb->pkt_type != PACKET_HOST) |
123 | goto discard_it; | 123 | goto discard_it; |
124 | 124 | ||
125 | SCTP_INC_STATS_BH(net, SCTP_MIB_INSCTPPACKS); | 125 | SCTP_INC_STATS_BH(net, SCTP_MIB_INSCTPPACKS); |
@@ -1055,7 +1055,7 @@ static struct sctp_association *__sctp_rcv_walk_lookup(struct net *net, | |||
1055 | if (ch_end > skb_tail_pointer(skb)) | 1055 | if (ch_end > skb_tail_pointer(skb)) |
1056 | break; | 1056 | break; |
1057 | 1057 | ||
1058 | switch(ch->type) { | 1058 | switch (ch->type) { |
1059 | case SCTP_CID_AUTH: | 1059 | case SCTP_CID_AUTH: |
1060 | have_auth = chunk_num; | 1060 | have_auth = chunk_num; |
1061 | break; | 1061 | break; |
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 14191ab4165f..0f6259a6a932 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
@@ -402,7 +402,7 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist, | |||
402 | } | 402 | } |
403 | 403 | ||
404 | /* Initialize a sockaddr_storage from in incoming skb. */ | 404 | /* Initialize a sockaddr_storage from in incoming skb. */ |
405 | static void sctp_v6_from_skb(union sctp_addr *addr,struct sk_buff *skb, | 405 | static void sctp_v6_from_skb(union sctp_addr *addr, struct sk_buff *skb, |
406 | int is_saddr) | 406 | int is_saddr) |
407 | { | 407 | { |
408 | __be16 *port; | 408 | __be16 *port; |
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index b6b09f3f1a81..111516c3d34c 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c | |||
@@ -110,7 +110,7 @@ static inline int sctp_cacc_skip_3_1_d(struct sctp_transport *primary, | |||
110 | struct sctp_transport *transport, | 110 | struct sctp_transport *transport, |
111 | int count_of_newacks) | 111 | int count_of_newacks) |
112 | { | 112 | { |
113 | if (count_of_newacks >=2 && transport != primary) | 113 | if (count_of_newacks >= 2 && transport != primary) |
114 | return 1; | 114 | return 1; |
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
@@ -470,7 +470,7 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport, | |||
470 | struct net *net = sock_net(q->asoc->base.sk); | 470 | struct net *net = sock_net(q->asoc->base.sk); |
471 | int error = 0; | 471 | int error = 0; |
472 | 472 | ||
473 | switch(reason) { | 473 | switch (reason) { |
474 | case SCTP_RTXR_T3_RTX: | 474 | case SCTP_RTXR_T3_RTX: |
475 | SCTP_INC_STATS(net, SCTP_MIB_T3_RETRANSMITS); | 475 | SCTP_INC_STATS(net, SCTP_MIB_T3_RETRANSMITS); |
476 | sctp_transport_lower_cwnd(transport, SCTP_LOWER_CWND_T3_RTX); | 476 | sctp_transport_lower_cwnd(transport, SCTP_LOWER_CWND_T3_RTX); |
@@ -1088,7 +1088,7 @@ sctp_flush_out: | |||
1088 | * | 1088 | * |
1089 | * --xguo | 1089 | * --xguo |
1090 | */ | 1090 | */ |
1091 | while ((ltransport = sctp_list_dequeue(&transport_list)) != NULL ) { | 1091 | while ((ltransport = sctp_list_dequeue(&transport_list)) != NULL) { |
1092 | struct sctp_transport *t = list_entry(ltransport, | 1092 | struct sctp_transport *t = list_entry(ltransport, |
1093 | struct sctp_transport, | 1093 | struct sctp_transport, |
1094 | send_ready); | 1094 | send_ready); |
@@ -1217,7 +1217,7 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_chunk *chunk) | |||
1217 | * destinations for which cacc_saw_newack is set. | 1217 | * destinations for which cacc_saw_newack is set. |
1218 | */ | 1218 | */ |
1219 | if (transport->cacc.cacc_saw_newack) | 1219 | if (transport->cacc.cacc_saw_newack) |
1220 | count_of_newacks ++; | 1220 | count_of_newacks++; |
1221 | } | 1221 | } |
1222 | 1222 | ||
1223 | /* Move the Cumulative TSN Ack Point if appropriate. */ | 1223 | /* Move the Cumulative TSN Ack Point if appropriate. */ |
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index d9aaf9641aaa..439d87206820 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -2308,7 +2308,7 @@ int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk, | |||
2308 | * added as the primary transport. The source address seems to | 2308 | * added as the primary transport. The source address seems to |
2309 | * be a a better choice than any of the embedded addresses. | 2309 | * be a a better choice than any of the embedded addresses. |
2310 | */ | 2310 | */ |
2311 | if(!sctp_assoc_add_peer(asoc, peer_addr, gfp, SCTP_ACTIVE)) | 2311 | if (!sctp_assoc_add_peer(asoc, peer_addr, gfp, SCTP_ACTIVE)) |
2312 | goto nomem; | 2312 | goto nomem; |
2313 | 2313 | ||
2314 | if (sctp_cmp_addr_exact(sctp_source(chunk), peer_addr)) | 2314 | if (sctp_cmp_addr_exact(sctp_source(chunk), peer_addr)) |
@@ -3334,7 +3334,7 @@ static __be16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack, | |||
3334 | 3334 | ||
3335 | while (asconf_ack_len > 0) { | 3335 | while (asconf_ack_len > 0) { |
3336 | if (asconf_ack_param->crr_id == asconf_param->crr_id) { | 3336 | if (asconf_ack_param->crr_id == asconf_param->crr_id) { |
3337 | switch(asconf_ack_param->param_hdr.type) { | 3337 | switch (asconf_ack_param->param_hdr.type) { |
3338 | case SCTP_PARAM_SUCCESS_REPORT: | 3338 | case SCTP_PARAM_SUCCESS_REPORT: |
3339 | return SCTP_ERROR_NO_ERROR; | 3339 | return SCTP_ERROR_NO_ERROR; |
3340 | case SCTP_PARAM_ERR_CAUSE: | 3340 | case SCTP_PARAM_ERR_CAUSE: |
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 2821dcbbe070..ded6db66fb24 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -404,7 +404,7 @@ void sctp_generate_proto_unreach_event(unsigned long data) | |||
404 | struct sctp_transport *transport = (struct sctp_transport *) data; | 404 | struct sctp_transport *transport = (struct sctp_transport *) data; |
405 | struct sctp_association *asoc = transport->asoc; | 405 | struct sctp_association *asoc = transport->asoc; |
406 | struct net *net = sock_net(asoc->base.sk); | 406 | struct net *net = sock_net(asoc->base.sk); |
407 | 407 | ||
408 | sctp_bh_lock_sock(asoc->base.sk); | 408 | sctp_bh_lock_sock(asoc->base.sk); |
409 | if (sock_owned_by_user(asoc->base.sk)) { | 409 | if (sock_owned_by_user(asoc->base.sk)) { |
410 | pr_debug("%s: sock is busy\n", __func__); | 410 | pr_debug("%s: sock is busy\n", __func__); |
@@ -543,7 +543,7 @@ static void sctp_cmd_init_failed(sctp_cmd_seq_t *commands, | |||
543 | { | 543 | { |
544 | struct sctp_ulpevent *event; | 544 | struct sctp_ulpevent *event; |
545 | 545 | ||
546 | event = sctp_ulpevent_make_assoc_change(asoc,0, SCTP_CANT_STR_ASSOC, | 546 | event = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_CANT_STR_ASSOC, |
547 | (__u16)error, 0, 0, NULL, | 547 | (__u16)error, 0, 0, NULL, |
548 | GFP_ATOMIC); | 548 | GFP_ATOMIC); |
549 | 549 | ||
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index ee02771d8b9c..bc690b4b4971 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -2945,7 +2945,7 @@ sctp_disposition_t sctp_sf_eat_data_6_2(struct net *net, | |||
2945 | return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, | 2945 | return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, |
2946 | commands); | 2946 | commands); |
2947 | 2947 | ||
2948 | error = sctp_eat_data(asoc, chunk, commands ); | 2948 | error = sctp_eat_data(asoc, chunk, commands); |
2949 | switch (error) { | 2949 | switch (error) { |
2950 | case SCTP_IERROR_NO_ERROR: | 2950 | case SCTP_IERROR_NO_ERROR: |
2951 | break; | 2951 | break; |
@@ -3066,7 +3066,7 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(struct net *net, | |||
3066 | return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, | 3066 | return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, |
3067 | commands); | 3067 | commands); |
3068 | 3068 | ||
3069 | error = sctp_eat_data(asoc, chunk, commands ); | 3069 | error = sctp_eat_data(asoc, chunk, commands); |
3070 | switch (error) { | 3070 | switch (error) { |
3071 | case SCTP_IERROR_NO_ERROR: | 3071 | case SCTP_IERROR_NO_ERROR: |
3072 | case SCTP_IERROR_HIGH_TSN: | 3072 | case SCTP_IERROR_HIGH_TSN: |
@@ -3765,7 +3765,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(struct net *net, | |||
3765 | */ | 3765 | */ |
3766 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, | 3766 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, |
3767 | SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); | 3767 | SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); |
3768 | sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); | 3768 | sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL()); |
3769 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 3769 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
3770 | SCTP_ERROR(ECONNABORTED)); | 3770 | SCTP_ERROR(ECONNABORTED)); |
3771 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 3771 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
@@ -3799,7 +3799,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(struct net *net, | |||
3799 | /* We are going to ABORT, so we might as well stop | 3799 | /* We are going to ABORT, so we might as well stop |
3800 | * processing the rest of the chunks in the packet. | 3800 | * processing the rest of the chunks in the packet. |
3801 | */ | 3801 | */ |
3802 | sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); | 3802 | sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL()); |
3803 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 3803 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
3804 | SCTP_ERROR(ECONNABORTED)); | 3804 | SCTP_ERROR(ECONNABORTED)); |
3805 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 3805 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
@@ -4451,7 +4451,7 @@ static sctp_disposition_t sctp_sf_violation_chunklen( | |||
4451 | void *arg, | 4451 | void *arg, |
4452 | sctp_cmd_seq_t *commands) | 4452 | sctp_cmd_seq_t *commands) |
4453 | { | 4453 | { |
4454 | static const char err_str[]="The following chunk had invalid length:"; | 4454 | static const char err_str[] = "The following chunk had invalid length:"; |
4455 | 4455 | ||
4456 | return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, | 4456 | return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, |
4457 | sizeof(err_str)); | 4457 | sizeof(err_str)); |
@@ -4514,7 +4514,7 @@ static sctp_disposition_t sctp_sf_violation_ctsn( | |||
4514 | void *arg, | 4514 | void *arg, |
4515 | sctp_cmd_seq_t *commands) | 4515 | sctp_cmd_seq_t *commands) |
4516 | { | 4516 | { |
4517 | static const char err_str[]="The cumulative tsn ack beyond the max tsn currently sent:"; | 4517 | static const char err_str[] = "The cumulative tsn ack beyond the max tsn currently sent:"; |
4518 | 4518 | ||
4519 | return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, | 4519 | return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, |
4520 | sizeof(err_str)); | 4520 | sizeof(err_str)); |
@@ -4534,7 +4534,7 @@ static sctp_disposition_t sctp_sf_violation_chunk( | |||
4534 | void *arg, | 4534 | void *arg, |
4535 | sctp_cmd_seq_t *commands) | 4535 | sctp_cmd_seq_t *commands) |
4536 | { | 4536 | { |
4537 | static const char err_str[]="The following chunk violates protocol:"; | 4537 | static const char err_str[] = "The following chunk violates protocol:"; |
4538 | 4538 | ||
4539 | if (!asoc) | 4539 | if (!asoc) |
4540 | return sctp_sf_violation(net, ep, asoc, type, arg, commands); | 4540 | return sctp_sf_violation(net, ep, asoc, type, arg, commands); |
@@ -6000,7 +6000,7 @@ static struct sctp_packet *sctp_ootb_pkt_new(struct net *net, | |||
6000 | /* Special case the INIT-ACK as there is no peer's vtag | 6000 | /* Special case the INIT-ACK as there is no peer's vtag |
6001 | * yet. | 6001 | * yet. |
6002 | */ | 6002 | */ |
6003 | switch(chunk->chunk_hdr->type) { | 6003 | switch (chunk->chunk_hdr->type) { |
6004 | case SCTP_CID_INIT_ACK: | 6004 | case SCTP_CID_INIT_ACK: |
6005 | { | 6005 | { |
6006 | sctp_initack_chunk_t *initack; | 6006 | sctp_initack_chunk_t *initack; |
@@ -6017,7 +6017,7 @@ static struct sctp_packet *sctp_ootb_pkt_new(struct net *net, | |||
6017 | /* Special case the INIT and stale COOKIE_ECHO as there is no | 6017 | /* Special case the INIT and stale COOKIE_ECHO as there is no |
6018 | * vtag yet. | 6018 | * vtag yet. |
6019 | */ | 6019 | */ |
6020 | switch(chunk->chunk_hdr->type) { | 6020 | switch (chunk->chunk_hdr->type) { |
6021 | case SCTP_CID_INIT: | 6021 | case SCTP_CID_INIT: |
6022 | { | 6022 | { |
6023 | sctp_init_chunk_t *init; | 6023 | sctp_init_chunk_t *init; |
@@ -6231,7 +6231,7 @@ static int sctp_eat_data(const struct sctp_association *asoc, | |||
6231 | /* We are going to ABORT, so we might as well stop | 6231 | /* We are going to ABORT, so we might as well stop |
6232 | * processing the rest of the chunks in the packet. | 6232 | * processing the rest of the chunks in the packet. |
6233 | */ | 6233 | */ |
6234 | sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); | 6234 | sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL()); |
6235 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 6235 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
6236 | SCTP_ERROR(ECONNABORTED)); | 6236 | SCTP_ERROR(ECONNABORTED)); |
6237 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 6237 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index d39fd0c2c4cf..500972a9647e 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -1568,7 +1568,7 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
1568 | struct net *net = sock_net(sk); | 1568 | struct net *net = sock_net(sk); |
1569 | struct sctp_sock *sp; | 1569 | struct sctp_sock *sp; |
1570 | struct sctp_endpoint *ep; | 1570 | struct sctp_endpoint *ep; |
1571 | struct sctp_association *new_asoc=NULL, *asoc=NULL; | 1571 | struct sctp_association *new_asoc = NULL, *asoc = NULL; |
1572 | struct sctp_transport *transport, *chunk_tp; | 1572 | struct sctp_transport *transport, *chunk_tp; |
1573 | struct sctp_chunk *chunk; | 1573 | struct sctp_chunk *chunk; |
1574 | union sctp_addr to; | 1574 | union sctp_addr to; |
@@ -2462,7 +2462,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk, | |||
2462 | int hb_change, pmtud_change, sackdelay_change; | 2462 | int hb_change, pmtud_change, sackdelay_change; |
2463 | 2463 | ||
2464 | if (optlen != sizeof(struct sctp_paddrparams)) | 2464 | if (optlen != sizeof(struct sctp_paddrparams)) |
2465 | return - EINVAL; | 2465 | return -EINVAL; |
2466 | 2466 | ||
2467 | if (copy_from_user(¶ms, optval, optlen)) | 2467 | if (copy_from_user(¶ms, optval, optlen)) |
2468 | return -EFAULT; | 2468 | return -EFAULT; |
@@ -2483,7 +2483,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk, | |||
2483 | /* If an address other than INADDR_ANY is specified, and | 2483 | /* If an address other than INADDR_ANY is specified, and |
2484 | * no transport is found, then the request is invalid. | 2484 | * no transport is found, then the request is invalid. |
2485 | */ | 2485 | */ |
2486 | if (!sctp_is_any(sk, ( union sctp_addr *)¶ms.spp_address)) { | 2486 | if (!sctp_is_any(sk, (union sctp_addr *)¶ms.spp_address)) { |
2487 | trans = sctp_addr_id2transport(sk, ¶ms.spp_address, | 2487 | trans = sctp_addr_id2transport(sk, ¶ms.spp_address, |
2488 | params.spp_assoc_id); | 2488 | params.spp_assoc_id); |
2489 | if (!trans) | 2489 | if (!trans) |
@@ -2588,7 +2588,7 @@ static int sctp_setsockopt_delayed_ack(struct sock *sk, | |||
2588 | else | 2588 | else |
2589 | params.sack_freq = 0; | 2589 | params.sack_freq = 0; |
2590 | } else | 2590 | } else |
2591 | return - EINVAL; | 2591 | return -EINVAL; |
2592 | 2592 | ||
2593 | /* Validate value parameter. */ | 2593 | /* Validate value parameter. */ |
2594 | if (params.sack_delay > 500) | 2594 | if (params.sack_delay > 500) |
@@ -3332,7 +3332,7 @@ static int sctp_setsockopt_hmac_ident(struct sock *sk, | |||
3332 | if (optlen < sizeof(struct sctp_hmacalgo)) | 3332 | if (optlen < sizeof(struct sctp_hmacalgo)) |
3333 | return -EINVAL; | 3333 | return -EINVAL; |
3334 | 3334 | ||
3335 | hmacs= memdup_user(optval, optlen); | 3335 | hmacs = memdup_user(optval, optlen); |
3336 | if (IS_ERR(hmacs)) | 3336 | if (IS_ERR(hmacs)) |
3337 | return PTR_ERR(hmacs); | 3337 | return PTR_ERR(hmacs); |
3338 | 3338 | ||
@@ -3370,7 +3370,7 @@ static int sctp_setsockopt_auth_key(struct sock *sk, | |||
3370 | if (optlen <= sizeof(struct sctp_authkey)) | 3370 | if (optlen <= sizeof(struct sctp_authkey)) |
3371 | return -EINVAL; | 3371 | return -EINVAL; |
3372 | 3372 | ||
3373 | authkey= memdup_user(optval, optlen); | 3373 | authkey = memdup_user(optval, optlen); |
3374 | if (IS_ERR(authkey)) | 3374 | if (IS_ERR(authkey)) |
3375 | return PTR_ERR(authkey); | 3375 | return PTR_ERR(authkey); |
3376 | 3376 | ||
@@ -4467,7 +4467,7 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len, | |||
4467 | /* If an address other than INADDR_ANY is specified, and | 4467 | /* If an address other than INADDR_ANY is specified, and |
4468 | * no transport is found, then the request is invalid. | 4468 | * no transport is found, then the request is invalid. |
4469 | */ | 4469 | */ |
4470 | if (!sctp_is_any(sk, ( union sctp_addr *)¶ms.spp_address)) { | 4470 | if (!sctp_is_any(sk, (union sctp_addr *)¶ms.spp_address)) { |
4471 | trans = sctp_addr_id2transport(sk, ¶ms.spp_address, | 4471 | trans = sctp_addr_id2transport(sk, ¶ms.spp_address, |
4472 | params.spp_assoc_id); | 4472 | params.spp_assoc_id); |
4473 | if (!trans) { | 4473 | if (!trans) { |
@@ -4578,7 +4578,7 @@ static int sctp_getsockopt_delayed_ack(struct sock *sk, int len, | |||
4578 | if (copy_from_user(¶ms, optval, len)) | 4578 | if (copy_from_user(¶ms, optval, len)) |
4579 | return -EFAULT; | 4579 | return -EFAULT; |
4580 | } else | 4580 | } else |
4581 | return - EINVAL; | 4581 | return -EINVAL; |
4582 | 4582 | ||
4583 | /* Get association, if sack_assoc_id != 0 and the socket is a one | 4583 | /* Get association, if sack_assoc_id != 0 and the socket is a one |
4584 | * to many style socket, and an association was not found, then | 4584 | * to many style socket, and an association was not found, then |
@@ -4668,8 +4668,8 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, | |||
4668 | if (!asoc) | 4668 | if (!asoc) |
4669 | return -EINVAL; | 4669 | return -EINVAL; |
4670 | 4670 | ||
4671 | to = optval + offsetof(struct sctp_getaddrs,addrs); | 4671 | to = optval + offsetof(struct sctp_getaddrs, addrs); |
4672 | space_left = len - offsetof(struct sctp_getaddrs,addrs); | 4672 | space_left = len - offsetof(struct sctp_getaddrs, addrs); |
4673 | 4673 | ||
4674 | list_for_each_entry(from, &asoc->peer.transport_addr_list, | 4674 | list_for_each_entry(from, &asoc->peer.transport_addr_list, |
4675 | transports) { | 4675 | transports) { |
@@ -4729,7 +4729,7 @@ static int sctp_copy_laddrs(struct sock *sk, __u16 port, void *to, | |||
4729 | memcpy(to, &temp, addrlen); | 4729 | memcpy(to, &temp, addrlen); |
4730 | 4730 | ||
4731 | to += addrlen; | 4731 | to += addrlen; |
4732 | cnt ++; | 4732 | cnt++; |
4733 | space_left -= addrlen; | 4733 | space_left -= addrlen; |
4734 | *bytes_copied += addrlen; | 4734 | *bytes_copied += addrlen; |
4735 | } | 4735 | } |
@@ -4778,8 +4778,8 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len, | |||
4778 | bp = &asoc->base.bind_addr; | 4778 | bp = &asoc->base.bind_addr; |
4779 | } | 4779 | } |
4780 | 4780 | ||
4781 | to = optval + offsetof(struct sctp_getaddrs,addrs); | 4781 | to = optval + offsetof(struct sctp_getaddrs, addrs); |
4782 | space_left = len - offsetof(struct sctp_getaddrs,addrs); | 4782 | space_left = len - offsetof(struct sctp_getaddrs, addrs); |
4783 | 4783 | ||
4784 | addrs = kmalloc(space_left, GFP_KERNEL); | 4784 | addrs = kmalloc(space_left, GFP_KERNEL); |
4785 | if (!addrs) | 4785 | if (!addrs) |
@@ -4818,7 +4818,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len, | |||
4818 | memcpy(buf, &temp, addrlen); | 4818 | memcpy(buf, &temp, addrlen); |
4819 | buf += addrlen; | 4819 | buf += addrlen; |
4820 | bytes_copied += addrlen; | 4820 | bytes_copied += addrlen; |
4821 | cnt ++; | 4821 | cnt++; |
4822 | space_left -= addrlen; | 4822 | space_left -= addrlen; |
4823 | } | 4823 | } |
4824 | 4824 | ||
@@ -5090,7 +5090,7 @@ static int sctp_getsockopt_associnfo(struct sock *sk, int len, | |||
5090 | assocparams.sasoc_cookie_life = ktime_to_ms(asoc->cookie_life); | 5090 | assocparams.sasoc_cookie_life = ktime_to_ms(asoc->cookie_life); |
5091 | 5091 | ||
5092 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 5092 | list_for_each(pos, &asoc->peer.transport_addr_list) { |
5093 | cnt ++; | 5093 | cnt++; |
5094 | } | 5094 | } |
5095 | 5095 | ||
5096 | assocparams.sasoc_number_peer_destinations = cnt; | 5096 | assocparams.sasoc_number_peer_destinations = cnt; |
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c index a67470083be8..2d96640b7ad8 100644 --- a/net/sctp/ulpqueue.c +++ b/net/sctp/ulpqueue.c | |||
@@ -107,7 +107,7 @@ int sctp_ulpq_tail_data(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk, | |||
107 | event = sctp_ulpq_reasm(ulpq, event); | 107 | event = sctp_ulpq_reasm(ulpq, event); |
108 | 108 | ||
109 | /* Do ordering if needed. */ | 109 | /* Do ordering if needed. */ |
110 | if ((event) && (event->msg_flags & MSG_EOR)){ | 110 | if ((event) && (event->msg_flags & MSG_EOR)) { |
111 | /* Create a temporary list to collect chunks on. */ | 111 | /* Create a temporary list to collect chunks on. */ |
112 | skb_queue_head_init(&temp); | 112 | skb_queue_head_init(&temp); |
113 | __skb_queue_tail(&temp, sctp_event2skb(event)); | 113 | __skb_queue_tail(&temp, sctp_event2skb(event)); |
@@ -726,7 +726,7 @@ static void sctp_ulpq_reasm_drain(struct sctp_ulpq *ulpq) | |||
726 | 726 | ||
727 | while ((event = sctp_ulpq_retrieve_reassembled(ulpq)) != NULL) { | 727 | while ((event = sctp_ulpq_retrieve_reassembled(ulpq)) != NULL) { |
728 | /* Do ordering if needed. */ | 728 | /* Do ordering if needed. */ |
729 | if ((event) && (event->msg_flags & MSG_EOR)){ | 729 | if ((event) && (event->msg_flags & MSG_EOR)) { |
730 | skb_queue_head_init(&temp); | 730 | skb_queue_head_init(&temp); |
731 | __skb_queue_tail(&temp, sctp_event2skb(event)); | 731 | __skb_queue_tail(&temp, sctp_event2skb(event)); |
732 | 732 | ||