diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2008-07-26 00:43:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-26 00:43:18 -0400 |
commit | 547b792cac0a038b9dbf958d3c120df3740b5572 (patch) | |
tree | 08554d083b0ca7d65739dc1ce12f9b12a9b8e1f8 /net/ipv4/inet_connection_sock.c | |
parent | 53e5e96ec18da6f65e89f05674711e1c93d8df67 (diff) |
net: convert BUG_TRAP to generic WARN_ON
Removes legacy reinvent-the-wheel type thing. The generic
machinery integrates much better to automated debugging aids
such as kerneloops.org (and others), and is unambiguous due to
better naming. Non-intuively BUG_TRAP() is actually equal to
WARN_ON() rather than BUG_ON() though some might actually be
promoted to BUG_ON() but I left that to future.
I could make at least one BUILD_BUG_ON conversion.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_connection_sock.c')
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index bb81c958b744..0c1ae68ee84b 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -167,7 +167,7 @@ tb_not_found: | |||
167 | success: | 167 | success: |
168 | if (!inet_csk(sk)->icsk_bind_hash) | 168 | if (!inet_csk(sk)->icsk_bind_hash) |
169 | inet_bind_hash(sk, tb, snum); | 169 | inet_bind_hash(sk, tb, snum); |
170 | BUG_TRAP(inet_csk(sk)->icsk_bind_hash == tb); | 170 | WARN_ON(inet_csk(sk)->icsk_bind_hash != tb); |
171 | ret = 0; | 171 | ret = 0; |
172 | 172 | ||
173 | fail_unlock: | 173 | fail_unlock: |
@@ -260,7 +260,7 @@ struct sock *inet_csk_accept(struct sock *sk, int flags, int *err) | |||
260 | } | 260 | } |
261 | 261 | ||
262 | newsk = reqsk_queue_get_child(&icsk->icsk_accept_queue, sk); | 262 | newsk = reqsk_queue_get_child(&icsk->icsk_accept_queue, sk); |
263 | BUG_TRAP(newsk->sk_state != TCP_SYN_RECV); | 263 | WARN_ON(newsk->sk_state == TCP_SYN_RECV); |
264 | out: | 264 | out: |
265 | release_sock(sk); | 265 | release_sock(sk); |
266 | return newsk; | 266 | return newsk; |
@@ -386,7 +386,7 @@ struct request_sock *inet_csk_search_req(const struct sock *sk, | |||
386 | ireq->rmt_addr == raddr && | 386 | ireq->rmt_addr == raddr && |
387 | ireq->loc_addr == laddr && | 387 | ireq->loc_addr == laddr && |
388 | AF_INET_FAMILY(req->rsk_ops->family)) { | 388 | AF_INET_FAMILY(req->rsk_ops->family)) { |
389 | BUG_TRAP(!req->sk); | 389 | WARN_ON(req->sk); |
390 | *prevp = prev; | 390 | *prevp = prev; |
391 | break; | 391 | break; |
392 | } | 392 | } |
@@ -539,14 +539,14 @@ EXPORT_SYMBOL_GPL(inet_csk_clone); | |||
539 | */ | 539 | */ |
540 | void inet_csk_destroy_sock(struct sock *sk) | 540 | void inet_csk_destroy_sock(struct sock *sk) |
541 | { | 541 | { |
542 | BUG_TRAP(sk->sk_state == TCP_CLOSE); | 542 | WARN_ON(sk->sk_state != TCP_CLOSE); |
543 | BUG_TRAP(sock_flag(sk, SOCK_DEAD)); | 543 | WARN_ON(!sock_flag(sk, SOCK_DEAD)); |
544 | 544 | ||
545 | /* It cannot be in hash table! */ | 545 | /* It cannot be in hash table! */ |
546 | BUG_TRAP(sk_unhashed(sk)); | 546 | WARN_ON(!sk_unhashed(sk)); |
547 | 547 | ||
548 | /* If it has not 0 inet_sk(sk)->num, it must be bound */ | 548 | /* If it has not 0 inet_sk(sk)->num, it must be bound */ |
549 | BUG_TRAP(!inet_sk(sk)->num || inet_csk(sk)->icsk_bind_hash); | 549 | WARN_ON(inet_sk(sk)->num && !inet_csk(sk)->icsk_bind_hash); |
550 | 550 | ||
551 | sk->sk_prot->destroy(sk); | 551 | sk->sk_prot->destroy(sk); |
552 | 552 | ||
@@ -629,7 +629,7 @@ void inet_csk_listen_stop(struct sock *sk) | |||
629 | 629 | ||
630 | local_bh_disable(); | 630 | local_bh_disable(); |
631 | bh_lock_sock(child); | 631 | bh_lock_sock(child); |
632 | BUG_TRAP(!sock_owned_by_user(child)); | 632 | WARN_ON(sock_owned_by_user(child)); |
633 | sock_hold(child); | 633 | sock_hold(child); |
634 | 634 | ||
635 | sk->sk_prot->disconnect(child, O_NONBLOCK); | 635 | sk->sk_prot->disconnect(child, O_NONBLOCK); |
@@ -647,7 +647,7 @@ void inet_csk_listen_stop(struct sock *sk) | |||
647 | sk_acceptq_removed(sk); | 647 | sk_acceptq_removed(sk); |
648 | __reqsk_free(req); | 648 | __reqsk_free(req); |
649 | } | 649 | } |
650 | BUG_TRAP(!sk->sk_ack_backlog); | 650 | WARN_ON(sk->sk_ack_backlog); |
651 | } | 651 | } |
652 | 652 | ||
653 | EXPORT_SYMBOL_GPL(inet_csk_listen_stop); | 653 | EXPORT_SYMBOL_GPL(inet_csk_listen_stop); |