提交 c8c1ff5c 编写于 作者: B Benjamin Poirier 提交者: Greg Kroah-Hartman

staging: qlge: Replace memset with assignment

Instead of clearing the structure wholesale, it is sufficient to initialize
the skb member which is used to manage sbq instances. lbq instances are
managed according to curr_idx and clean_idx.
Signed-off-by: NBenjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-15-bpoirier@suse.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 7be4c3f9
...@@ -2807,11 +2807,10 @@ static int qlge_init_bq(struct qlge_bq *bq) ...@@ -2807,11 +2807,10 @@ static int qlge_init_bq(struct qlge_bq *bq)
if (!bq->queue) if (!bq->queue)
return -ENOMEM; return -ENOMEM;
memset(bq->queue, 0, QLGE_BQ_LEN * sizeof(struct qlge_bq_desc));
buf_ptr = bq->base; buf_ptr = bq->base;
bq_desc = &bq->queue[0]; bq_desc = &bq->queue[0];
for (i = 0; i < QLGE_BQ_LEN; i++, buf_ptr++, bq_desc++) { for (i = 0; i < QLGE_BQ_LEN; i++, buf_ptr++, bq_desc++) {
bq_desc->p.skb = NULL;
bq_desc->index = i; bq_desc->index = i;
bq_desc->buf_ptr = buf_ptr; bq_desc->buf_ptr = buf_ptr;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册