Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp542063imm; Fri, 27 Jul 2018 01:31:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcblCLGj9G9OOOJAzMvW0lmI7RExHINIACvgypk9HynKfxwNrOKBAw8Xn2RCa+Sg1bs9A0C X-Received: by 2002:a63:1e08:: with SMTP id e8-v6mr5106057pge.281.1532680261127; Fri, 27 Jul 2018 01:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532680261; cv=none; d=google.com; s=arc-20160816; b=Mz591qm2VRGI5vC0dI1wyNB+85UkQzTITqwy750xwHszr8LwbQ0IiP2Z6tJkA0KOgX sQq9Uaj0CESs3x9STWf9zZS1Ano6K9Cy6klDCtXjNg2x+HMp5Q2EUt00X7wFHw29V187 Bo3KDQq2lVRPmE8SffHUw2g19aBb1Oh6vezq3IzfSWM55W3OcwDknOZohgWzljiF2dHb LnaJlmlSAzmx1IRYoJ3mh9GARyfBfQ/NzGGDjHUKyVQEGwKRudOPcILrLnRhMW1i1cyj QTUuw23u4NVBNjP/Ws0rhRf+wMaIFLLVd9gwFKVEJKYh6Et/AKgRhT603bUBnV9rV6uP fX6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=mPSTWh3lwRepsLbgt2o0sl8oKrikhsxeI/ve+7lxBcM=; b=HpeiJKaIriU+YKw5SZ3HqpJznRUwYPjo6s7bwz00PHzHgTFzxJ07SIuw1QxB5lNSjq v1hMc6YYWs+0gWXbKo9UsAaUDz/UhdRzRia+3a/eV5SlfUWqD8or8iAjikNDCwEroK+I el1lyU72b7fxn0Yvc43bkldFOSl2OLOX/m/jszNSuoaZfgXVB85PCZ+sITKWXuq5Ckr3 +WfU61K/iV57t1Q58dK7l7v9FQNRvtdv+qDM8WxOfeFu25cyf7ezeUDqKfJwPk11OQg9 ra6B3lQgTi3sSZm4zuZ1gCRVPhB4ioAGhjfaz3/i8vr/h0KD6fWKTSo8L7lH2XjG22Oq 0UTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tp3xYFJx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z63-v6si3523410pfi.214.2018.07.27.01.30.46; Fri, 27 Jul 2018 01:31:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tp3xYFJx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730291AbeG0Ju0 (ORCPT + 99 others); Fri, 27 Jul 2018 05:50:26 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43161 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726034AbeG0Ju0 (ORCPT ); Fri, 27 Jul 2018 05:50:26 -0400 Received: by mail-pf1-f194.google.com with SMTP id j26-v6so1492454pfi.10; Fri, 27 Jul 2018 01:29:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=mPSTWh3lwRepsLbgt2o0sl8oKrikhsxeI/ve+7lxBcM=; b=Tp3xYFJxr4Vxf8OFKNp8P5qouAFZfTEkOccniXiTH3pRakPvbHa12sUDkCpORGj7Kz clnqMPQRrnXbEPnmZsa2ZWNpbj/i2lbTNqN3tOisJhBx0TJZVeVFNPb1kmjfs9ubKvEh BxIHed4UJKfwC1A/d1XD9kriEFeubiIy+DEsg5GvAyXx8skLJcy4juAILX69bRJpQLxt /6qh05vaz1XqR0OUHLTMOOA1cY/MRRZIjgHQjrrfj0CbKrjl0HpCttpL9/wjzoQPXs3F M2XrVV8tvUE37yho+qN7fMvzU3Rr9478HRiWhExm3U9+IZFzjNu8pFdsXjwejzYNagrK SXZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mPSTWh3lwRepsLbgt2o0sl8oKrikhsxeI/ve+7lxBcM=; b=ZQWcgfr12PjfY1RwgSk9yGuE4wVm6VR44UvF+Rk1Hn0T+fFV8DqOJvQPKlurJC8j73 FK/H+cvPBuMTeGrovRpq03TRE8O1tvB2IrYgsRKnaehq4VYQxn3eaFC1LKOpR7TV6yBj 4/KYl3K8SnMcdZYmqL30PmXeIBqxxKPB5lQlay8gxivjABmI6HjBLcWRo8f/uQF7/Qtx 569oB6nLnRxp79FuT4OQGoZYbHzlhAxAbfFgw8XMXo/9ML6VZqsbSAshHL/bmrHAFQhf s7Brr0FvKX9/A39DKE+ySZTqJfKUVlgjODd3ACuA09W5SYeuT5/vJbs4ze4nf97Tzqmd D3lQ== X-Gm-Message-State: AOUpUlGkO1I44CCfKxMe3139unJyYrISuqkpoUak1O7UekcnuwQ3xg4o n10PZ9ENWDqlI2KDpCS2iFU= X-Received: by 2002:a65:6243:: with SMTP id q3-v6mr5022733pgv.273.1532680178417; Fri, 27 Jul 2018 01:29:38 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id q81-v6sm9734363pfd.15.2018.07.27.01.29.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 01:29:37 -0700 (PDT) From: Jia-Ju Bai To: davem@davemloft.net, yanjun.zhu@oracle.com, keescook@chromium.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: nvidia: forcedeth: Replace GFP_ATOMIC with GFP_KERNEL in nv_probe() Date: Fri, 27 Jul 2018 16:29:31 +0800 Message-Id: <20180727082931.7340-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org nv_probe() is never called in atomic context. It calls dma_alloc_coherent() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- drivers/net/ethernet/nvidia/forcedeth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index 66c665d0b926..a6f1a5a3daea 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c @@ -5775,7 +5775,7 @@ static int nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) (np->rx_ring_size + np->tx_ring_size), &np->ring_addr, - GFP_ATOMIC); + GFP_KERNEL); if (!np->rx_ring.orig) goto out_unmap; np->tx_ring.orig = &np->rx_ring.orig[np->rx_ring_size]; @@ -5784,7 +5784,7 @@ static int nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) sizeof(struct ring_desc_ex) * (np->rx_ring_size + np->tx_ring_size), - &np->ring_addr, GFP_ATOMIC); + &np->ring_addr, GFP_KERNEL); if (!np->rx_ring.ex) goto out_unmap; np->tx_ring.ex = &np->rx_ring.ex[np->rx_ring_size]; -- 2.17.0