aboutsummaryrefslogtreecommitdiffstats
path: root/net/l2tp/l2tp_ppp.c
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/l2tp/l2tp_ppp.c
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/l2tp/l2tp_ppp.c')
-rw-r--r--net/l2tp/l2tp_ppp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index 8ef6b9416cba..286366ef8930 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -1522,8 +1522,8 @@ static int pppol2tp_session_getsockopt(struct sock *sk,
1522 * handler, according to whether the PPPoX socket is a for a regular session 1522 * handler, according to whether the PPPoX socket is a for a regular session
1523 * or the special tunnel type. 1523 * or the special tunnel type.
1524 */ 1524 */
1525static int pppol2tp_getsockopt(struct socket *sock, int level, 1525static int pppol2tp_getsockopt(struct socket *sock, int level, int optname,
1526 int optname, char __user *optval, int __user *optlen) 1526 char __user *optval, int __user *optlen)
1527{ 1527{
1528 struct sock *sk = sock->sk; 1528 struct sock *sk = sock->sk;
1529 struct l2tp_session *session; 1529 struct l2tp_session *session;
@@ -1535,7 +1535,7 @@ static int pppol2tp_getsockopt(struct socket *sock, int level,
1535 if (level != SOL_PPPOL2TP) 1535 if (level != SOL_PPPOL2TP)
1536 return udp_prot.getsockopt(sk, level, optname, optval, optlen); 1536 return udp_prot.getsockopt(sk, level, optname, optval, optlen);
1537 1537
1538 if (get_user(len, (int __user *) optlen)) 1538 if (get_user(len, optlen))
1539 return -EFAULT; 1539 return -EFAULT;
1540 1540
1541 len = min_t(unsigned int, len, sizeof(int)); 1541 len = min_t(unsigned int, len, sizeof(int));
@@ -1568,7 +1568,7 @@ static int pppol2tp_getsockopt(struct socket *sock, int level,
1568 err = pppol2tp_session_getsockopt(sk, session, optname, &val); 1568 err = pppol2tp_session_getsockopt(sk, session, optname, &val);
1569 1569
1570 err = -EFAULT; 1570 err = -EFAULT;
1571 if (put_user(len, (int __user *) optlen)) 1571 if (put_user(len, optlen))
1572 goto end_put_sess; 1572 goto end_put_sess;
1573 1573
1574 if (copy_to_user((void __user *) optval, &val, len)) 1574 if (copy_to_user((void __user *) optval, &val, len))