mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
29a6b6c060
commit
e3192690a3
14 changed files with 32 additions and 36 deletions
|
|
@ -1522,8 +1522,8 @@ static int pppol2tp_session_getsockopt(struct sock *sk,
|
|||
* handler, according to whether the PPPoX socket is a for a regular session
|
||||
* or the special tunnel type.
|
||||
*/
|
||||
static int pppol2tp_getsockopt(struct socket *sock, int level,
|
||||
int optname, char __user *optval, int __user *optlen)
|
||||
static int pppol2tp_getsockopt(struct socket *sock, int level, int optname,
|
||||
char __user *optval, int __user *optlen)
|
||||
{
|
||||
struct sock *sk = sock->sk;
|
||||
struct l2tp_session *session;
|
||||
|
|
@ -1535,7 +1535,7 @@ static int pppol2tp_getsockopt(struct socket *sock, int level,
|
|||
if (level != SOL_PPPOL2TP)
|
||||
return udp_prot.getsockopt(sk, level, optname, optval, optlen);
|
||||
|
||||
if (get_user(len, (int __user *) optlen))
|
||||
if (get_user(len, optlen))
|
||||
return -EFAULT;
|
||||
|
||||
len = min_t(unsigned int, len, sizeof(int));
|
||||
|
|
@ -1568,7 +1568,7 @@ static int pppol2tp_getsockopt(struct socket *sock, int level,
|
|||
err = pppol2tp_session_getsockopt(sk, session, optname, &val);
|
||||
|
||||
err = -EFAULT;
|
||||
if (put_user(len, (int __user *) optlen))
|
||||
if (put_user(len, optlen))
|
||||
goto end_put_sess;
|
||||
|
||||
if (copy_to_user((void __user *) optval, &val, len))
|
||||
|
|
|
|||
Loading…
Reference in a new issue