aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2008-07-26 00:43:18 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-26 00:43:18 -0400
commit547b792cac0a038b9dbf958d3c120df3740b5572 (patch)
tree08554d083b0ca7d65739dc1ce12f9b12a9b8e1f8 /net/unix
parent53e5e96ec18da6f65e89f05674711e1c93d8df67 (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/unix')
-rw-r--r--net/unix/af_unix.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 70ceb1604ad8..24eb214581d5 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -227,7 +227,7 @@ static void __unix_remove_socket(struct sock *sk)
227 227
228static void __unix_insert_socket(struct hlist_head *list, struct sock *sk) 228static void __unix_insert_socket(struct hlist_head *list, struct sock *sk)
229{ 229{
230 BUG_TRAP(sk_unhashed(sk)); 230 WARN_ON(!sk_unhashed(sk));
231 sk_add_node(sk, list); 231 sk_add_node(sk, list);
232} 232}
233 233
@@ -350,9 +350,9 @@ static void unix_sock_destructor(struct sock *sk)
350 350
351 skb_queue_purge(&sk->sk_receive_queue); 351 skb_queue_purge(&sk->sk_receive_queue);
352 352
353 BUG_TRAP(!atomic_read(&sk->sk_wmem_alloc)); 353 WARN_ON(atomic_read(&sk->sk_wmem_alloc));
354 BUG_TRAP(sk_unhashed(sk)); 354 WARN_ON(!sk_unhashed(sk));
355 BUG_TRAP(!sk->sk_socket); 355 WARN_ON(sk->sk_socket);
356 if (!sock_flag(sk, SOCK_DEAD)) { 356 if (!sock_flag(sk, SOCK_DEAD)) {
357 printk("Attempt to release alive unix socket: %p\n", sk); 357 printk("Attempt to release alive unix socket: %p\n", sk);
358 return; 358 return;