aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-06-03 13:41:40 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-04 11:45:11 -0400
commite3192690a3c889767d1161b228374f4926d92af0 (patch)
treea2acbe06cc2efedb6002055f9d4ffd7f2ba6ec75 /net/ipv6
parent29a6b6c060445eb46528785d51a2d8b0e6d898c4 (diff)
net: Remove casts to same type
Adding casts of objects to the same type is unnecessary and confusing for a human reader. For example, this cast: int y; int *p = (int *)&y; I used the coccinelle script below to find and remove these unnecessary casts. I manually removed the conversions this script produces of casts with __force and __user. @@ type T; T *p; @@ - (T *)p + p Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/exthdrs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 6447dc49429f..fa3d9c328092 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -791,14 +791,14 @@ static int ipv6_renew_option(void *ohdr,
791 if (ohdr) { 791 if (ohdr) {
792 memcpy(*p, ohdr, ipv6_optlen((struct ipv6_opt_hdr *)ohdr)); 792 memcpy(*p, ohdr, ipv6_optlen((struct ipv6_opt_hdr *)ohdr));
793 *hdr = (struct ipv6_opt_hdr *)*p; 793 *hdr = (struct ipv6_opt_hdr *)*p;
794 *p += CMSG_ALIGN(ipv6_optlen(*(struct ipv6_opt_hdr **)hdr)); 794 *p += CMSG_ALIGN(ipv6_optlen(*hdr));
795 } 795 }
796 } else { 796 } else {
797 if (newopt) { 797 if (newopt) {
798 if (copy_from_user(*p, newopt, newoptlen)) 798 if (copy_from_user(*p, newopt, newoptlen))
799 return -EFAULT; 799 return -EFAULT;
800 *hdr = (struct ipv6_opt_hdr *)*p; 800 *hdr = (struct ipv6_opt_hdr *)*p;
801 if (ipv6_optlen(*(struct ipv6_opt_hdr **)hdr) > newoptlen) 801 if (ipv6_optlen(*hdr) > newoptlen)
802 return -EINVAL; 802 return -EINVAL;
803 *p += CMSG_ALIGN(newoptlen); 803 *p += CMSG_ALIGN(newoptlen);
804 } 804 }