@@ -154,12 +154,12 @@ static inline struct l2tp_session *pppol2tp_sock_to_session(struct sock *sk)
154154{
155155 struct l2tp_session * session ;
156156
157- if (sk == NULL )
157+ if (! sk )
158158 return NULL ;
159159
160160 sock_hold (sk );
161161 session = (struct l2tp_session * )(sk -> sk_user_data );
162- if (session == NULL ) {
162+ if (! session ) {
163163 sock_put (sk );
164164 goto out ;
165165 }
@@ -217,7 +217,7 @@ static void pppol2tp_recv(struct l2tp_session *session, struct sk_buff *skb, int
217217 */
218218 rcu_read_lock ();
219219 sk = rcu_dereference (ps -> sk );
220- if (sk == NULL )
220+ if (! sk )
221221 goto no_sock ;
222222
223223 /* If the first two bytes are 0xFF03, consider that it is the PPP's
@@ -285,7 +285,7 @@ static int pppol2tp_sendmsg(struct socket *sock, struct msghdr *m,
285285 /* Get session and tunnel contexts */
286286 error = - EBADF ;
287287 session = pppol2tp_sock_to_session (sk );
288- if (session == NULL )
288+ if (! session )
289289 goto error ;
290290
291291 tunnel = session -> tunnel ;
@@ -360,7 +360,7 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
360360
361361 /* Get session and tunnel contexts from the socket */
362362 session = pppol2tp_sock_to_session (sk );
363- if (session == NULL )
363+ if (! session )
364364 goto abort ;
365365
366366 tunnel = session -> tunnel ;
@@ -703,7 +703,7 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
703703 * tunnel id.
704704 */
705705 if (!info .session_id && !info .peer_session_id ) {
706- if (tunnel == NULL ) {
706+ if (! tunnel ) {
707707 struct l2tp_tunnel_cfg tcfg = {
708708 .encap = L2TP_ENCAPTYPE_UDP ,
709709 .debug = 0 ,
@@ -738,11 +738,11 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
738738 } else {
739739 /* Error if we can't find the tunnel */
740740 error = - ENOENT ;
741- if (tunnel == NULL )
741+ if (! tunnel )
742742 goto end ;
743743
744744 /* Error if socket is not prepped */
745- if (tunnel -> sock == NULL )
745+ if (! tunnel -> sock )
746746 goto end ;
747747 }
748748
@@ -911,14 +911,14 @@ static int pppol2tp_getname(struct socket *sock, struct sockaddr *uaddr,
911911 struct pppol2tp_session * pls ;
912912
913913 error = - ENOTCONN ;
914- if (sk == NULL )
914+ if (! sk )
915915 goto end ;
916916 if (!(sk -> sk_state & PPPOX_CONNECTED ))
917917 goto end ;
918918
919919 error = - EBADF ;
920920 session = pppol2tp_sock_to_session (sk );
921- if (session == NULL )
921+ if (! session )
922922 goto end ;
923923
924924 pls = l2tp_session_priv (session );
@@ -1263,13 +1263,13 @@ static int pppol2tp_setsockopt(struct socket *sock, int level, int optname,
12631263 return - EFAULT ;
12641264
12651265 err = - ENOTCONN ;
1266- if (sk -> sk_user_data == NULL )
1266+ if (! sk -> sk_user_data )
12671267 goto end ;
12681268
12691269 /* Get session context from the socket */
12701270 err = - EBADF ;
12711271 session = pppol2tp_sock_to_session (sk );
1272- if (session == NULL )
1272+ if (! session )
12731273 goto end ;
12741274
12751275 /* Special case: if session_id == 0x0000, treat as operation on tunnel
@@ -1382,13 +1382,13 @@ static int pppol2tp_getsockopt(struct socket *sock, int level, int optname,
13821382 return - EINVAL ;
13831383
13841384 err = - ENOTCONN ;
1385- if (sk -> sk_user_data == NULL )
1385+ if (! sk -> sk_user_data )
13861386 goto end ;
13871387
13881388 /* Get the session context */
13891389 err = - EBADF ;
13901390 session = pppol2tp_sock_to_session (sk );
1391- if (session == NULL )
1391+ if (! session )
13921392 goto end ;
13931393
13941394 /* Special case: if session_id == 0x0000, treat as operation on tunnel */
@@ -1464,7 +1464,7 @@ static void pppol2tp_next_session(struct net *net, struct pppol2tp_seq_data *pd)
14641464 pd -> session = l2tp_session_get_nth (pd -> tunnel , pd -> session_idx );
14651465 pd -> session_idx ++ ;
14661466
1467- if (pd -> session == NULL ) {
1467+ if (! pd -> session ) {
14681468 pd -> session_idx = 0 ;
14691469 pppol2tp_next_tunnel (net , pd );
14701470 }
@@ -1479,17 +1479,17 @@ static void *pppol2tp_seq_start(struct seq_file *m, loff_t *offs)
14791479 if (!pos )
14801480 goto out ;
14811481
1482- BUG_ON (m -> private == NULL );
1482+ BUG_ON (! m -> private );
14831483 pd = m -> private ;
14841484 net = seq_file_net (m );
14851485
1486- if (pd -> tunnel == NULL )
1486+ if (! pd -> tunnel )
14871487 pppol2tp_next_tunnel (net , pd );
14881488 else
14891489 pppol2tp_next_session (net , pd );
14901490
14911491 /* NULL tunnel and session indicates end of list */
1492- if (( pd -> tunnel == NULL ) && ( pd -> session == NULL ) )
1492+ if (! pd -> tunnel && ! pd -> session )
14931493 pd = NULL ;
14941494
14951495out :
0 commit comments