mirror of https://gitee.com/openkylin/linux.git
staging: vt6655: Use GFP_KERNEL in kzalloc
Four kzalloc functions are called with GFP_ATOMIC. But according to driver call graph, they are not in atomic context, namely no spinlock is held nor in an interrupt handler. All these "GFP_ATOMIC"s are unnecessary, and replace with with "GFP_KERNEL"s. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ac3c7776b1
commit
88a527c498
|
@ -538,7 +538,7 @@ static void device_init_rd0_ring(struct vnt_private *priv)
|
|||
for (i = 0; i < priv->opts.rx_descs0;
|
||||
i ++, curr += sizeof(struct vnt_rx_desc)) {
|
||||
desc = &priv->aRD0Ring[i];
|
||||
desc->rd_info = kzalloc(sizeof(*desc->rd_info), GFP_ATOMIC);
|
||||
desc->rd_info = kzalloc(sizeof(*desc->rd_info), GFP_KERNEL);
|
||||
|
||||
if (!device_alloc_rx_buf(priv, desc))
|
||||
dev_err(&priv->pcid->dev, "can not alloc rx bufs\n");
|
||||
|
@ -562,7 +562,7 @@ static void device_init_rd1_ring(struct vnt_private *priv)
|
|||
for (i = 0; i < priv->opts.rx_descs1;
|
||||
i ++, curr += sizeof(struct vnt_rx_desc)) {
|
||||
desc = &priv->aRD1Ring[i];
|
||||
desc->rd_info = kzalloc(sizeof(*desc->rd_info), GFP_ATOMIC);
|
||||
desc->rd_info = kzalloc(sizeof(*desc->rd_info), GFP_KERNEL);
|
||||
|
||||
if (!device_alloc_rx_buf(priv, desc))
|
||||
dev_err(&priv->pcid->dev, "can not alloc rx bufs\n");
|
||||
|
@ -620,7 +620,7 @@ static void device_init_td0_ring(struct vnt_private *priv)
|
|||
for (i = 0; i < priv->opts.tx_descs[0];
|
||||
i++, curr += sizeof(struct vnt_tx_desc)) {
|
||||
desc = &priv->apTD0Rings[i];
|
||||
desc->td_info = kzalloc(sizeof(*desc->td_info), GFP_ATOMIC);
|
||||
desc->td_info = kzalloc(sizeof(*desc->td_info), GFP_KERNEL);
|
||||
|
||||
desc->td_info->buf = priv->tx0_bufs + i * PKT_BUF_SZ;
|
||||
desc->td_info->buf_dma = priv->tx_bufs_dma0 + i * PKT_BUF_SZ;
|
||||
|
@ -645,7 +645,7 @@ static void device_init_td1_ring(struct vnt_private *priv)
|
|||
for (i = 0; i < priv->opts.tx_descs[1];
|
||||
i++, curr += sizeof(struct vnt_tx_desc)) {
|
||||
desc = &priv->apTD1Rings[i];
|
||||
desc->td_info = kzalloc(sizeof(*desc->td_info), GFP_ATOMIC);
|
||||
desc->td_info = kzalloc(sizeof(*desc->td_info), GFP_KERNEL);
|
||||
|
||||
desc->td_info->buf = priv->tx1_bufs + i * PKT_BUF_SZ;
|
||||
desc->td_info->buf_dma = priv->tx_bufs_dma1 + i * PKT_BUF_SZ;
|
||||
|
|
Loading…
Reference in New Issue