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
@@ -524,7 +524,7 @@ htb_change_class_mode(struct htb_sched *q, struct htb_class *cl, long *diff)
|
||||
*/
|
||||
static inline void htb_activate(struct htb_sched *q, struct htb_class *cl)
|
||||
{
|
||||
BUG_TRAP(!cl->level && cl->un.leaf.q && cl->un.leaf.q->q.qlen);
|
||||
WARN_ON(cl->level || !cl->un.leaf.q || !cl->un.leaf.q->q.qlen);
|
||||
|
||||
if (!cl->prio_activity) {
|
||||
cl->prio_activity = 1 << (cl->un.leaf.aprio = cl->un.leaf.prio);
|
||||
@@ -542,7 +542,7 @@ static inline void htb_activate(struct htb_sched *q, struct htb_class *cl)
|
||||
*/
|
||||
static inline void htb_deactivate(struct htb_sched *q, struct htb_class *cl)
|
||||
{
|
||||
BUG_TRAP(cl->prio_activity);
|
||||
WARN_ON(!cl->prio_activity);
|
||||
|
||||
htb_deactivate_prios(q, cl);
|
||||
cl->prio_activity = 0;
|
||||
@@ -757,7 +757,7 @@ static struct htb_class *htb_lookup_leaf(struct rb_root *tree, int prio,
|
||||
u32 *pid;
|
||||
} stk[TC_HTB_MAXDEPTH], *sp = stk;
|
||||
|
||||
BUG_TRAP(tree->rb_node);
|
||||
WARN_ON(!tree->rb_node);
|
||||
sp->root = tree->rb_node;
|
||||
sp->pptr = pptr;
|
||||
sp->pid = pid;
|
||||
@@ -777,7 +777,7 @@ static struct htb_class *htb_lookup_leaf(struct rb_root *tree, int prio,
|
||||
*sp->pptr = (*sp->pptr)->rb_left;
|
||||
if (sp > stk) {
|
||||
sp--;
|
||||
BUG_TRAP(*sp->pptr);
|
||||
WARN_ON(!*sp->pptr);
|
||||
if (!*sp->pptr)
|
||||
return NULL;
|
||||
htb_next_rb_node(sp->pptr);
|
||||
@@ -792,7 +792,7 @@ static struct htb_class *htb_lookup_leaf(struct rb_root *tree, int prio,
|
||||
sp->pid = cl->un.inner.last_ptr_id + prio;
|
||||
}
|
||||
}
|
||||
BUG_TRAP(0);
|
||||
WARN_ON(1);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -810,7 +810,7 @@ static struct sk_buff *htb_dequeue_tree(struct htb_sched *q, int prio,
|
||||
|
||||
do {
|
||||
next:
|
||||
BUG_TRAP(cl);
|
||||
WARN_ON(!cl);
|
||||
if (!cl)
|
||||
return NULL;
|
||||
|
||||
@@ -1185,7 +1185,7 @@ static void htb_parent_to_leaf(struct htb_sched *q, struct htb_class *cl,
|
||||
{
|
||||
struct htb_class *parent = cl->parent;
|
||||
|
||||
BUG_TRAP(!cl->level && cl->un.leaf.q && !cl->prio_activity);
|
||||
WARN_ON(cl->level || !cl->un.leaf.q || cl->prio_activity);
|
||||
|
||||
if (parent->cmode != HTB_CAN_SEND)
|
||||
htb_safe_rb_erase(&parent->pq_node, q->wait_pq + parent->level);
|
||||
@@ -1205,7 +1205,7 @@ static void htb_parent_to_leaf(struct htb_sched *q, struct htb_class *cl,
|
||||
static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl)
|
||||
{
|
||||
if (!cl->level) {
|
||||
BUG_TRAP(cl->un.leaf.q);
|
||||
WARN_ON(!cl->un.leaf.q);
|
||||
qdisc_destroy(cl->un.leaf.q);
|
||||
}
|
||||
gen_kill_estimator(&cl->bstats, &cl->rate_est);
|
||||
|
Reference in New Issue
Block a user