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>
This commit is contained in:
committed by
David S. Miller
parent
53e5e96ec1
commit
547b792cac
@@ -1629,10 +1629,10 @@ advance_sp:
|
||||
out:
|
||||
|
||||
#if FASTRETRANS_DEBUG > 0
|
||||
BUG_TRAP((int)tp->sacked_out >= 0);
|
||||
BUG_TRAP((int)tp->lost_out >= 0);
|
||||
BUG_TRAP((int)tp->retrans_out >= 0);
|
||||
BUG_TRAP((int)tcp_packets_in_flight(tp) >= 0);
|
||||
WARN_ON((int)tp->sacked_out < 0);
|
||||
WARN_ON((int)tp->lost_out < 0);
|
||||
WARN_ON((int)tp->retrans_out < 0);
|
||||
WARN_ON((int)tcp_packets_in_flight(tp) < 0);
|
||||
#endif
|
||||
return flag;
|
||||
}
|
||||
@@ -2181,7 +2181,7 @@ static void tcp_mark_head_lost(struct sock *sk, int packets)
|
||||
int err;
|
||||
unsigned int mss;
|
||||
|
||||
BUG_TRAP(packets <= tp->packets_out);
|
||||
WARN_ON(packets > tp->packets_out);
|
||||
if (tp->lost_skb_hint) {
|
||||
skb = tp->lost_skb_hint;
|
||||
cnt = tp->lost_cnt_hint;
|
||||
@@ -2610,7 +2610,7 @@ static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, int flag)
|
||||
/* E. Check state exit conditions. State can be terminated
|
||||
* when high_seq is ACKed. */
|
||||
if (icsk->icsk_ca_state == TCP_CA_Open) {
|
||||
BUG_TRAP(tp->retrans_out == 0);
|
||||
WARN_ON(tp->retrans_out != 0);
|
||||
tp->retrans_stamp = 0;
|
||||
} else if (!before(tp->snd_una, tp->high_seq)) {
|
||||
switch (icsk->icsk_ca_state) {
|
||||
@@ -2972,9 +2972,9 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets)
|
||||
}
|
||||
|
||||
#if FASTRETRANS_DEBUG > 0
|
||||
BUG_TRAP((int)tp->sacked_out >= 0);
|
||||
BUG_TRAP((int)tp->lost_out >= 0);
|
||||
BUG_TRAP((int)tp->retrans_out >= 0);
|
||||
WARN_ON((int)tp->sacked_out < 0);
|
||||
WARN_ON((int)tp->lost_out < 0);
|
||||
WARN_ON((int)tp->retrans_out < 0);
|
||||
if (!tp->packets_out && tcp_is_sack(tp)) {
|
||||
icsk = inet_csk(sk);
|
||||
if (tp->lost_out) {
|
||||
@@ -3877,7 +3877,7 @@ static void tcp_sack_remove(struct tcp_sock *tp)
|
||||
int i;
|
||||
|
||||
/* RCV.NXT must cover all the block! */
|
||||
BUG_TRAP(!before(tp->rcv_nxt, sp->end_seq));
|
||||
WARN_ON(before(tp->rcv_nxt, sp->end_seq));
|
||||
|
||||
/* Zap this SACK, by moving forward any other SACKS. */
|
||||
for (i=this_sack+1; i < num_sacks; i++)
|
||||
|
Reference in New Issue
Block a user