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/core/skbuff.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/core/skbuff.c')
-rw-r--r-- | net/core/skbuff.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index e4115672b6cf..4e0c92274189 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -1200,7 +1200,7 @@ int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len) | |||
1200 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | 1200 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { |
1201 | int end; | 1201 | int end; |
1202 | 1202 | ||
1203 | BUG_TRAP(start <= offset + len); | 1203 | WARN_ON(start > offset + len); |
1204 | 1204 | ||
1205 | end = start + skb_shinfo(skb)->frags[i].size; | 1205 | end = start + skb_shinfo(skb)->frags[i].size; |
1206 | if ((copy = end - offset) > 0) { | 1206 | if ((copy = end - offset) > 0) { |
@@ -1229,7 +1229,7 @@ int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len) | |||
1229 | for (; list; list = list->next) { | 1229 | for (; list; list = list->next) { |
1230 | int end; | 1230 | int end; |
1231 | 1231 | ||
1232 | BUG_TRAP(start <= offset + len); | 1232 | WARN_ON(start > offset + len); |
1233 | 1233 | ||
1234 | end = start + list->len; | 1234 | end = start + list->len; |
1235 | if ((copy = end - offset) > 0) { | 1235 | if ((copy = end - offset) > 0) { |
@@ -1475,7 +1475,7 @@ int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len) | |||
1475 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; | 1475 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
1476 | int end; | 1476 | int end; |
1477 | 1477 | ||
1478 | BUG_TRAP(start <= offset + len); | 1478 | WARN_ON(start > offset + len); |
1479 | 1479 | ||
1480 | end = start + frag->size; | 1480 | end = start + frag->size; |
1481 | if ((copy = end - offset) > 0) { | 1481 | if ((copy = end - offset) > 0) { |
@@ -1503,7 +1503,7 @@ int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len) | |||
1503 | for (; list; list = list->next) { | 1503 | for (; list; list = list->next) { |
1504 | int end; | 1504 | int end; |
1505 | 1505 | ||
1506 | BUG_TRAP(start <= offset + len); | 1506 | WARN_ON(start > offset + len); |
1507 | 1507 | ||
1508 | end = start + list->len; | 1508 | end = start + list->len; |
1509 | if ((copy = end - offset) > 0) { | 1509 | if ((copy = end - offset) > 0) { |
@@ -1552,7 +1552,7 @@ __wsum skb_checksum(const struct sk_buff *skb, int offset, | |||
1552 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | 1552 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { |
1553 | int end; | 1553 | int end; |
1554 | 1554 | ||
1555 | BUG_TRAP(start <= offset + len); | 1555 | WARN_ON(start > offset + len); |
1556 | 1556 | ||
1557 | end = start + skb_shinfo(skb)->frags[i].size; | 1557 | end = start + skb_shinfo(skb)->frags[i].size; |
1558 | if ((copy = end - offset) > 0) { | 1558 | if ((copy = end - offset) > 0) { |
@@ -1581,7 +1581,7 @@ __wsum skb_checksum(const struct sk_buff *skb, int offset, | |||
1581 | for (; list; list = list->next) { | 1581 | for (; list; list = list->next) { |
1582 | int end; | 1582 | int end; |
1583 | 1583 | ||
1584 | BUG_TRAP(start <= offset + len); | 1584 | WARN_ON(start > offset + len); |
1585 | 1585 | ||
1586 | end = start + list->len; | 1586 | end = start + list->len; |
1587 | if ((copy = end - offset) > 0) { | 1587 | if ((copy = end - offset) > 0) { |
@@ -1629,7 +1629,7 @@ __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, | |||
1629 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | 1629 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { |
1630 | int end; | 1630 | int end; |
1631 | 1631 | ||
1632 | BUG_TRAP(start <= offset + len); | 1632 | WARN_ON(start > offset + len); |
1633 | 1633 | ||
1634 | end = start + skb_shinfo(skb)->frags[i].size; | 1634 | end = start + skb_shinfo(skb)->frags[i].size; |
1635 | if ((copy = end - offset) > 0) { | 1635 | if ((copy = end - offset) > 0) { |
@@ -1662,7 +1662,7 @@ __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, | |||
1662 | __wsum csum2; | 1662 | __wsum csum2; |
1663 | int end; | 1663 | int end; |
1664 | 1664 | ||
1665 | BUG_TRAP(start <= offset + len); | 1665 | WARN_ON(start > offset + len); |
1666 | 1666 | ||
1667 | end = start + list->len; | 1667 | end = start + list->len; |
1668 | if ((copy = end - offset) > 0) { | 1668 | if ((copy = end - offset) > 0) { |
@@ -2373,7 +2373,7 @@ __skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len) | |||
2373 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | 2373 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { |
2374 | int end; | 2374 | int end; |
2375 | 2375 | ||
2376 | BUG_TRAP(start <= offset + len); | 2376 | WARN_ON(start > offset + len); |
2377 | 2377 | ||
2378 | end = start + skb_shinfo(skb)->frags[i].size; | 2378 | end = start + skb_shinfo(skb)->frags[i].size; |
2379 | if ((copy = end - offset) > 0) { | 2379 | if ((copy = end - offset) > 0) { |
@@ -2397,7 +2397,7 @@ __skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len) | |||
2397 | for (; list; list = list->next) { | 2397 | for (; list; list = list->next) { |
2398 | int end; | 2398 | int end; |
2399 | 2399 | ||
2400 | BUG_TRAP(start <= offset + len); | 2400 | WARN_ON(start > offset + len); |
2401 | 2401 | ||
2402 | end = start + list->len; | 2402 | end = start + list->len; |
2403 | if ((copy = end - offset) > 0) { | 2403 | if ((copy = end - offset) > 0) { |