diff options
author | Joe Perches <joe@perches.com> | 2011-06-13 12:21:26 -0400 |
---|---|---|
committer | David S. Miller <davem@conan.davemloft.net> | 2011-06-16 23:19:27 -0400 |
commit | ea110733874d5176cb56dcf612a629ffac09dbf0 (patch) | |
tree | d079bb9990ecf7dadc326b62605fb4de1f6fad4f /net | |
parent | 3c8def9776c3d4636291432522ea312f7a44be95 (diff) |
net: Remove casts of void *
Unnecessary casts of void * clutter the code.
These are the remainder casts after several specific
patches to remove netdev_priv and dev_priv.
Done via coccinelle script:
$ cat cast_void_pointer.cocci
@@
type T;
T *pt;
void *pv;
@@
- pt = (T *)pv;
+ pt = pv;
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/8021q/vlanproc.c | 2 | ||||
-rw-r--r-- | net/atm/mpc.c | 2 | ||||
-rw-r--r-- | net/ceph/crypto.c | 2 | ||||
-rw-r--r-- | net/decnet/dn_dev.c | 2 | ||||
-rw-r--r-- | net/irda/af_irda.c | 4 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_tty_attach.c | 2 | ||||
-rw-r--r-- | net/irda/irda_device.c | 2 | ||||
-rw-r--r-- | net/irda/iriap.c | 8 | ||||
-rw-r--r-- | net/irda/irlan/irlan_client.c | 10 | ||||
-rw-r--r-- | net/irda/irlan/irlan_common.c | 10 | ||||
-rw-r--r-- | net/irda/irlan/irlan_eth.c | 2 | ||||
-rw-r--r-- | net/irda/irlan/irlan_provider.c | 10 | ||||
-rw-r--r-- | net/irda/irqueue.c | 4 | ||||
-rw-r--r-- | net/irda/irttp.c | 18 | ||||
-rw-r--r-- | net/key/af_key.c | 20 | ||||
-rw-r--r-- | net/netlabel/netlabel_unlabeled.c | 10 | ||||
-rw-r--r-- | net/sctp/bind_addr.c | 2 | ||||
-rw-r--r-- | net/sctp/input.c | 3 | ||||
-rw-r--r-- | net/sctp/sm_make_chunk.c | 26 | ||||
-rw-r--r-- | net/sctp/sm_sideeffect.c | 2 | ||||
-rw-r--r-- | net/sctp/socket.c | 16 |
21 files changed, 74 insertions, 83 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index 016d7f4f1c84..d34b6daf8930 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c | |||
@@ -231,7 +231,7 @@ static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
231 | 231 | ||
232 | ++*pos; | 232 | ++*pos; |
233 | 233 | ||
234 | dev = (struct net_device *)v; | 234 | dev = v; |
235 | if (v == SEQ_START_TOKEN) | 235 | if (v == SEQ_START_TOKEN) |
236 | dev = net_device_entry(&net->dev_base_head); | 236 | dev = net_device_entry(&net->dev_base_head); |
237 | 237 | ||
diff --git a/net/atm/mpc.c b/net/atm/mpc.c index 3ccca42e6f90..aa972409f093 100644 --- a/net/atm/mpc.c +++ b/net/atm/mpc.c | |||
@@ -1005,7 +1005,7 @@ static int mpoa_event_listener(struct notifier_block *mpoa_notifier, | |||
1005 | struct mpoa_client *mpc; | 1005 | struct mpoa_client *mpc; |
1006 | struct lec_priv *priv; | 1006 | struct lec_priv *priv; |
1007 | 1007 | ||
1008 | dev = (struct net_device *)dev_ptr; | 1008 | dev = dev_ptr; |
1009 | 1009 | ||
1010 | if (!net_eq(dev_net(dev), &init_net)) | 1010 | if (!net_eq(dev_net(dev), &init_net)) |
1011 | return NOTIFY_DONE; | 1011 | return NOTIFY_DONE; |
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c index 5a8009c9e0cd..85f3bc0a7062 100644 --- a/net/ceph/crypto.c +++ b/net/ceph/crypto.c | |||
@@ -444,7 +444,7 @@ int ceph_key_instantiate(struct key *key, const void *data, size_t datalen) | |||
444 | goto err; | 444 | goto err; |
445 | 445 | ||
446 | /* TODO ceph_crypto_key_decode should really take const input */ | 446 | /* TODO ceph_crypto_key_decode should really take const input */ |
447 | p = (void*)data; | 447 | p = (void *)data; |
448 | ret = ceph_crypto_key_decode(ckey, &p, (char*)data+datalen); | 448 | ret = ceph_crypto_key_decode(ckey, &p, (char*)data+datalen); |
449 | if (ret < 0) | 449 | if (ret < 0) |
450 | goto err_ckey; | 450 | goto err_ckey; |
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 3780fd6e7bfe..48530b454395 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -1313,7 +1313,7 @@ static void *dn_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
1313 | 1313 | ||
1314 | ++*pos; | 1314 | ++*pos; |
1315 | 1315 | ||
1316 | dev = (struct net_device *)v; | 1316 | dev = v; |
1317 | if (v == SEQ_START_TOKEN) | 1317 | if (v == SEQ_START_TOKEN) |
1318 | dev = net_device_entry(&init_net.dev_base_head); | 1318 | dev = net_device_entry(&init_net.dev_base_head); |
1319 | 1319 | ||
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index cc616974a447..c24f25ab67d3 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
@@ -369,7 +369,7 @@ static void irda_getvalue_confirm(int result, __u16 obj_id, | |||
369 | { | 369 | { |
370 | struct irda_sock *self; | 370 | struct irda_sock *self; |
371 | 371 | ||
372 | self = (struct irda_sock *) priv; | 372 | self = priv; |
373 | if (!self) { | 373 | if (!self) { |
374 | IRDA_WARNING("%s: lost myself!\n", __func__); | 374 | IRDA_WARNING("%s: lost myself!\n", __func__); |
375 | return; | 375 | return; |
@@ -418,7 +418,7 @@ static void irda_selective_discovery_indication(discinfo_t *discovery, | |||
418 | 418 | ||
419 | IRDA_DEBUG(2, "%s()\n", __func__); | 419 | IRDA_DEBUG(2, "%s()\n", __func__); |
420 | 420 | ||
421 | self = (struct irda_sock *) priv; | 421 | self = priv; |
422 | if (!self) { | 422 | if (!self) { |
423 | IRDA_WARNING("%s: lost myself!\n", __func__); | 423 | IRDA_WARNING("%s: lost myself!\n", __func__); |
424 | return; | 424 | return; |
diff --git a/net/irda/ircomm/ircomm_tty_attach.c b/net/irda/ircomm/ircomm_tty_attach.c index 3c1754023022..b65d66e0d817 100644 --- a/net/irda/ircomm/ircomm_tty_attach.c +++ b/net/irda/ircomm/ircomm_tty_attach.c | |||
@@ -382,7 +382,7 @@ static void ircomm_tty_discovery_indication(discinfo_t *discovery, | |||
382 | info.daddr = discovery->daddr; | 382 | info.daddr = discovery->daddr; |
383 | info.saddr = discovery->saddr; | 383 | info.saddr = discovery->saddr; |
384 | 384 | ||
385 | self = (struct ircomm_tty_cb *) priv; | 385 | self = priv; |
386 | ircomm_tty_do_event(self, IRCOMM_TTY_DISCOVERY_INDICATION, | 386 | ircomm_tty_do_event(self, IRCOMM_TTY_DISCOVERY_INDICATION, |
387 | NULL, &info); | 387 | NULL, &info); |
388 | } | 388 | } |
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index 25cc2e695158..3eca35faf2a8 100644 --- a/net/irda/irda_device.c +++ b/net/irda/irda_device.c | |||
@@ -262,7 +262,7 @@ static void irda_task_timer_expired(void *data) | |||
262 | 262 | ||
263 | IRDA_DEBUG(2, "%s()\n", __func__); | 263 | IRDA_DEBUG(2, "%s()\n", __func__); |
264 | 264 | ||
265 | task = (struct irda_task *) data; | 265 | task = data; |
266 | 266 | ||
267 | irda_task_kick(task); | 267 | irda_task_kick(task); |
268 | } | 268 | } |
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index 36477538cea8..dfc7b47d48fe 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c | |||
@@ -300,7 +300,7 @@ static void iriap_disconnect_indication(void *instance, void *sap, | |||
300 | 300 | ||
301 | IRDA_DEBUG(4, "%s(), reason=%s\n", __func__, irlmp_reasons[reason]); | 301 | IRDA_DEBUG(4, "%s(), reason=%s\n", __func__, irlmp_reasons[reason]); |
302 | 302 | ||
303 | self = (struct iriap_cb *) instance; | 303 | self = instance; |
304 | 304 | ||
305 | IRDA_ASSERT(self != NULL, return;); | 305 | IRDA_ASSERT(self != NULL, return;); |
306 | IRDA_ASSERT(self->magic == IAS_MAGIC, return;); | 306 | IRDA_ASSERT(self->magic == IAS_MAGIC, return;); |
@@ -754,7 +754,7 @@ static void iriap_connect_confirm(void *instance, void *sap, | |||
754 | { | 754 | { |
755 | struct iriap_cb *self; | 755 | struct iriap_cb *self; |
756 | 756 | ||
757 | self = (struct iriap_cb *) instance; | 757 | self = instance; |
758 | 758 | ||
759 | IRDA_ASSERT(self != NULL, return;); | 759 | IRDA_ASSERT(self != NULL, return;); |
760 | IRDA_ASSERT(self->magic == IAS_MAGIC, return;); | 760 | IRDA_ASSERT(self->magic == IAS_MAGIC, return;); |
@@ -786,7 +786,7 @@ static void iriap_connect_indication(void *instance, void *sap, | |||
786 | 786 | ||
787 | IRDA_DEBUG(1, "%s()\n", __func__); | 787 | IRDA_DEBUG(1, "%s()\n", __func__); |
788 | 788 | ||
789 | self = (struct iriap_cb *) instance; | 789 | self = instance; |
790 | 790 | ||
791 | IRDA_ASSERT(skb != NULL, return;); | 791 | IRDA_ASSERT(skb != NULL, return;); |
792 | IRDA_ASSERT(self != NULL, goto out;); | 792 | IRDA_ASSERT(self != NULL, goto out;); |
@@ -834,7 +834,7 @@ static int iriap_data_indication(void *instance, void *sap, | |||
834 | 834 | ||
835 | IRDA_DEBUG(3, "%s()\n", __func__); | 835 | IRDA_DEBUG(3, "%s()\n", __func__); |
836 | 836 | ||
837 | self = (struct iriap_cb *) instance; | 837 | self = instance; |
838 | 838 | ||
839 | IRDA_ASSERT(skb != NULL, return 0;); | 839 | IRDA_ASSERT(skb != NULL, return 0;); |
840 | IRDA_ASSERT(self != NULL, goto out;); | 840 | IRDA_ASSERT(self != NULL, goto out;); |
diff --git a/net/irda/irlan/irlan_client.c b/net/irda/irlan/irlan_client.c index 7ed3af957935..ba1a3fc39b5c 100644 --- a/net/irda/irlan/irlan_client.c +++ b/net/irda/irlan/irlan_client.c | |||
@@ -198,7 +198,7 @@ static int irlan_client_ctrl_data_indication(void *instance, void *sap, | |||
198 | 198 | ||
199 | IRDA_DEBUG(2, "%s()\n", __func__ ); | 199 | IRDA_DEBUG(2, "%s()\n", __func__ ); |
200 | 200 | ||
201 | self = (struct irlan_cb *) instance; | 201 | self = instance; |
202 | 202 | ||
203 | IRDA_ASSERT(self != NULL, return -1;); | 203 | IRDA_ASSERT(self != NULL, return -1;); |
204 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); | 204 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); |
@@ -226,8 +226,8 @@ static void irlan_client_ctrl_disconnect_indication(void *instance, void *sap, | |||
226 | 226 | ||
227 | IRDA_DEBUG(4, "%s(), reason=%d\n", __func__ , reason); | 227 | IRDA_DEBUG(4, "%s(), reason=%d\n", __func__ , reason); |
228 | 228 | ||
229 | self = (struct irlan_cb *) instance; | 229 | self = instance; |
230 | tsap = (struct tsap_cb *) sap; | 230 | tsap = sap; |
231 | 231 | ||
232 | IRDA_ASSERT(self != NULL, return;); | 232 | IRDA_ASSERT(self != NULL, return;); |
233 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 233 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
@@ -298,7 +298,7 @@ static void irlan_client_ctrl_connect_confirm(void *instance, void *sap, | |||
298 | 298 | ||
299 | IRDA_DEBUG(4, "%s()\n", __func__ ); | 299 | IRDA_DEBUG(4, "%s()\n", __func__ ); |
300 | 300 | ||
301 | self = (struct irlan_cb *) instance; | 301 | self = instance; |
302 | 302 | ||
303 | IRDA_ASSERT(self != NULL, return;); | 303 | IRDA_ASSERT(self != NULL, return;); |
304 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 304 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
@@ -542,7 +542,7 @@ void irlan_client_get_value_confirm(int result, __u16 obj_id, | |||
542 | 542 | ||
543 | IRDA_ASSERT(priv != NULL, return;); | 543 | IRDA_ASSERT(priv != NULL, return;); |
544 | 544 | ||
545 | self = (struct irlan_cb *) priv; | 545 | self = priv; |
546 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 546 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
547 | 547 | ||
548 | /* We probably don't need to make any more queries */ | 548 | /* We probably don't need to make any more queries */ |
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c index 6130f9d9dbe1..779117636270 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c | |||
@@ -317,8 +317,8 @@ static void irlan_connect_indication(void *instance, void *sap, | |||
317 | 317 | ||
318 | IRDA_DEBUG(2, "%s()\n", __func__ ); | 318 | IRDA_DEBUG(2, "%s()\n", __func__ ); |
319 | 319 | ||
320 | self = (struct irlan_cb *) instance; | 320 | self = instance; |
321 | tsap = (struct tsap_cb *) sap; | 321 | tsap = sap; |
322 | 322 | ||
323 | IRDA_ASSERT(self != NULL, return;); | 323 | IRDA_ASSERT(self != NULL, return;); |
324 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 324 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
@@ -361,7 +361,7 @@ static void irlan_connect_confirm(void *instance, void *sap, | |||
361 | { | 361 | { |
362 | struct irlan_cb *self; | 362 | struct irlan_cb *self; |
363 | 363 | ||
364 | self = (struct irlan_cb *) instance; | 364 | self = instance; |
365 | 365 | ||
366 | IRDA_ASSERT(self != NULL, return;); | 366 | IRDA_ASSERT(self != NULL, return;); |
367 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 367 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
@@ -406,8 +406,8 @@ static void irlan_disconnect_indication(void *instance, | |||
406 | 406 | ||
407 | IRDA_DEBUG(0, "%s(), reason=%d\n", __func__ , reason); | 407 | IRDA_DEBUG(0, "%s(), reason=%d\n", __func__ , reason); |
408 | 408 | ||
409 | self = (struct irlan_cb *) instance; | 409 | self = instance; |
410 | tsap = (struct tsap_cb *) sap; | 410 | tsap = sap; |
411 | 411 | ||
412 | IRDA_ASSERT(self != NULL, return;); | 412 | IRDA_ASSERT(self != NULL, return;); |
413 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 413 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
diff --git a/net/irda/irlan/irlan_eth.c b/net/irda/irlan/irlan_eth.c index 8ee1ff6c742f..e8d5f4405d68 100644 --- a/net/irda/irlan/irlan_eth.c +++ b/net/irda/irlan/irlan_eth.c | |||
@@ -272,7 +272,7 @@ void irlan_eth_flow_indication(void *instance, void *sap, LOCAL_FLOW flow) | |||
272 | struct irlan_cb *self; | 272 | struct irlan_cb *self; |
273 | struct net_device *dev; | 273 | struct net_device *dev; |
274 | 274 | ||
275 | self = (struct irlan_cb *) instance; | 275 | self = instance; |
276 | 276 | ||
277 | IRDA_ASSERT(self != NULL, return;); | 277 | IRDA_ASSERT(self != NULL, return;); |
278 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 278 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
diff --git a/net/irda/irlan/irlan_provider.c b/net/irda/irlan/irlan_provider.c index b8af74ab8b68..8b61cf0d8a69 100644 --- a/net/irda/irlan/irlan_provider.c +++ b/net/irda/irlan/irlan_provider.c | |||
@@ -73,7 +73,7 @@ static int irlan_provider_data_indication(void *instance, void *sap, | |||
73 | 73 | ||
74 | IRDA_DEBUG(4, "%s()\n", __func__ ); | 74 | IRDA_DEBUG(4, "%s()\n", __func__ ); |
75 | 75 | ||
76 | self = (struct irlan_cb *) instance; | 76 | self = instance; |
77 | 77 | ||
78 | IRDA_ASSERT(self != NULL, return -1;); | 78 | IRDA_ASSERT(self != NULL, return -1;); |
79 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); | 79 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); |
@@ -131,8 +131,8 @@ static void irlan_provider_connect_indication(void *instance, void *sap, | |||
131 | 131 | ||
132 | IRDA_DEBUG(0, "%s()\n", __func__ ); | 132 | IRDA_DEBUG(0, "%s()\n", __func__ ); |
133 | 133 | ||
134 | self = (struct irlan_cb *) instance; | 134 | self = instance; |
135 | tsap = (struct tsap_cb *) sap; | 135 | tsap = sap; |
136 | 136 | ||
137 | IRDA_ASSERT(self != NULL, return;); | 137 | IRDA_ASSERT(self != NULL, return;); |
138 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 138 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
@@ -182,8 +182,8 @@ static void irlan_provider_disconnect_indication(void *instance, void *sap, | |||
182 | 182 | ||
183 | IRDA_DEBUG(4, "%s(), reason=%d\n", __func__ , reason); | 183 | IRDA_DEBUG(4, "%s(), reason=%d\n", __func__ , reason); |
184 | 184 | ||
185 | self = (struct irlan_cb *) instance; | 185 | self = instance; |
186 | tsap = (struct tsap_cb *) sap; | 186 | tsap = sap; |
187 | 187 | ||
188 | IRDA_ASSERT(self != NULL, return;); | 188 | IRDA_ASSERT(self != NULL, return;); |
189 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 189 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
diff --git a/net/irda/irqueue.c b/net/irda/irqueue.c index 9715e6e5900b..f06947c4fa82 100644 --- a/net/irda/irqueue.c +++ b/net/irda/irqueue.c | |||
@@ -780,7 +780,7 @@ void* hashbin_lock_find( hashbin_t* hashbin, long hashv, const char* name ) | |||
780 | /* | 780 | /* |
781 | * Search for entry | 781 | * Search for entry |
782 | */ | 782 | */ |
783 | entry = (irda_queue_t* ) hashbin_find( hashbin, hashv, name ); | 783 | entry = hashbin_find(hashbin, hashv, name); |
784 | 784 | ||
785 | /* Release lock */ | 785 | /* Release lock */ |
786 | spin_unlock_irqrestore(&hashbin->hb_spinlock, flags); | 786 | spin_unlock_irqrestore(&hashbin->hb_spinlock, flags); |
@@ -813,7 +813,7 @@ void* hashbin_find_next( hashbin_t* hashbin, long hashv, const char* name, | |||
813 | * This allow to check if the current item is still in the | 813 | * This allow to check if the current item is still in the |
814 | * hashbin or has been removed. | 814 | * hashbin or has been removed. |
815 | */ | 815 | */ |
816 | entry = (irda_queue_t* ) hashbin_find( hashbin, hashv, name ); | 816 | entry = hashbin_find(hashbin, hashv, name); |
817 | 817 | ||
818 | /* | 818 | /* |
819 | * Trick hashbin_get_next() to return what we want | 819 | * Trick hashbin_get_next() to return what we want |
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 9d9af4606970..285ccd623ae5 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c | |||
@@ -350,7 +350,7 @@ static int irttp_param_max_sdu_size(void *instance, irda_param_t *param, | |||
350 | { | 350 | { |
351 | struct tsap_cb *self; | 351 | struct tsap_cb *self; |
352 | 352 | ||
353 | self = (struct tsap_cb *) instance; | 353 | self = instance; |
354 | 354 | ||
355 | IRDA_ASSERT(self != NULL, return -1;); | 355 | IRDA_ASSERT(self != NULL, return -1;); |
356 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); | 356 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); |
@@ -879,7 +879,7 @@ static int irttp_udata_indication(void *instance, void *sap, | |||
879 | 879 | ||
880 | IRDA_DEBUG(4, "%s()\n", __func__); | 880 | IRDA_DEBUG(4, "%s()\n", __func__); |
881 | 881 | ||
882 | self = (struct tsap_cb *) instance; | 882 | self = instance; |
883 | 883 | ||
884 | IRDA_ASSERT(self != NULL, return -1;); | 884 | IRDA_ASSERT(self != NULL, return -1;); |
885 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); | 885 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); |
@@ -914,7 +914,7 @@ static int irttp_data_indication(void *instance, void *sap, | |||
914 | unsigned long flags; | 914 | unsigned long flags; |
915 | int n; | 915 | int n; |
916 | 916 | ||
917 | self = (struct tsap_cb *) instance; | 917 | self = instance; |
918 | 918 | ||
919 | n = skb->data[0] & 0x7f; /* Extract the credits */ | 919 | n = skb->data[0] & 0x7f; /* Extract the credits */ |
920 | 920 | ||
@@ -996,7 +996,7 @@ static void irttp_status_indication(void *instance, | |||
996 | 996 | ||
997 | IRDA_DEBUG(4, "%s()\n", __func__); | 997 | IRDA_DEBUG(4, "%s()\n", __func__); |
998 | 998 | ||
999 | self = (struct tsap_cb *) instance; | 999 | self = instance; |
1000 | 1000 | ||
1001 | IRDA_ASSERT(self != NULL, return;); | 1001 | IRDA_ASSERT(self != NULL, return;); |
1002 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); | 1002 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); |
@@ -1025,7 +1025,7 @@ static void irttp_flow_indication(void *instance, void *sap, LOCAL_FLOW flow) | |||
1025 | { | 1025 | { |
1026 | struct tsap_cb *self; | 1026 | struct tsap_cb *self; |
1027 | 1027 | ||
1028 | self = (struct tsap_cb *) instance; | 1028 | self = instance; |
1029 | 1029 | ||
1030 | IRDA_ASSERT(self != NULL, return;); | 1030 | IRDA_ASSERT(self != NULL, return;); |
1031 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); | 1031 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); |
@@ -1208,7 +1208,7 @@ static void irttp_connect_confirm(void *instance, void *sap, | |||
1208 | 1208 | ||
1209 | IRDA_DEBUG(4, "%s()\n", __func__); | 1209 | IRDA_DEBUG(4, "%s()\n", __func__); |
1210 | 1210 | ||
1211 | self = (struct tsap_cb *) instance; | 1211 | self = instance; |
1212 | 1212 | ||
1213 | IRDA_ASSERT(self != NULL, return;); | 1213 | IRDA_ASSERT(self != NULL, return;); |
1214 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); | 1214 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); |
@@ -1292,13 +1292,13 @@ static void irttp_connect_indication(void *instance, void *sap, | |||
1292 | __u8 plen; | 1292 | __u8 plen; |
1293 | __u8 n; | 1293 | __u8 n; |
1294 | 1294 | ||
1295 | self = (struct tsap_cb *) instance; | 1295 | self = instance; |
1296 | 1296 | ||
1297 | IRDA_ASSERT(self != NULL, return;); | 1297 | IRDA_ASSERT(self != NULL, return;); |
1298 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); | 1298 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); |
1299 | IRDA_ASSERT(skb != NULL, return;); | 1299 | IRDA_ASSERT(skb != NULL, return;); |
1300 | 1300 | ||
1301 | lsap = (struct lsap_cb *) sap; | 1301 | lsap = sap; |
1302 | 1302 | ||
1303 | self->max_seg_size = max_seg_size - TTP_HEADER; | 1303 | self->max_seg_size = max_seg_size - TTP_HEADER; |
1304 | self->max_header_size = max_header_size+TTP_HEADER; | 1304 | self->max_header_size = max_header_size+TTP_HEADER; |
@@ -1602,7 +1602,7 @@ static void irttp_disconnect_indication(void *instance, void *sap, | |||
1602 | 1602 | ||
1603 | IRDA_DEBUG(4, "%s()\n", __func__); | 1603 | IRDA_DEBUG(4, "%s()\n", __func__); |
1604 | 1604 | ||
1605 | self = (struct tsap_cb *) instance; | 1605 | self = instance; |
1606 | 1606 | ||
1607 | IRDA_ASSERT(self != NULL, return;); | 1607 | IRDA_ASSERT(self != NULL, return;); |
1608 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); | 1608 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); |
diff --git a/net/key/af_key.c b/net/key/af_key.c index 8f92cf8116ea..1e733e9073d0 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -621,7 +621,7 @@ static struct xfrm_state *pfkey_xfrm_state_lookup(struct net *net, const struct | |||
621 | unsigned short family; | 621 | unsigned short family; |
622 | xfrm_address_t *xaddr; | 622 | xfrm_address_t *xaddr; |
623 | 623 | ||
624 | sa = (const struct sadb_sa *) ext_hdrs[SADB_EXT_SA-1]; | 624 | sa = ext_hdrs[SADB_EXT_SA - 1]; |
625 | if (sa == NULL) | 625 | if (sa == NULL) |
626 | return NULL; | 626 | return NULL; |
627 | 627 | ||
@@ -630,7 +630,7 @@ static struct xfrm_state *pfkey_xfrm_state_lookup(struct net *net, const struct | |||
630 | return NULL; | 630 | return NULL; |
631 | 631 | ||
632 | /* sadb_address_len should be checked by caller */ | 632 | /* sadb_address_len should be checked by caller */ |
633 | addr = (const struct sadb_address *) ext_hdrs[SADB_EXT_ADDRESS_DST-1]; | 633 | addr = ext_hdrs[SADB_EXT_ADDRESS_DST - 1]; |
634 | if (addr == NULL) | 634 | if (addr == NULL) |
635 | return NULL; | 635 | return NULL; |
636 | 636 | ||
@@ -1039,7 +1039,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1039 | int err; | 1039 | int err; |
1040 | 1040 | ||
1041 | 1041 | ||
1042 | sa = (const struct sadb_sa *) ext_hdrs[SADB_EXT_SA-1]; | 1042 | sa = ext_hdrs[SADB_EXT_SA - 1]; |
1043 | if (!sa || | 1043 | if (!sa || |
1044 | !present_and_same_family(ext_hdrs[SADB_EXT_ADDRESS_SRC-1], | 1044 | !present_and_same_family(ext_hdrs[SADB_EXT_ADDRESS_SRC-1], |
1045 | ext_hdrs[SADB_EXT_ADDRESS_DST-1])) | 1045 | ext_hdrs[SADB_EXT_ADDRESS_DST-1])) |
@@ -1078,7 +1078,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1078 | sa->sadb_sa_encrypt > SADB_X_CALG_MAX) || | 1078 | sa->sadb_sa_encrypt > SADB_X_CALG_MAX) || |
1079 | sa->sadb_sa_encrypt > SADB_EALG_MAX) | 1079 | sa->sadb_sa_encrypt > SADB_EALG_MAX) |
1080 | return ERR_PTR(-EINVAL); | 1080 | return ERR_PTR(-EINVAL); |
1081 | key = (const struct sadb_key*) ext_hdrs[SADB_EXT_KEY_AUTH-1]; | 1081 | key = ext_hdrs[SADB_EXT_KEY_AUTH - 1]; |
1082 | if (key != NULL && | 1082 | if (key != NULL && |
1083 | sa->sadb_sa_auth != SADB_X_AALG_NULL && | 1083 | sa->sadb_sa_auth != SADB_X_AALG_NULL && |
1084 | ((key->sadb_key_bits+7) / 8 == 0 || | 1084 | ((key->sadb_key_bits+7) / 8 == 0 || |
@@ -1105,14 +1105,14 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1105 | if (sa->sadb_sa_flags & SADB_SAFLAGS_NOPMTUDISC) | 1105 | if (sa->sadb_sa_flags & SADB_SAFLAGS_NOPMTUDISC) |
1106 | x->props.flags |= XFRM_STATE_NOPMTUDISC; | 1106 | x->props.flags |= XFRM_STATE_NOPMTUDISC; |
1107 | 1107 | ||
1108 | lifetime = (const struct sadb_lifetime*) ext_hdrs[SADB_EXT_LIFETIME_HARD-1]; | 1108 | lifetime = ext_hdrs[SADB_EXT_LIFETIME_HARD - 1]; |
1109 | if (lifetime != NULL) { | 1109 | if (lifetime != NULL) { |
1110 | x->lft.hard_packet_limit = _KEY2X(lifetime->sadb_lifetime_allocations); | 1110 | x->lft.hard_packet_limit = _KEY2X(lifetime->sadb_lifetime_allocations); |
1111 | x->lft.hard_byte_limit = _KEY2X(lifetime->sadb_lifetime_bytes); | 1111 | x->lft.hard_byte_limit = _KEY2X(lifetime->sadb_lifetime_bytes); |
1112 | x->lft.hard_add_expires_seconds = lifetime->sadb_lifetime_addtime; | 1112 | x->lft.hard_add_expires_seconds = lifetime->sadb_lifetime_addtime; |
1113 | x->lft.hard_use_expires_seconds = lifetime->sadb_lifetime_usetime; | 1113 | x->lft.hard_use_expires_seconds = lifetime->sadb_lifetime_usetime; |
1114 | } | 1114 | } |
1115 | lifetime = (const struct sadb_lifetime*) ext_hdrs[SADB_EXT_LIFETIME_SOFT-1]; | 1115 | lifetime = ext_hdrs[SADB_EXT_LIFETIME_SOFT - 1]; |
1116 | if (lifetime != NULL) { | 1116 | if (lifetime != NULL) { |
1117 | x->lft.soft_packet_limit = _KEY2X(lifetime->sadb_lifetime_allocations); | 1117 | x->lft.soft_packet_limit = _KEY2X(lifetime->sadb_lifetime_allocations); |
1118 | x->lft.soft_byte_limit = _KEY2X(lifetime->sadb_lifetime_bytes); | 1118 | x->lft.soft_byte_limit = _KEY2X(lifetime->sadb_lifetime_bytes); |
@@ -1120,7 +1120,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1120 | x->lft.soft_use_expires_seconds = lifetime->sadb_lifetime_usetime; | 1120 | x->lft.soft_use_expires_seconds = lifetime->sadb_lifetime_usetime; |
1121 | } | 1121 | } |
1122 | 1122 | ||
1123 | sec_ctx = (const struct sadb_x_sec_ctx *) ext_hdrs[SADB_X_EXT_SEC_CTX-1]; | 1123 | sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; |
1124 | if (sec_ctx != NULL) { | 1124 | if (sec_ctx != NULL) { |
1125 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); | 1125 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); |
1126 | 1126 | ||
@@ -1134,7 +1134,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1134 | goto out; | 1134 | goto out; |
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | key = (const struct sadb_key*) ext_hdrs[SADB_EXT_KEY_AUTH-1]; | 1137 | key = ext_hdrs[SADB_EXT_KEY_AUTH - 1]; |
1138 | if (sa->sadb_sa_auth) { | 1138 | if (sa->sadb_sa_auth) { |
1139 | int keysize = 0; | 1139 | int keysize = 0; |
1140 | struct xfrm_algo_desc *a = xfrm_aalg_get_byid(sa->sadb_sa_auth); | 1140 | struct xfrm_algo_desc *a = xfrm_aalg_get_byid(sa->sadb_sa_auth); |
@@ -2219,7 +2219,7 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, const struct sadb_ | |||
2219 | if (xp->selector.dport) | 2219 | if (xp->selector.dport) |
2220 | xp->selector.dport_mask = htons(0xffff); | 2220 | xp->selector.dport_mask = htons(0xffff); |
2221 | 2221 | ||
2222 | sec_ctx = (struct sadb_x_sec_ctx *) ext_hdrs[SADB_X_EXT_SEC_CTX-1]; | 2222 | sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; |
2223 | if (sec_ctx != NULL) { | 2223 | if (sec_ctx != NULL) { |
2224 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); | 2224 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); |
2225 | 2225 | ||
@@ -2323,7 +2323,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, const struct sa | |||
2323 | if (sel.dport) | 2323 | if (sel.dport) |
2324 | sel.dport_mask = htons(0xffff); | 2324 | sel.dport_mask = htons(0xffff); |
2325 | 2325 | ||
2326 | sec_ctx = (struct sadb_x_sec_ctx *) ext_hdrs[SADB_X_EXT_SEC_CTX-1]; | 2326 | sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; |
2327 | if (sec_ctx != NULL) { | 2327 | if (sec_ctx != NULL) { |
2328 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); | 2328 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); |
2329 | 2329 | ||
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index 9c38658fba8b..8efd061a0ae9 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -426,10 +426,9 @@ int netlbl_unlhsh_add(struct net *net, | |||
426 | audit_info); | 426 | audit_info); |
427 | switch (addr_len) { | 427 | switch (addr_len) { |
428 | case sizeof(struct in_addr): { | 428 | case sizeof(struct in_addr): { |
429 | struct in_addr *addr4, *mask4; | 429 | const struct in_addr *addr4 = addr; |
430 | const struct in_addr *mask4 = mask; | ||
430 | 431 | ||
431 | addr4 = (struct in_addr *)addr; | ||
432 | mask4 = (struct in_addr *)mask; | ||
433 | ret_val = netlbl_unlhsh_add_addr4(iface, addr4, mask4, secid); | 432 | ret_val = netlbl_unlhsh_add_addr4(iface, addr4, mask4, secid); |
434 | if (audit_buf != NULL) | 433 | if (audit_buf != NULL) |
435 | netlbl_af4list_audit_addr(audit_buf, 1, | 434 | netlbl_af4list_audit_addr(audit_buf, 1, |
@@ -440,10 +439,9 @@ int netlbl_unlhsh_add(struct net *net, | |||
440 | } | 439 | } |
441 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 440 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
442 | case sizeof(struct in6_addr): { | 441 | case sizeof(struct in6_addr): { |
443 | struct in6_addr *addr6, *mask6; | 442 | const struct in6_addr *addr6 = addr; |
443 | const struct in6_addr *mask6 = mask; | ||
444 | 444 | ||
445 | addr6 = (struct in6_addr *)addr; | ||
446 | mask6 = (struct in6_addr *)mask; | ||
447 | ret_val = netlbl_unlhsh_add_addr6(iface, addr6, mask6, secid); | 445 | ret_val = netlbl_unlhsh_add_addr6(iface, addr6, mask6, secid); |
448 | if (audit_buf != NULL) | 446 | if (audit_buf != NULL) |
449 | netlbl_af6list_audit_addr(audit_buf, 1, | 447 | netlbl_af6list_audit_addr(audit_buf, 1, |
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index 17d157325b66..4ece451c8d27 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c | |||
@@ -430,7 +430,7 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, | |||
430 | list_for_each_entry(laddr, &bp->address_list, list) { | 430 | list_for_each_entry(laddr, &bp->address_list, list) { |
431 | addr_buf = (union sctp_addr *)addrs; | 431 | addr_buf = (union sctp_addr *)addrs; |
432 | for (i = 0; i < addrcnt; i++) { | 432 | for (i = 0; i < addrcnt; i++) { |
433 | addr = (union sctp_addr *)addr_buf; | 433 | addr = addr_buf; |
434 | af = sctp_get_af_specific(addr->v4.sin_family); | 434 | af = sctp_get_af_specific(addr->v4.sin_family); |
435 | if (!af) | 435 | if (!af) |
436 | break; | 436 | break; |
diff --git a/net/sctp/input.c b/net/sctp/input.c index 741ed1648838..b7692aab6e9c 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -510,8 +510,7 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb, | |||
510 | * discard the packet. | 510 | * discard the packet. |
511 | */ | 511 | */ |
512 | if (vtag == 0) { | 512 | if (vtag == 0) { |
513 | chunkhdr = (struct sctp_init_chunk *)((void *)sctphdr | 513 | chunkhdr = (void *)sctphdr + sizeof(struct sctphdr); |
514 | + sizeof(struct sctphdr)); | ||
515 | if (len < sizeof(struct sctphdr) + sizeof(sctp_chunkhdr_t) | 514 | if (len < sizeof(struct sctphdr) + sizeof(sctp_chunkhdr_t) |
516 | + sizeof(__be32) || | 515 | + sizeof(__be32) || |
517 | chunkhdr->chunk_hdr.type != SCTP_CID_INIT || | 516 | chunkhdr->chunk_hdr.type != SCTP_CID_INIT || |
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 3363d3788259..81db4e385352 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -2773,7 +2773,7 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc, | |||
2773 | /* Get total length of all the address parameters. */ | 2773 | /* Get total length of all the address parameters. */ |
2774 | addr_buf = addrs; | 2774 | addr_buf = addrs; |
2775 | for (i = 0; i < addrcnt; i++) { | 2775 | for (i = 0; i < addrcnt; i++) { |
2776 | addr = (union sctp_addr *)addr_buf; | 2776 | addr = addr_buf; |
2777 | af = sctp_get_af_specific(addr->v4.sin_family); | 2777 | af = sctp_get_af_specific(addr->v4.sin_family); |
2778 | addr_param_len = af->to_addr_param(addr, &addr_param); | 2778 | addr_param_len = af->to_addr_param(addr, &addr_param); |
2779 | 2779 | ||
@@ -2798,7 +2798,7 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc, | |||
2798 | /* Add the address parameters to the asconf chunk. */ | 2798 | /* Add the address parameters to the asconf chunk. */ |
2799 | addr_buf = addrs; | 2799 | addr_buf = addrs; |
2800 | for (i = 0; i < addrcnt; i++) { | 2800 | for (i = 0; i < addrcnt; i++) { |
2801 | addr = (union sctp_addr *)addr_buf; | 2801 | addr = addr_buf; |
2802 | af = sctp_get_af_specific(addr->v4.sin_family); | 2802 | af = sctp_get_af_specific(addr->v4.sin_family); |
2803 | addr_param_len = af->to_addr_param(addr, &addr_param); | 2803 | addr_param_len = af->to_addr_param(addr, &addr_param); |
2804 | param.param_hdr.type = flags; | 2804 | param.param_hdr.type = flags; |
@@ -2958,8 +2958,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc, | |||
2958 | union sctp_addr addr; | 2958 | union sctp_addr addr; |
2959 | union sctp_addr_param *addr_param; | 2959 | union sctp_addr_param *addr_param; |
2960 | 2960 | ||
2961 | addr_param = (union sctp_addr_param *) | 2961 | addr_param = (void *)asconf_param + sizeof(sctp_addip_param_t); |
2962 | ((void *)asconf_param + sizeof(sctp_addip_param_t)); | ||
2963 | 2962 | ||
2964 | if (asconf_param->param_hdr.type != SCTP_PARAM_ADD_IP && | 2963 | if (asconf_param->param_hdr.type != SCTP_PARAM_ADD_IP && |
2965 | asconf_param->param_hdr.type != SCTP_PARAM_DEL_IP && | 2964 | asconf_param->param_hdr.type != SCTP_PARAM_DEL_IP && |
@@ -3144,7 +3143,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, | |||
3144 | * asconf parameter. | 3143 | * asconf parameter. |
3145 | */ | 3144 | */ |
3146 | length = ntohs(addr_param->p.length); | 3145 | length = ntohs(addr_param->p.length); |
3147 | asconf_param = (sctp_addip_param_t *)((void *)addr_param + length); | 3146 | asconf_param = (void *)addr_param + length; |
3148 | chunk_len -= length; | 3147 | chunk_len -= length; |
3149 | 3148 | ||
3150 | /* create an ASCONF_ACK chunk. | 3149 | /* create an ASCONF_ACK chunk. |
@@ -3185,8 +3184,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, | |||
3185 | 3184 | ||
3186 | /* Move to the next ASCONF param. */ | 3185 | /* Move to the next ASCONF param. */ |
3187 | length = ntohs(asconf_param->param_hdr.length); | 3186 | length = ntohs(asconf_param->param_hdr.length); |
3188 | asconf_param = (sctp_addip_param_t *)((void *)asconf_param + | 3187 | asconf_param = (void *)asconf_param + length; |
3189 | length); | ||
3190 | chunk_len -= length; | 3188 | chunk_len -= length; |
3191 | } | 3189 | } |
3192 | 3190 | ||
@@ -3216,8 +3214,7 @@ static void sctp_asconf_param_success(struct sctp_association *asoc, | |||
3216 | struct sctp_transport *transport; | 3214 | struct sctp_transport *transport; |
3217 | struct sctp_sockaddr_entry *saddr; | 3215 | struct sctp_sockaddr_entry *saddr; |
3218 | 3216 | ||
3219 | addr_param = (union sctp_addr_param *) | 3217 | addr_param = (void *)asconf_param + sizeof(sctp_addip_param_t); |
3220 | ((void *)asconf_param + sizeof(sctp_addip_param_t)); | ||
3221 | 3218 | ||
3222 | /* We have checked the packet before, so we do not check again. */ | 3219 | /* We have checked the packet before, so we do not check again. */ |
3223 | af = sctp_get_af_specific(param_type2af(addr_param->p.type)); | 3220 | af = sctp_get_af_specific(param_type2af(addr_param->p.type)); |
@@ -3302,8 +3299,7 @@ static __be16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack, | |||
3302 | return SCTP_ERROR_NO_ERROR; | 3299 | return SCTP_ERROR_NO_ERROR; |
3303 | case SCTP_PARAM_ERR_CAUSE: | 3300 | case SCTP_PARAM_ERR_CAUSE: |
3304 | length = sizeof(sctp_addip_param_t); | 3301 | length = sizeof(sctp_addip_param_t); |
3305 | err_param = (sctp_errhdr_t *) | 3302 | err_param = (void *)asconf_ack_param + length; |
3306 | ((void *)asconf_ack_param + length); | ||
3307 | asconf_ack_len -= length; | 3303 | asconf_ack_len -= length; |
3308 | if (asconf_ack_len > 0) | 3304 | if (asconf_ack_len > 0) |
3309 | return err_param->cause; | 3305 | return err_param->cause; |
@@ -3316,8 +3312,7 @@ static __be16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack, | |||
3316 | } | 3312 | } |
3317 | 3313 | ||
3318 | length = ntohs(asconf_ack_param->param_hdr.length); | 3314 | length = ntohs(asconf_ack_param->param_hdr.length); |
3319 | asconf_ack_param = (sctp_addip_param_t *) | 3315 | asconf_ack_param = (void *)asconf_ack_param + length; |
3320 | ((void *)asconf_ack_param + length); | ||
3321 | asconf_ack_len -= length; | 3316 | asconf_ack_len -= length; |
3322 | } | 3317 | } |
3323 | 3318 | ||
@@ -3349,7 +3344,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc, | |||
3349 | * pointer to the first asconf parameter. | 3344 | * pointer to the first asconf parameter. |
3350 | */ | 3345 | */ |
3351 | length = ntohs(addr_param->p.length); | 3346 | length = ntohs(addr_param->p.length); |
3352 | asconf_param = (sctp_addip_param_t *)((void *)addr_param + length); | 3347 | asconf_param = (void *)addr_param + length; |
3353 | asconf_len -= length; | 3348 | asconf_len -= length; |
3354 | 3349 | ||
3355 | /* ADDIP 4.1 | 3350 | /* ADDIP 4.1 |
@@ -3400,8 +3395,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc, | |||
3400 | * one. | 3395 | * one. |
3401 | */ | 3396 | */ |
3402 | length = ntohs(asconf_param->param_hdr.length); | 3397 | length = ntohs(asconf_param->param_hdr.length); |
3403 | asconf_param = (sctp_addip_param_t *)((void *)asconf_param + | 3398 | asconf_param = (void *)asconf_param + length; |
3404 | length); | ||
3405 | asconf_len -= length; | 3399 | asconf_len -= length; |
3406 | } | 3400 | } |
3407 | 3401 | ||
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 534c2e5feb05..1b2bb6487342 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -1201,7 +1201,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, | |||
1201 | int local_cork = 0; | 1201 | int local_cork = 0; |
1202 | 1202 | ||
1203 | if (SCTP_EVENT_T_TIMEOUT != event_type) | 1203 | if (SCTP_EVENT_T_TIMEOUT != event_type) |
1204 | chunk = (struct sctp_chunk *) event_arg; | 1204 | chunk = event_arg; |
1205 | 1205 | ||
1206 | /* Note: This whole file is a huge candidate for rework. | 1206 | /* Note: This whole file is a huge candidate for rework. |
1207 | * For example, each command could either have its own handler, so | 1207 | * For example, each command could either have its own handler, so |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 60038fef3ba1..fd31b3616a33 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -476,7 +476,7 @@ static int sctp_bindx_add(struct sock *sk, struct sockaddr *addrs, int addrcnt) | |||
476 | /* The list may contain either IPv4 or IPv6 address; | 476 | /* The list may contain either IPv4 or IPv6 address; |
477 | * determine the address length for walking thru the list. | 477 | * determine the address length for walking thru the list. |
478 | */ | 478 | */ |
479 | sa_addr = (struct sockaddr *)addr_buf; | 479 | sa_addr = addr_buf; |
480 | af = sctp_get_af_specific(sa_addr->sa_family); | 480 | af = sctp_get_af_specific(sa_addr->sa_family); |
481 | if (!af) { | 481 | if (!af) { |
482 | retval = -EINVAL; | 482 | retval = -EINVAL; |
@@ -555,7 +555,7 @@ static int sctp_send_asconf_add_ip(struct sock *sk, | |||
555 | */ | 555 | */ |
556 | addr_buf = addrs; | 556 | addr_buf = addrs; |
557 | for (i = 0; i < addrcnt; i++) { | 557 | for (i = 0; i < addrcnt; i++) { |
558 | addr = (union sctp_addr *)addr_buf; | 558 | addr = addr_buf; |
559 | af = sctp_get_af_specific(addr->v4.sin_family); | 559 | af = sctp_get_af_specific(addr->v4.sin_family); |
560 | if (!af) { | 560 | if (!af) { |
561 | retval = -EINVAL; | 561 | retval = -EINVAL; |
@@ -588,7 +588,7 @@ static int sctp_send_asconf_add_ip(struct sock *sk, | |||
588 | */ | 588 | */ |
589 | addr_buf = addrs; | 589 | addr_buf = addrs; |
590 | for (i = 0; i < addrcnt; i++) { | 590 | for (i = 0; i < addrcnt; i++) { |
591 | addr = (union sctp_addr *)addr_buf; | 591 | addr = addr_buf; |
592 | af = sctp_get_af_specific(addr->v4.sin_family); | 592 | af = sctp_get_af_specific(addr->v4.sin_family); |
593 | memcpy(&saveaddr, addr, af->sockaddr_len); | 593 | memcpy(&saveaddr, addr, af->sockaddr_len); |
594 | retval = sctp_add_bind_addr(bp, &saveaddr, | 594 | retval = sctp_add_bind_addr(bp, &saveaddr, |
@@ -659,7 +659,7 @@ static int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt) | |||
659 | goto err_bindx_rem; | 659 | goto err_bindx_rem; |
660 | } | 660 | } |
661 | 661 | ||
662 | sa_addr = (union sctp_addr *)addr_buf; | 662 | sa_addr = addr_buf; |
663 | af = sctp_get_af_specific(sa_addr->sa.sa_family); | 663 | af = sctp_get_af_specific(sa_addr->sa.sa_family); |
664 | if (!af) { | 664 | if (!af) { |
665 | retval = -EINVAL; | 665 | retval = -EINVAL; |
@@ -758,7 +758,7 @@ static int sctp_send_asconf_del_ip(struct sock *sk, | |||
758 | */ | 758 | */ |
759 | addr_buf = addrs; | 759 | addr_buf = addrs; |
760 | for (i = 0; i < addrcnt; i++) { | 760 | for (i = 0; i < addrcnt; i++) { |
761 | laddr = (union sctp_addr *)addr_buf; | 761 | laddr = addr_buf; |
762 | af = sctp_get_af_specific(laddr->v4.sin_family); | 762 | af = sctp_get_af_specific(laddr->v4.sin_family); |
763 | if (!af) { | 763 | if (!af) { |
764 | retval = -EINVAL; | 764 | retval = -EINVAL; |
@@ -830,7 +830,7 @@ skip_mkasconf: | |||
830 | */ | 830 | */ |
831 | addr_buf = addrs; | 831 | addr_buf = addrs; |
832 | for (i = 0; i < addrcnt; i++) { | 832 | for (i = 0; i < addrcnt; i++) { |
833 | laddr = (union sctp_addr *)addr_buf; | 833 | laddr = addr_buf; |
834 | af = sctp_get_af_specific(laddr->v4.sin_family); | 834 | af = sctp_get_af_specific(laddr->v4.sin_family); |
835 | list_for_each_entry(saddr, &bp->address_list, list) { | 835 | list_for_each_entry(saddr, &bp->address_list, list) { |
836 | if (sctp_cmp_addr_exact(&saddr->a, laddr)) | 836 | if (sctp_cmp_addr_exact(&saddr->a, laddr)) |
@@ -997,7 +997,7 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk, | |||
997 | return -EINVAL; | 997 | return -EINVAL; |
998 | } | 998 | } |
999 | 999 | ||
1000 | sa_addr = (struct sockaddr *)addr_buf; | 1000 | sa_addr = addr_buf; |
1001 | af = sctp_get_af_specific(sa_addr->sa_family); | 1001 | af = sctp_get_af_specific(sa_addr->sa_family); |
1002 | 1002 | ||
1003 | /* If the address family is not supported or if this address | 1003 | /* If the address family is not supported or if this address |
@@ -1088,7 +1088,7 @@ static int __sctp_connect(struct sock* sk, | |||
1088 | goto out_free; | 1088 | goto out_free; |
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | sa_addr = (union sctp_addr *)addr_buf; | 1091 | sa_addr = addr_buf; |
1092 | af = sctp_get_af_specific(sa_addr->sa.sa_family); | 1092 | af = sctp_get_af_specific(sa_addr->sa.sa_family); |
1093 | 1093 | ||
1094 | /* If the address family is not supported or if this address | 1094 | /* If the address family is not supported or if this address |