提交 3fbac2a8 编写于 作者: Y Yang Yingliang 提交者: David S. Miller

sch_netem: replace magic numbers with enumerate in get_loss_clg

Replace two magic numbers which intialize clgstate::state.
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e035b8ad
...@@ -752,7 +752,7 @@ static int get_loss_clg(struct netem_sched_data *q, const struct nlattr *attr) ...@@ -752,7 +752,7 @@ static int get_loss_clg(struct netem_sched_data *q, const struct nlattr *attr)
q->loss_model = CLG_4_STATES; q->loss_model = CLG_4_STATES;
q->clg.state = 1; q->clg.state = TX_IN_GAP_PERIOD;
q->clg.a1 = gi->p13; q->clg.a1 = gi->p13;
q->clg.a2 = gi->p31; q->clg.a2 = gi->p31;
q->clg.a3 = gi->p32; q->clg.a3 = gi->p32;
...@@ -770,7 +770,7 @@ static int get_loss_clg(struct netem_sched_data *q, const struct nlattr *attr) ...@@ -770,7 +770,7 @@ static int get_loss_clg(struct netem_sched_data *q, const struct nlattr *attr)
} }
q->loss_model = CLG_GILB_ELL; q->loss_model = CLG_GILB_ELL;
q->clg.state = 1; q->clg.state = GOOD_STATE;
q->clg.a1 = ge->p; q->clg.a1 = ge->p;
q->clg.a2 = ge->r; q->clg.a2 = ge->r;
q->clg.a3 = ge->h; q->clg.a3 = ge->h;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册