aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2008-11-19 18:44:53 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-19 18:44:53 -0500
commit07f0757a6808f2f36a0e58c3a54867ccffdb8dc9 (patch)
treee04b573c3f1471ff21c6b2499682a620f4db7eae /net
parenta7a0d6a87b70f7b2bab5281fc0fd443772bd0795 (diff)
include/net net/ - csum_partial - remove unnecessary casts
The first argument to csum_partial is const void * casts to char/u8 * are not necessary Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/netpoll.c2
-rw-r--r--net/ipv4/inet_lro.c4
-rw-r--r--net/ipv4/tcp_ipv4.c4
-rw-r--r--net/ipv6/icmp.c4
-rw-r--r--net/ipv6/mcast.c2
-rw-r--r--net/ipv6/ndisc.c4
-rw-r--r--net/ipv6/tcp_ipv6.c6
-rw-r--r--net/unix/af_unix.c4
8 files changed, 15 insertions, 15 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 34f5d072f168..fc4e28e23b89 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -343,7 +343,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
343 udph->check = csum_tcpudp_magic(htonl(np->local_ip), 343 udph->check = csum_tcpudp_magic(htonl(np->local_ip),
344 htonl(np->remote_ip), 344 htonl(np->remote_ip),
345 udp_len, IPPROTO_UDP, 345 udp_len, IPPROTO_UDP,
346 csum_partial((unsigned char *)udph, udp_len, 0)); 346 csum_partial(udph, udp_len, 0));
347 if (udph->check == 0) 347 if (udph->check == 0)
348 udph->check = CSUM_MANGLED_0; 348 udph->check = CSUM_MANGLED_0;
349 349
diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c
index cfd034a2b96e..6a667dae315e 100644
--- a/net/ipv4/inet_lro.c
+++ b/net/ipv4/inet_lro.c
@@ -120,7 +120,7 @@ static void lro_update_tcp_ip_header(struct net_lro_desc *lro_desc)
120 iph->check = ip_fast_csum((u8 *)lro_desc->iph, iph->ihl); 120 iph->check = ip_fast_csum((u8 *)lro_desc->iph, iph->ihl);
121 121
122 tcph->check = 0; 122 tcph->check = 0;
123 tcp_hdr_csum = csum_partial((u8 *)tcph, TCP_HDR_LEN(tcph), 0); 123 tcp_hdr_csum = csum_partial(tcph, TCP_HDR_LEN(tcph), 0);
124 lro_desc->data_csum = csum_add(lro_desc->data_csum, tcp_hdr_csum); 124 lro_desc->data_csum = csum_add(lro_desc->data_csum, tcp_hdr_csum);
125 tcph->check = csum_tcpudp_magic(iph->saddr, iph->daddr, 125 tcph->check = csum_tcpudp_magic(iph->saddr, iph->daddr,
126 lro_desc->ip_tot_len - 126 lro_desc->ip_tot_len -
@@ -135,7 +135,7 @@ static __wsum lro_tcp_data_csum(struct iphdr *iph, struct tcphdr *tcph, int len)
135 __wsum tcp_ps_hdr_csum; 135 __wsum tcp_ps_hdr_csum;
136 136
137 tcp_csum = ~csum_unfold(tcph->check); 137 tcp_csum = ~csum_unfold(tcph->check);
138 tcp_hdr_csum = csum_partial((u8 *)tcph, TCP_HDR_LEN(tcph), tcp_csum); 138 tcp_hdr_csum = csum_partial(tcph, TCP_HDR_LEN(tcph), tcp_csum);
139 139
140 tcp_ps_hdr_csum = csum_tcpudp_nofold(iph->saddr, iph->daddr, 140 tcp_ps_hdr_csum = csum_tcpudp_nofold(iph->saddr, iph->daddr,
141 len + TCP_HDR_LEN(tcph), 141 len + TCP_HDR_LEN(tcph),
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index b2e3ab2287ba..5559fea61e87 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -492,7 +492,7 @@ void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb)
492 skb->csum_offset = offsetof(struct tcphdr, check); 492 skb->csum_offset = offsetof(struct tcphdr, check);
493 } else { 493 } else {
494 th->check = tcp_v4_check(len, inet->saddr, inet->daddr, 494 th->check = tcp_v4_check(len, inet->saddr, inet->daddr,
495 csum_partial((char *)th, 495 csum_partial(th,
496 th->doff << 2, 496 th->doff << 2,
497 skb->csum)); 497 skb->csum));
498 } 498 }
@@ -726,7 +726,7 @@ static int __tcp_v4_send_synack(struct sock *sk, struct request_sock *req,
726 th->check = tcp_v4_check(skb->len, 726 th->check = tcp_v4_check(skb->len,
727 ireq->loc_addr, 727 ireq->loc_addr,
728 ireq->rmt_addr, 728 ireq->rmt_addr,
729 csum_partial((char *)th, skb->len, 729 csum_partial(th, skb->len,
730 skb->csum)); 730 skb->csum));
731 731
732 err = ip_build_and_send_pkt(skb, sk, ireq->loc_addr, 732 err = ip_build_and_send_pkt(skb, sk, ireq->loc_addr,
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index be351009fd03..a77b8d103804 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -233,7 +233,7 @@ static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct
233 icmp6h->icmp6_cksum = 0; 233 icmp6h->icmp6_cksum = 0;
234 234
235 if (skb_queue_len(&sk->sk_write_queue) == 1) { 235 if (skb_queue_len(&sk->sk_write_queue) == 1) {
236 skb->csum = csum_partial((char *)icmp6h, 236 skb->csum = csum_partial(icmp6h,
237 sizeof(struct icmp6hdr), skb->csum); 237 sizeof(struct icmp6hdr), skb->csum);
238 icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src, 238 icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src,
239 &fl->fl6_dst, 239 &fl->fl6_dst,
@@ -246,7 +246,7 @@ static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct
246 tmp_csum = csum_add(tmp_csum, skb->csum); 246 tmp_csum = csum_add(tmp_csum, skb->csum);
247 } 247 }
248 248
249 tmp_csum = csum_partial((char *)icmp6h, 249 tmp_csum = csum_partial(icmp6h,
250 sizeof(struct icmp6hdr), tmp_csum); 250 sizeof(struct icmp6hdr), tmp_csum);
251 icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src, 251 icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src,
252 &fl->fl6_dst, 252 &fl->fl6_dst,
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index a76199ecad23..870a1d64605a 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1817,7 +1817,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
1817 1817
1818 hdr->icmp6_cksum = csum_ipv6_magic(saddr, snd_addr, len, 1818 hdr->icmp6_cksum = csum_ipv6_magic(saddr, snd_addr, len,
1819 IPPROTO_ICMPV6, 1819 IPPROTO_ICMPV6,
1820 csum_partial((__u8 *) hdr, len, 0)); 1820 csum_partial(hdr, len, 0));
1821 1821
1822 idev = in6_dev_get(skb->dev); 1822 idev = in6_dev_get(skb->dev);
1823 1823
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index fbf451c0d77a..af6705f03b5c 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -491,7 +491,7 @@ struct sk_buff *ndisc_build_skb(struct net_device *dev,
491 491
492 hdr->icmp6_cksum = csum_ipv6_magic(saddr, daddr, len, 492 hdr->icmp6_cksum = csum_ipv6_magic(saddr, daddr, len,
493 IPPROTO_ICMPV6, 493 IPPROTO_ICMPV6,
494 csum_partial((__u8 *) hdr, 494 csum_partial(hdr,
495 len, 0)); 495 len, 0));
496 496
497 return skb; 497 return skb;
@@ -1612,7 +1612,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
1612 1612
1613 icmph->icmp6_cksum = csum_ipv6_magic(&saddr_buf, &ipv6_hdr(skb)->saddr, 1613 icmph->icmp6_cksum = csum_ipv6_magic(&saddr_buf, &ipv6_hdr(skb)->saddr,
1614 len, IPPROTO_ICMPV6, 1614 len, IPPROTO_ICMPV6,
1615 csum_partial((u8 *) icmph, len, 0)); 1615 csum_partial(icmph, len, 0));
1616 1616
1617 buff->dst = dst; 1617 buff->dst = dst;
1618 idev = in6_dev_get(dst->dev); 1618 idev = in6_dev_get(dst->dev);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index b35787056313..a5d750acd793 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -501,7 +501,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req)
501 501
502 th->check = tcp_v6_check(th, skb->len, 502 th->check = tcp_v6_check(th, skb->len,
503 &treq->loc_addr, &treq->rmt_addr, 503 &treq->loc_addr, &treq->rmt_addr,
504 csum_partial((char *)th, skb->len, skb->csum)); 504 csum_partial(th, skb->len, skb->csum));
505 505
506 ipv6_addr_copy(&fl.fl6_dst, &treq->rmt_addr); 506 ipv6_addr_copy(&fl.fl6_dst, &treq->rmt_addr);
507 err = ip6_xmit(sk, skb, &fl, opt, 0); 507 err = ip6_xmit(sk, skb, &fl, opt, 0);
@@ -915,7 +915,7 @@ static void tcp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb)
915 skb->csum_offset = offsetof(struct tcphdr, check); 915 skb->csum_offset = offsetof(struct tcphdr, check);
916 } else { 916 } else {
917 th->check = csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP, 917 th->check = csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP,
918 csum_partial((char *)th, th->doff<<2, 918 csum_partial(th, th->doff<<2,
919 skb->csum)); 919 skb->csum));
920 } 920 }
921} 921}
@@ -997,7 +997,7 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win,
997 } 997 }
998#endif 998#endif
999 999
1000 buff->csum = csum_partial((char *)t1, tot_len, 0); 1000 buff->csum = csum_partial(t1, tot_len, 0);
1001 1001
1002 memset(&fl, 0, sizeof(fl)); 1002 memset(&fl, 0, sizeof(fl));
1003 ipv6_addr_copy(&fl.fl6_dst, &ipv6_hdr(skb)->saddr); 1003 ipv6_addr_copy(&fl.fl6_dst, &ipv6_hdr(skb)->saddr);
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index f2cf3f583f62..ebc4a9a4b1f7 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -216,7 +216,7 @@ static int unix_mkname(struct sockaddr_un *sunaddr, int len, unsigned *hashp)
216 return len; 216 return len;
217 } 217 }
218 218
219 *hashp = unix_hash_fold(csum_partial((char *)sunaddr, len, 0)); 219 *hashp = unix_hash_fold(csum_partial(sunaddr, len, 0));
220 return len; 220 return len;
221} 221}
222 222
@@ -686,7 +686,7 @@ static int unix_autobind(struct socket *sock)
686 686
687retry: 687retry:
688 addr->len = sprintf(addr->name->sun_path+1, "%05x", ordernum) + 1 + sizeof(short); 688 addr->len = sprintf(addr->name->sun_path+1, "%05x", ordernum) + 1 + sizeof(short);
689 addr->hash = unix_hash_fold(csum_partial((void *)addr->name, addr->len, 0)); 689 addr->hash = unix_hash_fold(csum_partial(addr->name, addr->len, 0));
690 690
691 spin_lock(&unix_table_lock); 691 spin_lock(&unix_table_lock);
692 ordernum = (ordernum+1)&0xFFFFF; 692 ordernum = (ordernum+1)&0xFFFFF;