diff options
author | Ian Morris <ipm@chirality.org.uk> | 2015-04-03 04:17:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-03 12:11:15 -0400 |
commit | 00db41243e8d5032c2e0f5bf6063bb19324bfdb3 (patch) | |
tree | 627f419868eac50f1ae8582915827b2525fc5999 /net/ipv4/tcp_minisocks.c | |
parent | 51456b2914a34d16b1255b7c55d5cbf6a681d306 (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_minisocks.c')
-rw-r--r-- | net/ipv4/tcp_minisocks.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index f0db1599a09c..d7003911c894 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
@@ -294,7 +294,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) | |||
294 | if (tcp_death_row.tw_count < tcp_death_row.sysctl_max_tw_buckets) | 294 | if (tcp_death_row.tw_count < tcp_death_row.sysctl_max_tw_buckets) |
295 | tw = inet_twsk_alloc(sk, state); | 295 | tw = inet_twsk_alloc(sk, state); |
296 | 296 | ||
297 | if (tw != NULL) { | 297 | if (tw) { |
298 | struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); | 298 | struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); |
299 | const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1); | 299 | const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1); |
300 | struct inet_sock *inet = inet_sk(sk); | 300 | struct inet_sock *inet = inet_sk(sk); |
@@ -332,7 +332,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) | |||
332 | struct tcp_md5sig_key *key; | 332 | struct tcp_md5sig_key *key; |
333 | tcptw->tw_md5_key = NULL; | 333 | tcptw->tw_md5_key = NULL; |
334 | key = tp->af_specific->md5_lookup(sk, sk); | 334 | key = tp->af_specific->md5_lookup(sk, sk); |
335 | if (key != NULL) { | 335 | if (key) { |
336 | tcptw->tw_md5_key = kmemdup(key, sizeof(*key), GFP_ATOMIC); | 336 | tcptw->tw_md5_key = kmemdup(key, sizeof(*key), GFP_ATOMIC); |
337 | if (tcptw->tw_md5_key && !tcp_alloc_md5sig_pool()) | 337 | if (tcptw->tw_md5_key && !tcp_alloc_md5sig_pool()) |
338 | BUG(); | 338 | BUG(); |
@@ -454,7 +454,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req, | |||
454 | { | 454 | { |
455 | struct sock *newsk = inet_csk_clone_lock(sk, req, GFP_ATOMIC); | 455 | struct sock *newsk = inet_csk_clone_lock(sk, req, GFP_ATOMIC); |
456 | 456 | ||
457 | if (newsk != NULL) { | 457 | if (newsk) { |
458 | const struct inet_request_sock *ireq = inet_rsk(req); | 458 | const struct inet_request_sock *ireq = inet_rsk(req); |
459 | struct tcp_request_sock *treq = tcp_rsk(req); | 459 | struct tcp_request_sock *treq = tcp_rsk(req); |
460 | struct inet_connection_sock *newicsk = inet_csk(newsk); | 460 | struct inet_connection_sock *newicsk = inet_csk(newsk); |