Commit ea110733874d5176cb56dcf612a629ffac09dbf0
Committed by
David S. Miller
1 parent
3c8def9776
Exists in
master
and in
20 other branches
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>
Showing 21 changed files with 74 additions and 83 deletions Side-by-side Diff
- net/8021q/vlanproc.c
- net/atm/mpc.c
- net/ceph/crypto.c
- net/decnet/dn_dev.c
- net/irda/af_irda.c
- net/irda/ircomm/ircomm_tty_attach.c
- net/irda/irda_device.c
- net/irda/iriap.c
- net/irda/irlan/irlan_client.c
- net/irda/irlan/irlan_common.c
- net/irda/irlan/irlan_eth.c
- net/irda/irlan/irlan_provider.c
- net/irda/irqueue.c
- net/irda/irttp.c
- net/key/af_key.c
- net/netlabel/netlabel_unlabeled.c
- net/sctp/bind_addr.c
- net/sctp/input.c
- net/sctp/sm_make_chunk.c
- net/sctp/sm_sideeffect.c
- net/sctp/socket.c
net/8021q/vlanproc.c
net/atm/mpc.c
net/ceph/crypto.c
net/decnet/dn_dev.c
net/irda/af_irda.c
... | ... | @@ -369,7 +369,7 @@ |
369 | 369 | { |
370 | 370 | struct irda_sock *self; |
371 | 371 | |
372 | - self = (struct irda_sock *) priv; | |
372 | + self = priv; | |
373 | 373 | if (!self) { |
374 | 374 | IRDA_WARNING("%s: lost myself!\n", __func__); |
375 | 375 | return; |
... | ... | @@ -418,7 +418,7 @@ |
418 | 418 | |
419 | 419 | IRDA_DEBUG(2, "%s()\n", __func__); |
420 | 420 | |
421 | - self = (struct irda_sock *) priv; | |
421 | + self = priv; | |
422 | 422 | if (!self) { |
423 | 423 | IRDA_WARNING("%s: lost myself!\n", __func__); |
424 | 424 | return; |
net/irda/ircomm/ircomm_tty_attach.c
net/irda/irda_device.c
net/irda/iriap.c
... | ... | @@ -300,7 +300,7 @@ |
300 | 300 | |
301 | 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 | 305 | IRDA_ASSERT(self != NULL, return;); |
306 | 306 | IRDA_ASSERT(self->magic == IAS_MAGIC, return;); |
... | ... | @@ -754,7 +754,7 @@ |
754 | 754 | { |
755 | 755 | struct iriap_cb *self; |
756 | 756 | |
757 | - self = (struct iriap_cb *) instance; | |
757 | + self = instance; | |
758 | 758 | |
759 | 759 | IRDA_ASSERT(self != NULL, return;); |
760 | 760 | IRDA_ASSERT(self->magic == IAS_MAGIC, return;); |
... | ... | @@ -786,7 +786,7 @@ |
786 | 786 | |
787 | 787 | IRDA_DEBUG(1, "%s()\n", __func__); |
788 | 788 | |
789 | - self = (struct iriap_cb *) instance; | |
789 | + self = instance; | |
790 | 790 | |
791 | 791 | IRDA_ASSERT(skb != NULL, return;); |
792 | 792 | IRDA_ASSERT(self != NULL, goto out;); |
... | ... | @@ -834,7 +834,7 @@ |
834 | 834 | |
835 | 835 | IRDA_DEBUG(3, "%s()\n", __func__); |
836 | 836 | |
837 | - self = (struct iriap_cb *) instance; | |
837 | + self = instance; | |
838 | 838 | |
839 | 839 | IRDA_ASSERT(skb != NULL, return 0;); |
840 | 840 | IRDA_ASSERT(self != NULL, goto out;); |
net/irda/irlan/irlan_client.c
... | ... | @@ -198,7 +198,7 @@ |
198 | 198 | |
199 | 199 | IRDA_DEBUG(2, "%s()\n", __func__ ); |
200 | 200 | |
201 | - self = (struct irlan_cb *) instance; | |
201 | + self = instance; | |
202 | 202 | |
203 | 203 | IRDA_ASSERT(self != NULL, return -1;); |
204 | 204 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); |
... | ... | @@ -226,8 +226,8 @@ |
226 | 226 | |
227 | 227 | IRDA_DEBUG(4, "%s(), reason=%d\n", __func__ , reason); |
228 | 228 | |
229 | - self = (struct irlan_cb *) instance; | |
230 | - tsap = (struct tsap_cb *) sap; | |
229 | + self = instance; | |
230 | + tsap = sap; | |
231 | 231 | |
232 | 232 | IRDA_ASSERT(self != NULL, return;); |
233 | 233 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
... | ... | @@ -298,7 +298,7 @@ |
298 | 298 | |
299 | 299 | IRDA_DEBUG(4, "%s()\n", __func__ ); |
300 | 300 | |
301 | - self = (struct irlan_cb *) instance; | |
301 | + self = instance; | |
302 | 302 | |
303 | 303 | IRDA_ASSERT(self != NULL, return;); |
304 | 304 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
... | ... | @@ -542,7 +542,7 @@ |
542 | 542 | |
543 | 543 | IRDA_ASSERT(priv != NULL, return;); |
544 | 544 | |
545 | - self = (struct irlan_cb *) priv; | |
545 | + self = priv; | |
546 | 546 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
547 | 547 | |
548 | 548 | /* We probably don't need to make any more queries */ |
net/irda/irlan/irlan_common.c
... | ... | @@ -317,8 +317,8 @@ |
317 | 317 | |
318 | 318 | IRDA_DEBUG(2, "%s()\n", __func__ ); |
319 | 319 | |
320 | - self = (struct irlan_cb *) instance; | |
321 | - tsap = (struct tsap_cb *) sap; | |
320 | + self = instance; | |
321 | + tsap = sap; | |
322 | 322 | |
323 | 323 | IRDA_ASSERT(self != NULL, return;); |
324 | 324 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
... | ... | @@ -361,7 +361,7 @@ |
361 | 361 | { |
362 | 362 | struct irlan_cb *self; |
363 | 363 | |
364 | - self = (struct irlan_cb *) instance; | |
364 | + self = instance; | |
365 | 365 | |
366 | 366 | IRDA_ASSERT(self != NULL, return;); |
367 | 367 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
... | ... | @@ -406,8 +406,8 @@ |
406 | 406 | |
407 | 407 | IRDA_DEBUG(0, "%s(), reason=%d\n", __func__ , reason); |
408 | 408 | |
409 | - self = (struct irlan_cb *) instance; | |
410 | - tsap = (struct tsap_cb *) sap; | |
409 | + self = instance; | |
410 | + tsap = sap; | |
411 | 411 | |
412 | 412 | IRDA_ASSERT(self != NULL, return;); |
413 | 413 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
net/irda/irlan/irlan_eth.c
net/irda/irlan/irlan_provider.c
... | ... | @@ -73,7 +73,7 @@ |
73 | 73 | |
74 | 74 | IRDA_DEBUG(4, "%s()\n", __func__ ); |
75 | 75 | |
76 | - self = (struct irlan_cb *) instance; | |
76 | + self = instance; | |
77 | 77 | |
78 | 78 | IRDA_ASSERT(self != NULL, return -1;); |
79 | 79 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); |
... | ... | @@ -131,8 +131,8 @@ |
131 | 131 | |
132 | 132 | IRDA_DEBUG(0, "%s()\n", __func__ ); |
133 | 133 | |
134 | - self = (struct irlan_cb *) instance; | |
135 | - tsap = (struct tsap_cb *) sap; | |
134 | + self = instance; | |
135 | + tsap = sap; | |
136 | 136 | |
137 | 137 | IRDA_ASSERT(self != NULL, return;); |
138 | 138 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
... | ... | @@ -182,8 +182,8 @@ |
182 | 182 | |
183 | 183 | IRDA_DEBUG(4, "%s(), reason=%d\n", __func__ , reason); |
184 | 184 | |
185 | - self = (struct irlan_cb *) instance; | |
186 | - tsap = (struct tsap_cb *) sap; | |
185 | + self = instance; | |
186 | + tsap = sap; | |
187 | 187 | |
188 | 188 | IRDA_ASSERT(self != NULL, return;); |
189 | 189 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
net/irda/irqueue.c
... | ... | @@ -780,7 +780,7 @@ |
780 | 780 | /* |
781 | 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 | 785 | /* Release lock */ |
786 | 786 | spin_unlock_irqrestore(&hashbin->hb_spinlock, flags); |
... | ... | @@ -813,7 +813,7 @@ |
813 | 813 | * This allow to check if the current item is still in the |
814 | 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 | 819 | * Trick hashbin_get_next() to return what we want |
net/irda/irttp.c
... | ... | @@ -350,7 +350,7 @@ |
350 | 350 | { |
351 | 351 | struct tsap_cb *self; |
352 | 352 | |
353 | - self = (struct tsap_cb *) instance; | |
353 | + self = instance; | |
354 | 354 | |
355 | 355 | IRDA_ASSERT(self != NULL, return -1;); |
356 | 356 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); |
... | ... | @@ -879,7 +879,7 @@ |
879 | 879 | |
880 | 880 | IRDA_DEBUG(4, "%s()\n", __func__); |
881 | 881 | |
882 | - self = (struct tsap_cb *) instance; | |
882 | + self = instance; | |
883 | 883 | |
884 | 884 | IRDA_ASSERT(self != NULL, return -1;); |
885 | 885 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); |
... | ... | @@ -914,7 +914,7 @@ |
914 | 914 | unsigned long flags; |
915 | 915 | int n; |
916 | 916 | |
917 | - self = (struct tsap_cb *) instance; | |
917 | + self = instance; | |
918 | 918 | |
919 | 919 | n = skb->data[0] & 0x7f; /* Extract the credits */ |
920 | 920 | |
... | ... | @@ -996,7 +996,7 @@ |
996 | 996 | |
997 | 997 | IRDA_DEBUG(4, "%s()\n", __func__); |
998 | 998 | |
999 | - self = (struct tsap_cb *) instance; | |
999 | + self = instance; | |
1000 | 1000 | |
1001 | 1001 | IRDA_ASSERT(self != NULL, return;); |
1002 | 1002 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); |
... | ... | @@ -1025,7 +1025,7 @@ |
1025 | 1025 | { |
1026 | 1026 | struct tsap_cb *self; |
1027 | 1027 | |
1028 | - self = (struct tsap_cb *) instance; | |
1028 | + self = instance; | |
1029 | 1029 | |
1030 | 1030 | IRDA_ASSERT(self != NULL, return;); |
1031 | 1031 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); |
... | ... | @@ -1208,7 +1208,7 @@ |
1208 | 1208 | |
1209 | 1209 | IRDA_DEBUG(4, "%s()\n", __func__); |
1210 | 1210 | |
1211 | - self = (struct tsap_cb *) instance; | |
1211 | + self = instance; | |
1212 | 1212 | |
1213 | 1213 | IRDA_ASSERT(self != NULL, return;); |
1214 | 1214 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); |
1215 | 1215 | |
... | ... | @@ -1292,13 +1292,13 @@ |
1292 | 1292 | __u8 plen; |
1293 | 1293 | __u8 n; |
1294 | 1294 | |
1295 | - self = (struct tsap_cb *) instance; | |
1295 | + self = instance; | |
1296 | 1296 | |
1297 | 1297 | IRDA_ASSERT(self != NULL, return;); |
1298 | 1298 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); |
1299 | 1299 | IRDA_ASSERT(skb != NULL, return;); |
1300 | 1300 | |
1301 | - lsap = (struct lsap_cb *) sap; | |
1301 | + lsap = sap; | |
1302 | 1302 | |
1303 | 1303 | self->max_seg_size = max_seg_size - TTP_HEADER; |
1304 | 1304 | self->max_header_size = max_header_size+TTP_HEADER; |
... | ... | @@ -1602,7 +1602,7 @@ |
1602 | 1602 | |
1603 | 1603 | IRDA_DEBUG(4, "%s()\n", __func__); |
1604 | 1604 | |
1605 | - self = (struct tsap_cb *) instance; | |
1605 | + self = instance; | |
1606 | 1606 | |
1607 | 1607 | IRDA_ASSERT(self != NULL, return;); |
1608 | 1608 | IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;); |
net/key/af_key.c
... | ... | @@ -621,7 +621,7 @@ |
621 | 621 | unsigned short family; |
622 | 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 | 625 | if (sa == NULL) |
626 | 626 | return NULL; |
627 | 627 | |
... | ... | @@ -630,7 +630,7 @@ |
630 | 630 | return NULL; |
631 | 631 | |
632 | 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 | 634 | if (addr == NULL) |
635 | 635 | return NULL; |
636 | 636 | |
... | ... | @@ -1039,7 +1039,7 @@ |
1039 | 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 | 1043 | if (!sa || |
1044 | 1044 | !present_and_same_family(ext_hdrs[SADB_EXT_ADDRESS_SRC-1], |
1045 | 1045 | ext_hdrs[SADB_EXT_ADDRESS_DST-1])) |
... | ... | @@ -1078,7 +1078,7 @@ |
1078 | 1078 | sa->sadb_sa_encrypt > SADB_X_CALG_MAX) || |
1079 | 1079 | sa->sadb_sa_encrypt > SADB_EALG_MAX) |
1080 | 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 | 1082 | if (key != NULL && |
1083 | 1083 | sa->sadb_sa_auth != SADB_X_AALG_NULL && |
1084 | 1084 | ((key->sadb_key_bits+7) / 8 == 0 || |
1085 | 1085 | |
... | ... | @@ -1105,14 +1105,14 @@ |
1105 | 1105 | if (sa->sadb_sa_flags & SADB_SAFLAGS_NOPMTUDISC) |
1106 | 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 | 1109 | if (lifetime != NULL) { |
1110 | 1110 | x->lft.hard_packet_limit = _KEY2X(lifetime->sadb_lifetime_allocations); |
1111 | 1111 | x->lft.hard_byte_limit = _KEY2X(lifetime->sadb_lifetime_bytes); |
1112 | 1112 | x->lft.hard_add_expires_seconds = lifetime->sadb_lifetime_addtime; |
1113 | 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 | 1116 | if (lifetime != NULL) { |
1117 | 1117 | x->lft.soft_packet_limit = _KEY2X(lifetime->sadb_lifetime_allocations); |
1118 | 1118 | x->lft.soft_byte_limit = _KEY2X(lifetime->sadb_lifetime_bytes); |
... | ... | @@ -1120,7 +1120,7 @@ |
1120 | 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 | 1124 | if (sec_ctx != NULL) { |
1125 | 1125 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); |
1126 | 1126 | |
... | ... | @@ -1134,7 +1134,7 @@ |
1134 | 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 | 1138 | if (sa->sadb_sa_auth) { |
1139 | 1139 | int keysize = 0; |
1140 | 1140 | struct xfrm_algo_desc *a = xfrm_aalg_get_byid(sa->sadb_sa_auth); |
... | ... | @@ -2219,7 +2219,7 @@ |
2219 | 2219 | if (xp->selector.dport) |
2220 | 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 | 2223 | if (sec_ctx != NULL) { |
2224 | 2224 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); |
2225 | 2225 | |
... | ... | @@ -2323,7 +2323,7 @@ |
2323 | 2323 | if (sel.dport) |
2324 | 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 | 2327 | if (sec_ctx != NULL) { |
2328 | 2328 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); |
2329 | 2329 |
net/netlabel/netlabel_unlabeled.c
... | ... | @@ -426,10 +426,9 @@ |
426 | 426 | audit_info); |
427 | 427 | switch (addr_len) { |
428 | 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 | 432 | ret_val = netlbl_unlhsh_add_addr4(iface, addr4, mask4, secid); |
434 | 433 | if (audit_buf != NULL) |
435 | 434 | netlbl_af4list_audit_addr(audit_buf, 1, |
436 | 435 | |
... | ... | @@ -440,10 +439,9 @@ |
440 | 439 | } |
441 | 440 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
442 | 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 | 445 | ret_val = netlbl_unlhsh_add_addr6(iface, addr6, mask6, secid); |
448 | 446 | if (audit_buf != NULL) |
449 | 447 | netlbl_af6list_audit_addr(audit_buf, 1, |
net/sctp/bind_addr.c
... | ... | @@ -430,7 +430,7 @@ |
430 | 430 | list_for_each_entry(laddr, &bp->address_list, list) { |
431 | 431 | addr_buf = (union sctp_addr *)addrs; |
432 | 432 | for (i = 0; i < addrcnt; i++) { |
433 | - addr = (union sctp_addr *)addr_buf; | |
433 | + addr = addr_buf; | |
434 | 434 | af = sctp_get_af_specific(addr->v4.sin_family); |
435 | 435 | if (!af) |
436 | 436 | break; |
net/sctp/input.c
... | ... | @@ -510,8 +510,7 @@ |
510 | 510 | * discard the packet. |
511 | 511 | */ |
512 | 512 | if (vtag == 0) { |
513 | - chunkhdr = (struct sctp_init_chunk *)((void *)sctphdr | |
514 | - + sizeof(struct sctphdr)); | |
513 | + chunkhdr = (void *)sctphdr + sizeof(struct sctphdr); | |
515 | 514 | if (len < sizeof(struct sctphdr) + sizeof(sctp_chunkhdr_t) |
516 | 515 | + sizeof(__be32) || |
517 | 516 | chunkhdr->chunk_hdr.type != SCTP_CID_INIT || |
net/sctp/sm_make_chunk.c
... | ... | @@ -2773,7 +2773,7 @@ |
2773 | 2773 | /* Get total length of all the address parameters. */ |
2774 | 2774 | addr_buf = addrs; |
2775 | 2775 | for (i = 0; i < addrcnt; i++) { |
2776 | - addr = (union sctp_addr *)addr_buf; | |
2776 | + addr = addr_buf; | |
2777 | 2777 | af = sctp_get_af_specific(addr->v4.sin_family); |
2778 | 2778 | addr_param_len = af->to_addr_param(addr, &addr_param); |
2779 | 2779 | |
... | ... | @@ -2798,7 +2798,7 @@ |
2798 | 2798 | /* Add the address parameters to the asconf chunk. */ |
2799 | 2799 | addr_buf = addrs; |
2800 | 2800 | for (i = 0; i < addrcnt; i++) { |
2801 | - addr = (union sctp_addr *)addr_buf; | |
2801 | + addr = addr_buf; | |
2802 | 2802 | af = sctp_get_af_specific(addr->v4.sin_family); |
2803 | 2803 | addr_param_len = af->to_addr_param(addr, &addr_param); |
2804 | 2804 | param.param_hdr.type = flags; |
... | ... | @@ -2958,8 +2958,7 @@ |
2958 | 2958 | union sctp_addr addr; |
2959 | 2959 | union sctp_addr_param *addr_param; |
2960 | 2960 | |
2961 | - addr_param = (union sctp_addr_param *) | |
2962 | - ((void *)asconf_param + sizeof(sctp_addip_param_t)); | |
2961 | + addr_param = (void *)asconf_param + sizeof(sctp_addip_param_t); | |
2963 | 2962 | |
2964 | 2963 | if (asconf_param->param_hdr.type != SCTP_PARAM_ADD_IP && |
2965 | 2964 | asconf_param->param_hdr.type != SCTP_PARAM_DEL_IP && |
... | ... | @@ -3144,7 +3143,7 @@ |
3144 | 3143 | * asconf parameter. |
3145 | 3144 | */ |
3146 | 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 | 3147 | chunk_len -= length; |
3149 | 3148 | |
3150 | 3149 | /* create an ASCONF_ACK chunk. |
... | ... | @@ -3185,8 +3184,7 @@ |
3185 | 3184 | |
3186 | 3185 | /* Move to the next ASCONF param. */ |
3187 | 3186 | length = ntohs(asconf_param->param_hdr.length); |
3188 | - asconf_param = (sctp_addip_param_t *)((void *)asconf_param + | |
3189 | - length); | |
3187 | + asconf_param = (void *)asconf_param + length; | |
3190 | 3188 | chunk_len -= length; |
3191 | 3189 | } |
3192 | 3190 | |
... | ... | @@ -3216,8 +3214,7 @@ |
3216 | 3214 | struct sctp_transport *transport; |
3217 | 3215 | struct sctp_sockaddr_entry *saddr; |
3218 | 3216 | |
3219 | - addr_param = (union sctp_addr_param *) | |
3220 | - ((void *)asconf_param + sizeof(sctp_addip_param_t)); | |
3217 | + addr_param = (void *)asconf_param + sizeof(sctp_addip_param_t); | |
3221 | 3218 | |
3222 | 3219 | /* We have checked the packet before, so we do not check again. */ |
3223 | 3220 | af = sctp_get_af_specific(param_type2af(addr_param->p.type)); |
... | ... | @@ -3302,8 +3299,7 @@ |
3302 | 3299 | return SCTP_ERROR_NO_ERROR; |
3303 | 3300 | case SCTP_PARAM_ERR_CAUSE: |
3304 | 3301 | length = sizeof(sctp_addip_param_t); |
3305 | - err_param = (sctp_errhdr_t *) | |
3306 | - ((void *)asconf_ack_param + length); | |
3302 | + err_param = (void *)asconf_ack_param + length; | |
3307 | 3303 | asconf_ack_len -= length; |
3308 | 3304 | if (asconf_ack_len > 0) |
3309 | 3305 | return err_param->cause; |
... | ... | @@ -3316,8 +3312,7 @@ |
3316 | 3312 | } |
3317 | 3313 | |
3318 | 3314 | length = ntohs(asconf_ack_param->param_hdr.length); |
3319 | - asconf_ack_param = (sctp_addip_param_t *) | |
3320 | - ((void *)asconf_ack_param + length); | |
3315 | + asconf_ack_param = (void *)asconf_ack_param + length; | |
3321 | 3316 | asconf_ack_len -= length; |
3322 | 3317 | } |
3323 | 3318 | |
... | ... | @@ -3349,7 +3344,7 @@ |
3349 | 3344 | * pointer to the first asconf parameter. |
3350 | 3345 | */ |
3351 | 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 | 3348 | asconf_len -= length; |
3354 | 3349 | |
3355 | 3350 | /* ADDIP 4.1 |
... | ... | @@ -3400,8 +3395,7 @@ |
3400 | 3395 | * one. |
3401 | 3396 | */ |
3402 | 3397 | length = ntohs(asconf_param->param_hdr.length); |
3403 | - asconf_param = (sctp_addip_param_t *)((void *)asconf_param + | |
3404 | - length); | |
3398 | + asconf_param = (void *)asconf_param + length; | |
3405 | 3399 | asconf_len -= length; |
3406 | 3400 | } |
3407 | 3401 |
net/sctp/sm_sideeffect.c
... | ... | @@ -1201,7 +1201,7 @@ |
1201 | 1201 | int local_cork = 0; |
1202 | 1202 | |
1203 | 1203 | if (SCTP_EVENT_T_TIMEOUT != event_type) |
1204 | - chunk = (struct sctp_chunk *) event_arg; | |
1204 | + chunk = event_arg; | |
1205 | 1205 | |
1206 | 1206 | /* Note: This whole file is a huge candidate for rework. |
1207 | 1207 | * For example, each command could either have its own handler, so |
net/sctp/socket.c
... | ... | @@ -476,7 +476,7 @@ |
476 | 476 | /* The list may contain either IPv4 or IPv6 address; |
477 | 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 | 480 | af = sctp_get_af_specific(sa_addr->sa_family); |
481 | 481 | if (!af) { |
482 | 482 | retval = -EINVAL; |
... | ... | @@ -555,7 +555,7 @@ |
555 | 555 | */ |
556 | 556 | addr_buf = addrs; |
557 | 557 | for (i = 0; i < addrcnt; i++) { |
558 | - addr = (union sctp_addr *)addr_buf; | |
558 | + addr = addr_buf; | |
559 | 559 | af = sctp_get_af_specific(addr->v4.sin_family); |
560 | 560 | if (!af) { |
561 | 561 | retval = -EINVAL; |
... | ... | @@ -588,7 +588,7 @@ |
588 | 588 | */ |
589 | 589 | addr_buf = addrs; |
590 | 590 | for (i = 0; i < addrcnt; i++) { |
591 | - addr = (union sctp_addr *)addr_buf; | |
591 | + addr = addr_buf; | |
592 | 592 | af = sctp_get_af_specific(addr->v4.sin_family); |
593 | 593 | memcpy(&saveaddr, addr, af->sockaddr_len); |
594 | 594 | retval = sctp_add_bind_addr(bp, &saveaddr, |
... | ... | @@ -659,7 +659,7 @@ |
659 | 659 | goto err_bindx_rem; |
660 | 660 | } |
661 | 661 | |
662 | - sa_addr = (union sctp_addr *)addr_buf; | |
662 | + sa_addr = addr_buf; | |
663 | 663 | af = sctp_get_af_specific(sa_addr->sa.sa_family); |
664 | 664 | if (!af) { |
665 | 665 | retval = -EINVAL; |
... | ... | @@ -758,7 +758,7 @@ |
758 | 758 | */ |
759 | 759 | addr_buf = addrs; |
760 | 760 | for (i = 0; i < addrcnt; i++) { |
761 | - laddr = (union sctp_addr *)addr_buf; | |
761 | + laddr = addr_buf; | |
762 | 762 | af = sctp_get_af_specific(laddr->v4.sin_family); |
763 | 763 | if (!af) { |
764 | 764 | retval = -EINVAL; |
... | ... | @@ -830,7 +830,7 @@ |
830 | 830 | */ |
831 | 831 | addr_buf = addrs; |
832 | 832 | for (i = 0; i < addrcnt; i++) { |
833 | - laddr = (union sctp_addr *)addr_buf; | |
833 | + laddr = addr_buf; | |
834 | 834 | af = sctp_get_af_specific(laddr->v4.sin_family); |
835 | 835 | list_for_each_entry(saddr, &bp->address_list, list) { |
836 | 836 | if (sctp_cmp_addr_exact(&saddr->a, laddr)) |
... | ... | @@ -997,7 +997,7 @@ |
997 | 997 | return -EINVAL; |
998 | 998 | } |
999 | 999 | |
1000 | - sa_addr = (struct sockaddr *)addr_buf; | |
1000 | + sa_addr = addr_buf; | |
1001 | 1001 | af = sctp_get_af_specific(sa_addr->sa_family); |
1002 | 1002 | |
1003 | 1003 | /* If the address family is not supported or if this address |
... | ... | @@ -1088,7 +1088,7 @@ |
1088 | 1088 | goto out_free; |
1089 | 1089 | } |
1090 | 1090 | |
1091 | - sa_addr = (union sctp_addr *)addr_buf; | |
1091 | + sa_addr = addr_buf; | |
1092 | 1092 | af = sctp_get_af_specific(sa_addr->sa.sa_family); |
1093 | 1093 | |
1094 | 1094 | /* If the address family is not supported or if this address |