Commit ab38fb04c9f8928cfaf6f4966633d783419906a1
Committed by
David S. Miller
1 parent
f4ad85ca3e
Exists in
master
and in
7 other branches
[SCTP]: Fix compiler warning about const qualifiers
Fix 3 warnings about discarding const qualifiers: net/sctp/ulpevent.c:862: warning: passing argument 1 of 'sctp_event2skb' discards qualifiers from pointer target type net/sctp/sm_statefuns.c:4393: warning: passing argument 1 of 'SCTP_ASOC' discards qualifiers from pointer target type net/sctp/socket.c:5874: warning: passing argument 1 of 'cmsg_nxthdr' discards qualifiers from pointer target type Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 4 changed files with 8 additions and 6 deletions Side-by-side Diff
include/net/sctp/ulpevent.h
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | }; |
68 | 68 | |
69 | 69 | /* Retrieve the skb this event sits inside of. */ |
70 | -static inline struct sk_buff *sctp_event2skb(struct sctp_ulpevent *ev) | |
70 | +static inline struct sk_buff *sctp_event2skb(const struct sctp_ulpevent *ev) | |
71 | 71 | { |
72 | 72 | return container_of((void *)ev, struct sk_buff, cb); |
73 | 73 | } |
net/sctp/sm_statefuns.c
... | ... | @@ -4367,6 +4367,7 @@ |
4367 | 4367 | sctp_cmd_seq_t *commands) |
4368 | 4368 | { |
4369 | 4369 | struct sctp_chunk *repl; |
4370 | + struct sctp_association* my_asoc; | |
4370 | 4371 | |
4371 | 4372 | /* The comment below says that we enter COOKIE-WAIT AFTER |
4372 | 4373 | * sending the INIT, but that doesn't actually work in our |
... | ... | @@ -4390,8 +4391,8 @@ |
4390 | 4391 | /* Cast away the const modifier, as we want to just |
4391 | 4392 | * rerun it through as a sideffect. |
4392 | 4393 | */ |
4393 | - sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, | |
4394 | - SCTP_ASOC((struct sctp_association *) asoc)); | |
4394 | + my_asoc = (struct sctp_association *)asoc; | |
4395 | + sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(my_asoc)); | |
4395 | 4396 | |
4396 | 4397 | /* Choose transport for INIT. */ |
4397 | 4398 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_CHOOSE_TRANSPORT, |
net/sctp/socket.c
... | ... | @@ -5868,11 +5868,12 @@ |
5868 | 5868 | sctp_cmsgs_t *cmsgs) |
5869 | 5869 | { |
5870 | 5870 | struct cmsghdr *cmsg; |
5871 | + struct msghdr *my_msg = (struct msghdr *)msg; | |
5871 | 5872 | |
5872 | 5873 | for (cmsg = CMSG_FIRSTHDR(msg); |
5873 | 5874 | cmsg != NULL; |
5874 | - cmsg = CMSG_NXTHDR((struct msghdr*)msg, cmsg)) { | |
5875 | - if (!CMSG_OK(msg, cmsg)) | |
5875 | + cmsg = CMSG_NXTHDR(my_msg, cmsg)) { | |
5876 | + if (!CMSG_OK(my_msg, cmsg)) | |
5876 | 5877 | return -EINVAL; |
5877 | 5878 | |
5878 | 5879 | /* Should we parse this header or ignore? */ |
net/sctp/ulpevent.c
... | ... | @@ -859,7 +859,7 @@ |
859 | 859 | union sctp_notification *notification; |
860 | 860 | struct sk_buff *skb; |
861 | 861 | |
862 | - skb = sctp_event2skb((struct sctp_ulpevent *)event); | |
862 | + skb = sctp_event2skb(event); | |
863 | 863 | notification = (union sctp_notification *) skb->data; |
864 | 864 | return notification->sn_header.sn_type; |
865 | 865 | } |