aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2008-04-12 21:40:06 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-12 21:40:06 -0400
commitab38fb04c9f8928cfaf6f4966633d783419906a1 (patch)
treee7025f9cc3979a509081eb7ad93f5f6a39610c71
parentf4ad85ca3ef8a1ede76c5020a28a8f4057b4d24f (diff)
[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>
-rw-r--r--include/net/sctp/ulpevent.h2
-rw-r--r--net/sctp/sm_statefuns.c5
-rw-r--r--net/sctp/socket.c5
-rw-r--r--net/sctp/ulpevent.c2
4 files changed, 8 insertions, 6 deletions
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index 9bcfc12275e8..7ea12e8e6676 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -67,7 +67,7 @@ struct sctp_ulpevent {
67}; 67};
68 68
69/* Retrieve the skb this event sits inside of. */ 69/* Retrieve the skb this event sits inside of. */
70static inline struct sk_buff *sctp_event2skb(struct sctp_ulpevent *ev) 70static inline struct sk_buff *sctp_event2skb(const struct sctp_ulpevent *ev)
71{ 71{
72 return container_of((void *)ev, struct sk_buff, cb); 72 return container_of((void *)ev, struct sk_buff, cb);
73} 73}
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 3ef97499df0d..07194c2a32df 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -4367,6 +4367,7 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const struct sctp_endpoint *ep,
4367 sctp_cmd_seq_t *commands) 4367 sctp_cmd_seq_t *commands)
4368{ 4368{
4369 struct sctp_chunk *repl; 4369 struct sctp_chunk *repl;
4370 struct sctp_association* my_asoc;
4370 4371
4371 /* The comment below says that we enter COOKIE-WAIT AFTER 4372 /* The comment below says that we enter COOKIE-WAIT AFTER
4372 * sending the INIT, but that doesn't actually work in our 4373 * 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 /* Cast away the const modifier, as we want to just 4391 /* Cast away the const modifier, as we want to just
4391 * rerun it through as a sideffect. 4392 * rerun it through as a sideffect.
4392 */ 4393 */
4393 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, 4394 my_asoc = (struct sctp_association *)asoc;
4394 SCTP_ASOC((struct sctp_association *) asoc)); 4395 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(my_asoc));
4395 4396
4396 /* Choose transport for INIT. */ 4397 /* Choose transport for INIT. */
4397 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_CHOOSE_TRANSPORT, 4398 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_CHOOSE_TRANSPORT,
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index d994d822900d..998e63a31311 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -5868,11 +5868,12 @@ SCTP_STATIC int sctp_msghdr_parse(const struct msghdr *msg,
5868 sctp_cmsgs_t *cmsgs) 5868 sctp_cmsgs_t *cmsgs)
5869{ 5869{
5870 struct cmsghdr *cmsg; 5870 struct cmsghdr *cmsg;
5871 struct msghdr *my_msg = (struct msghdr *)msg;
5871 5872
5872 for (cmsg = CMSG_FIRSTHDR(msg); 5873 for (cmsg = CMSG_FIRSTHDR(msg);
5873 cmsg != NULL; 5874 cmsg != NULL;
5874 cmsg = CMSG_NXTHDR((struct msghdr*)msg, cmsg)) { 5875 cmsg = CMSG_NXTHDR(my_msg, cmsg)) {
5875 if (!CMSG_OK(msg, cmsg)) 5876 if (!CMSG_OK(my_msg, cmsg))
5876 return -EINVAL; 5877 return -EINVAL;
5877 5878
5878 /* Should we parse this header or ignore? */ 5879 /* Should we parse this header or ignore? */
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
index b43f1f110f87..ce6cda6b6994 100644
--- a/net/sctp/ulpevent.c
+++ b/net/sctp/ulpevent.c
@@ -859,7 +859,7 @@ __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event)
859 union sctp_notification *notification; 859 union sctp_notification *notification;
860 struct sk_buff *skb; 860 struct sk_buff *skb;
861 861
862 skb = sctp_event2skb((struct sctp_ulpevent *)event); 862 skb = sctp_event2skb(event);
863 notification = (union sctp_notification *) skb->data; 863 notification = (union sctp_notification *) skb->data;
864 return notification->sn_header.sn_type; 864 return notification->sn_header.sn_type;
865} 865}