summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorIan Morris <ipm@chirality.org.uk>2015-04-03 04:17:27 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-03 12:11:15 -0400
commit00db41243e8d5032c2e0f5bf6063bb19324bfdb3 (patch)
tree627f419868eac50f1ae8582915827b2525fc5999 /net/ipv4/tcp.c
parent51456b2914a34d16b1255b7c55d5cbf6a681d306 (diff)
ipv4: coding style: comparison for inequality with NULL
The ipv4 code uses a mixture of coding styles. In some instances check for non-NULL pointer is done as x != NULL and sometimes as x. x is preferred according to checkpatch and this patch makes the code consistent by adopting the latter form. No changes detected by objdiff. Signed-off-by: Ian Morris <ipm@chirality.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 5bd809bfd0aa..094a6822c71d 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -496,7 +496,7 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
496 496
497 /* Connected or passive Fast Open socket? */ 497 /* Connected or passive Fast Open socket? */
498 if (sk->sk_state != TCP_SYN_SENT && 498 if (sk->sk_state != TCP_SYN_SENT &&
499 (sk->sk_state != TCP_SYN_RECV || tp->fastopen_rsk != NULL)) { 499 (sk->sk_state != TCP_SYN_RECV || tp->fastopen_rsk)) {
500 int target = sock_rcvlowat(sk, 0, INT_MAX); 500 int target = sock_rcvlowat(sk, 0, INT_MAX);
501 501
502 if (tp->urg_seq == tp->copied_seq && 502 if (tp->urg_seq == tp->copied_seq &&
@@ -1028,7 +1028,7 @@ static inline int select_size(const struct sock *sk, bool sg)
1028 1028
1029void tcp_free_fastopen_req(struct tcp_sock *tp) 1029void tcp_free_fastopen_req(struct tcp_sock *tp)
1030{ 1030{
1031 if (tp->fastopen_req != NULL) { 1031 if (tp->fastopen_req) {
1032 kfree(tp->fastopen_req); 1032 kfree(tp->fastopen_req);
1033 tp->fastopen_req = NULL; 1033 tp->fastopen_req = NULL;
1034 } 1034 }
@@ -1042,7 +1042,7 @@ static int tcp_sendmsg_fastopen(struct sock *sk, struct msghdr *msg,
1042 1042
1043 if (!(sysctl_tcp_fastopen & TFO_CLIENT_ENABLE)) 1043 if (!(sysctl_tcp_fastopen & TFO_CLIENT_ENABLE))
1044 return -EOPNOTSUPP; 1044 return -EOPNOTSUPP;
1045 if (tp->fastopen_req != NULL) 1045 if (tp->fastopen_req)
1046 return -EALREADY; /* Another Fast Open is in progress */ 1046 return -EALREADY; /* Another Fast Open is in progress */
1047 1047
1048 tp->fastopen_req = kzalloc(sizeof(struct tcp_fastopen_request), 1048 tp->fastopen_req = kzalloc(sizeof(struct tcp_fastopen_request),
@@ -2138,7 +2138,7 @@ adjudge_to_death:
2138 * aborted (e.g., closed with unread data) before 3WHS 2138 * aborted (e.g., closed with unread data) before 3WHS
2139 * finishes. 2139 * finishes.
2140 */ 2140 */
2141 if (req != NULL) 2141 if (req)
2142 reqsk_fastopen_remove(sk, req, false); 2142 reqsk_fastopen_remove(sk, req, false);
2143 inet_csk_destroy_sock(sk); 2143 inet_csk_destroy_sock(sk);
2144 } 2144 }
@@ -2776,7 +2776,7 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
2776 break; 2776 break;
2777 2777
2778 case TCP_FASTOPEN: 2778 case TCP_FASTOPEN:
2779 if (icsk->icsk_accept_queue.fastopenq != NULL) 2779 if (icsk->icsk_accept_queue.fastopenq)
2780 val = icsk->icsk_accept_queue.fastopenq->max_qlen; 2780 val = icsk->icsk_accept_queue.fastopenq->max_qlen;
2781 else 2781 else
2782 val = 0; 2782 val = 0;
@@ -2960,7 +2960,7 @@ void tcp_done(struct sock *sk)
2960 2960
2961 tcp_set_state(sk, TCP_CLOSE); 2961 tcp_set_state(sk, TCP_CLOSE);
2962 tcp_clear_xmit_timers(sk); 2962 tcp_clear_xmit_timers(sk);
2963 if (req != NULL) 2963 if (req)
2964 reqsk_fastopen_remove(sk, req, false); 2964 reqsk_fastopen_remove(sk, req, false);
2965 2965
2966 sk->sk_shutdown = SHUTDOWN_MASK; 2966 sk->sk_shutdown = SHUTDOWN_MASK;