Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joe Perches and committed by
David S. Miller
ea110733 3c8def97

+74 -83
+1 -1
net/8021q/vlanproc.c
··· 231 231 232 232 ++*pos; 233 233 234 - dev = (struct net_device *)v; 234 + dev = v; 235 235 if (v == SEQ_START_TOKEN) 236 236 dev = net_device_entry(&net->dev_base_head); 237 237
+1 -1
net/atm/mpc.c
··· 1005 1005 struct mpoa_client *mpc; 1006 1006 struct lec_priv *priv; 1007 1007 1008 - dev = (struct net_device *)dev_ptr; 1008 + dev = dev_ptr; 1009 1009 1010 1010 if (!net_eq(dev_net(dev), &init_net)) 1011 1011 return NOTIFY_DONE;
+1 -1
net/ceph/crypto.c
··· 444 444 goto err; 445 445 446 446 /* TODO ceph_crypto_key_decode should really take const input */ 447 - p = (void*)data; 447 + p = (void *)data; 448 448 ret = ceph_crypto_key_decode(ckey, &p, (char*)data+datalen); 449 449 if (ret < 0) 450 450 goto err_ckey;
+1 -1
net/decnet/dn_dev.c
··· 1313 1313 1314 1314 ++*pos; 1315 1315 1316 - dev = (struct net_device *)v; 1316 + dev = v; 1317 1317 if (v == SEQ_START_TOKEN) 1318 1318 dev = net_device_entry(&init_net.dev_base_head); 1319 1319
+2 -2
net/irda/af_irda.c
··· 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 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;
+1 -1
net/irda/ircomm/ircomm_tty_attach.c
··· 382 382 info.daddr = discovery->daddr; 383 383 info.saddr = discovery->saddr; 384 384 385 - self = (struct ircomm_tty_cb *) priv; 385 + self = priv; 386 386 ircomm_tty_do_event(self, IRCOMM_TTY_DISCOVERY_INDICATION, 387 387 NULL, &info); 388 388 }
+1 -1
net/irda/irda_device.c
··· 262 262 263 263 IRDA_DEBUG(2, "%s()\n", __func__); 264 264 265 - task = (struct irda_task *) data; 265 + task = data; 266 266 267 267 irda_task_kick(task); 268 268 }
+4 -4
net/irda/iriap.c
··· 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 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 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 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;);
+5 -5
net/irda/irlan/irlan_client.c
··· 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 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 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 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 */
+5 -5
net/irda/irlan/irlan_common.c
··· 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 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 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;);
+1 -1
net/irda/irlan/irlan_eth.c
··· 272 272 struct irlan_cb *self; 273 273 struct net_device *dev; 274 274 275 - self = (struct irlan_cb *) instance; 275 + self = instance; 276 276 277 277 IRDA_ASSERT(self != NULL, return;); 278 278 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
+5 -5
net/irda/irlan/irlan_provider.c
··· 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 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 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;);
+2 -2
net/irda/irqueue.c
··· 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 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
+9 -9
net/irda/irttp.c
··· 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 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 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 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 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 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;); ··· 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 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;);
+10 -10
net/key/af_key.c
··· 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 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 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 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 || ··· 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 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 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 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 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
+4 -6
net/netlabel/netlabel_unlabeled.c
··· 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, ··· 439 440 } 440 441 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 441 442 case sizeof(struct in6_addr): { 442 - struct in6_addr *addr6, *mask6; 443 + const struct in6_addr *addr6 = addr; 444 + const struct in6_addr *mask6 = mask; 443 445 444 - addr6 = (struct in6_addr *)addr; 445 - mask6 = (struct in6_addr *)mask; 446 446 ret_val = netlbl_unlhsh_add_addr6(iface, addr6, mask6, secid); 447 447 if (audit_buf != NULL) 448 448 netlbl_af6list_audit_addr(audit_buf, 1,
+1 -1
net/sctp/bind_addr.c
··· 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;
+1 -2
net/sctp/input.c
··· 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 ||
+10 -16
net/sctp/sm_make_chunk.c
··· 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 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 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 && ··· 3143 3144 * asconf parameter. 3144 3145 */ 3145 3146 length = ntohs(addr_param->p.length); 3146 - asconf_param = (sctp_addip_param_t *)((void *)addr_param + length); 3147 + asconf_param = (void *)addr_param + length; 3147 3148 chunk_len -= length; 3148 3149 3149 3150 /* create an ASCONF_ACK chunk. ··· 3184 3185 3185 3186 /* Move to the next ASCONF param. */ 3186 3187 length = ntohs(asconf_param->param_hdr.length); 3187 - asconf_param = (sctp_addip_param_t *)((void *)asconf_param + 3188 - length); 3188 + asconf_param = (void *)asconf_param + length; 3189 3189 chunk_len -= length; 3190 3190 } 3191 3191 ··· 3214 3216 struct sctp_transport *transport; 3215 3217 struct sctp_sockaddr_entry *saddr; 3216 3218 3217 - addr_param = (union sctp_addr_param *) 3218 - ((void *)asconf_param + sizeof(sctp_addip_param_t)); 3219 + addr_param = (void *)asconf_param + sizeof(sctp_addip_param_t); 3219 3220 3220 3221 /* We have checked the packet before, so we do not check again. */ 3221 3222 af = sctp_get_af_specific(param_type2af(addr_param->p.type)); ··· 3299 3302 return SCTP_ERROR_NO_ERROR; 3300 3303 case SCTP_PARAM_ERR_CAUSE: 3301 3304 length = sizeof(sctp_addip_param_t); 3302 - err_param = (sctp_errhdr_t *) 3303 - ((void *)asconf_ack_param + length); 3305 + err_param = (void *)asconf_ack_param + length; 3304 3306 asconf_ack_len -= length; 3305 3307 if (asconf_ack_len > 0) 3306 3308 return err_param->cause; ··· 3312 3316 } 3313 3317 3314 3318 length = ntohs(asconf_ack_param->param_hdr.length); 3315 - asconf_ack_param = (sctp_addip_param_t *) 3316 - ((void *)asconf_ack_param + length); 3319 + asconf_ack_param = (void *)asconf_ack_param + length; 3317 3320 asconf_ack_len -= length; 3318 3321 } 3319 3322 ··· 3344 3349 * pointer to the first asconf parameter. 3345 3350 */ 3346 3351 length = ntohs(addr_param->p.length); 3347 - asconf_param = (sctp_addip_param_t *)((void *)addr_param + length); 3352 + asconf_param = (void *)addr_param + length; 3348 3353 asconf_len -= length; 3349 3354 3350 3355 /* ADDIP 4.1 ··· 3395 3400 * one. 3396 3401 */ 3397 3402 length = ntohs(asconf_param->param_hdr.length); 3398 - asconf_param = (sctp_addip_param_t *)((void *)asconf_param + 3399 - length); 3403 + asconf_param = (void *)asconf_param + length; 3400 3404 asconf_len -= length; 3401 3405 } 3402 3406
+1 -1
net/sctp/sm_sideeffect.c
··· 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
+8 -8
net/sctp/socket.c
··· 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 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 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 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 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 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 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 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