Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933036AbdLRJFZ (ORCPT ); Mon, 18 Dec 2017 04:05:25 -0500 Received: from mail-it0-f68.google.com ([209.85.214.68]:37015 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932749AbdLRJFV (ORCPT ); Mon, 18 Dec 2017 04:05:21 -0500 X-Google-Smtp-Source: ACJfBovvMyFKdyk3Oe06tnUaldHIZrxMgy70t+kutF+4GVHc7jvw1KQzVSXESnqNAGdql45a2dfbDg== From: Jia-Ju Bai To: forest@alittletooquiet.net, gregkh@linuxfoundation.org, dartnorris@gmail.com Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] staging: vt6655: Use GFP_KERNEL in kzalloc Date: Mon, 18 Dec 2017 17:07:54 +0800 Message-Id: <1513588075-8402-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2399 Lines: 54 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 --- drivers/staging/vt6655/device_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 1123b4f..1688307 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -547,7 +547,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"); @@ -571,7 +571,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"); @@ -629,7 +629,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; @@ -654,7 +654,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; -- 1.7.9.5