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>
This commit is contained in:

committed by
David S. Miller

parent
29a6b6c060
commit
e3192690a3
@@ -791,14 +791,14 @@ static int ipv6_renew_option(void *ohdr,
|
||||
if (ohdr) {
|
||||
memcpy(*p, ohdr, ipv6_optlen((struct ipv6_opt_hdr *)ohdr));
|
||||
*hdr = (struct ipv6_opt_hdr *)*p;
|
||||
*p += CMSG_ALIGN(ipv6_optlen(*(struct ipv6_opt_hdr **)hdr));
|
||||
*p += CMSG_ALIGN(ipv6_optlen(*hdr));
|
||||
}
|
||||
} else {
|
||||
if (newopt) {
|
||||
if (copy_from_user(*p, newopt, newoptlen))
|
||||
return -EFAULT;
|
||||
*hdr = (struct ipv6_opt_hdr *)*p;
|
||||
if (ipv6_optlen(*(struct ipv6_opt_hdr **)hdr) > newoptlen)
|
||||
if (ipv6_optlen(*hdr) > newoptlen)
|
||||
return -EINVAL;
|
||||
*p += CMSG_ALIGN(newoptlen);
|
||||
}
|
||||
|
Reference in New Issue
Block a user