Commit ab38fb04 authored by Vlad Yasevich's avatar Vlad Yasevich Committed by David S. Miller

[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: default avatarVlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f4ad85ca
...@@ -67,7 +67,7 @@ struct sctp_ulpevent { ...@@ -67,7 +67,7 @@ struct sctp_ulpevent {
}; };
/* Retrieve the skb this event sits inside of. */ /* Retrieve the skb this event sits inside of. */
static inline struct sk_buff *sctp_event2skb(struct sctp_ulpevent *ev) static inline struct sk_buff *sctp_event2skb(const struct sctp_ulpevent *ev)
{ {
return container_of((void *)ev, struct sk_buff, cb); return container_of((void *)ev, struct sk_buff, cb);
} }
......
...@@ -4367,6 +4367,7 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const struct sctp_endpoint *ep, ...@@ -4367,6 +4367,7 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const struct sctp_endpoint *ep,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
struct sctp_chunk *repl; struct sctp_chunk *repl;
struct sctp_association* my_asoc;
/* The comment below says that we enter COOKIE-WAIT AFTER /* The comment below says that we enter COOKIE-WAIT AFTER
* sending the INIT, but that doesn't actually work in our * sending the INIT, but that doesn't actually work in our
...@@ -4390,8 +4391,8 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const struct sctp_endpoint *ep, ...@@ -4390,8 +4391,8 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const struct sctp_endpoint *ep,
/* Cast away the const modifier, as we want to just /* Cast away the const modifier, as we want to just
* rerun it through as a sideffect. * rerun it through as a sideffect.
*/ */
sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, my_asoc = (struct sctp_association *)asoc;
SCTP_ASOC((struct sctp_association *) asoc)); sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(my_asoc));
/* Choose transport for INIT. */ /* Choose transport for INIT. */
sctp_add_cmd_sf(commands, SCTP_CMD_INIT_CHOOSE_TRANSPORT, sctp_add_cmd_sf(commands, SCTP_CMD_INIT_CHOOSE_TRANSPORT,
......
...@@ -5868,11 +5868,12 @@ SCTP_STATIC int sctp_msghdr_parse(const struct msghdr *msg, ...@@ -5868,11 +5868,12 @@ SCTP_STATIC int sctp_msghdr_parse(const struct msghdr *msg,
sctp_cmsgs_t *cmsgs) sctp_cmsgs_t *cmsgs)
{ {
struct cmsghdr *cmsg; struct cmsghdr *cmsg;
struct msghdr *my_msg = (struct msghdr *)msg;
for (cmsg = CMSG_FIRSTHDR(msg); for (cmsg = CMSG_FIRSTHDR(msg);
cmsg != NULL; cmsg != NULL;
cmsg = CMSG_NXTHDR((struct msghdr*)msg, cmsg)) { cmsg = CMSG_NXTHDR(my_msg, cmsg)) {
if (!CMSG_OK(msg, cmsg)) if (!CMSG_OK(my_msg, cmsg))
return -EINVAL; return -EINVAL;
/* Should we parse this header or ignore? */ /* Should we parse this header or ignore? */
......
...@@ -859,7 +859,7 @@ __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event) ...@@ -859,7 +859,7 @@ __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event)
union sctp_notification *notification; union sctp_notification *notification;
struct sk_buff *skb; struct sk_buff *skb;
skb = sctp_event2skb((struct sctp_ulpevent *)event); skb = sctp_event2skb(event);
notification = (union sctp_notification *) skb->data; notification = (union sctp_notification *) skb->data;
return notification->sn_header.sn_type; return notification->sn_header.sn_type;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment