diff options
| author | Xin Long <lucien.xin@gmail.com> | 2017-10-28 07:43:57 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-10-29 05:03:24 -0400 |
| commit | 978aa0474115f3f5848949f2efce4def0766a5cb (patch) | |
| tree | ec5e71a59013f698474666a8d748c4ddc11d68d4 | |
| parent | f6fc6bc0b8e0bb13a210bd7386ffdcb1a5f30ef1 (diff) | |
sctp: fix some type cast warnings introduced since very beginning
These warnings were found by running 'make C=2 M=net/sctp/'.
They are there since very beginning.
Note after this patch, there still one warning left in
sctp_outq_flush():
sctp_chunk_fail(chunk, SCTP_ERROR_INV_STRM)
Since it has been moved to sctp_stream_outq_migrate on net-next,
to avoid the extra job when merging net-next to net, I will post
the fix for it after the merging is done.
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | include/linux/sctp.h | 2 | ||||
| -rw-r--r-- | include/uapi/linux/sctp.h | 2 | ||||
| -rw-r--r-- | net/sctp/ipv6.c | 2 | ||||
| -rw-r--r-- | net/sctp/sm_make_chunk.c | 4 | ||||
| -rw-r--r-- | net/sctp/sm_sideeffect.c | 4 |
5 files changed, 7 insertions, 7 deletions
diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 09d7412e9cb0..da803dfc7a39 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h | |||
| @@ -231,7 +231,7 @@ struct sctp_datahdr { | |||
| 231 | __be32 tsn; | 231 | __be32 tsn; |
| 232 | __be16 stream; | 232 | __be16 stream; |
| 233 | __be16 ssn; | 233 | __be16 ssn; |
| 234 | __be32 ppid; | 234 | __u32 ppid; |
| 235 | __u8 payload[0]; | 235 | __u8 payload[0]; |
| 236 | }; | 236 | }; |
| 237 | 237 | ||
diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h index 6217ff8500a1..84fc2914b7fb 100644 --- a/include/uapi/linux/sctp.h +++ b/include/uapi/linux/sctp.h | |||
| @@ -376,7 +376,7 @@ struct sctp_remote_error { | |||
| 376 | __u16 sre_type; | 376 | __u16 sre_type; |
| 377 | __u16 sre_flags; | 377 | __u16 sre_flags; |
| 378 | __u32 sre_length; | 378 | __u32 sre_length; |
| 379 | __u16 sre_error; | 379 | __be16 sre_error; |
| 380 | sctp_assoc_t sre_assoc_id; | 380 | sctp_assoc_t sre_assoc_id; |
| 381 | __u8 sre_data[0]; | 381 | __u8 sre_data[0]; |
| 382 | }; | 382 | }; |
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 7fe9e1d1b7ec..a6dfa86c0201 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
| @@ -738,7 +738,7 @@ static int sctp_v6_skb_iif(const struct sk_buff *skb) | |||
| 738 | /* Was this packet marked by Explicit Congestion Notification? */ | 738 | /* Was this packet marked by Explicit Congestion Notification? */ |
| 739 | static int sctp_v6_is_ce(const struct sk_buff *skb) | 739 | static int sctp_v6_is_ce(const struct sk_buff *skb) |
| 740 | { | 740 | { |
| 741 | return *((__u32 *)(ipv6_hdr(skb))) & htonl(1 << 20); | 741 | return *((__u32 *)(ipv6_hdr(skb))) & (__force __u32)htonl(1 << 20); |
| 742 | } | 742 | } |
| 743 | 743 | ||
| 744 | /* Dump the v6 addr to the seq file. */ | 744 | /* Dump the v6 addr to the seq file. */ |
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 57c55045f5a7..514465b03829 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
| @@ -2854,7 +2854,7 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc, | |||
| 2854 | addr_param_len = af->to_addr_param(addr, &addr_param); | 2854 | addr_param_len = af->to_addr_param(addr, &addr_param); |
| 2855 | param.param_hdr.type = flags; | 2855 | param.param_hdr.type = flags; |
| 2856 | param.param_hdr.length = htons(paramlen + addr_param_len); | 2856 | param.param_hdr.length = htons(paramlen + addr_param_len); |
| 2857 | param.crr_id = i; | 2857 | param.crr_id = htonl(i); |
| 2858 | 2858 | ||
| 2859 | sctp_addto_chunk(retval, paramlen, ¶m); | 2859 | sctp_addto_chunk(retval, paramlen, ¶m); |
| 2860 | sctp_addto_chunk(retval, addr_param_len, &addr_param); | 2860 | sctp_addto_chunk(retval, addr_param_len, &addr_param); |
| @@ -2867,7 +2867,7 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc, | |||
| 2867 | addr_param_len = af->to_addr_param(addr, &addr_param); | 2867 | addr_param_len = af->to_addr_param(addr, &addr_param); |
| 2868 | param.param_hdr.type = SCTP_PARAM_DEL_IP; | 2868 | param.param_hdr.type = SCTP_PARAM_DEL_IP; |
| 2869 | param.param_hdr.length = htons(paramlen + addr_param_len); | 2869 | param.param_hdr.length = htons(paramlen + addr_param_len); |
| 2870 | param.crr_id = i; | 2870 | param.crr_id = htonl(i); |
| 2871 | 2871 | ||
| 2872 | sctp_addto_chunk(retval, paramlen, ¶m); | 2872 | sctp_addto_chunk(retval, paramlen, ¶m); |
| 2873 | sctp_addto_chunk(retval, addr_param_len, &addr_param); | 2873 | sctp_addto_chunk(retval, addr_param_len, &addr_param); |
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 8f2762bba879..e2d9a4b49c9c 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
| @@ -1607,12 +1607,12 @@ static int sctp_cmd_interpreter(enum sctp_event event_type, | |||
| 1607 | break; | 1607 | break; |
| 1608 | 1608 | ||
| 1609 | case SCTP_CMD_INIT_FAILED: | 1609 | case SCTP_CMD_INIT_FAILED: |
| 1610 | sctp_cmd_init_failed(commands, asoc, cmd->obj.err); | 1610 | sctp_cmd_init_failed(commands, asoc, cmd->obj.u32); |
| 1611 | break; | 1611 | break; |
| 1612 | 1612 | ||
| 1613 | case SCTP_CMD_ASSOC_FAILED: | 1613 | case SCTP_CMD_ASSOC_FAILED: |
| 1614 | sctp_cmd_assoc_failed(commands, asoc, event_type, | 1614 | sctp_cmd_assoc_failed(commands, asoc, event_type, |
| 1615 | subtype, chunk, cmd->obj.err); | 1615 | subtype, chunk, cmd->obj.u32); |
| 1616 | break; | 1616 | break; |
| 1617 | 1617 | ||
| 1618 | case SCTP_CMD_INIT_COUNTER_INC: | 1618 | case SCTP_CMD_INIT_COUNTER_INC: |
