Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp523273imm; Fri, 27 Jul 2018 01:06:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcGgK4EHWGksklntYS6hdOeOdFTpdt0Eppd38RWMUv9Z03vrIXQK+cesSEIu2atRVAp6wg/ X-Received: by 2002:a63:4d47:: with SMTP id n7-v6mr5085745pgl.270.1532678765633; Fri, 27 Jul 2018 01:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532678765; cv=none; d=google.com; s=arc-20160816; b=UdisXtwUE2ut49v1tuSUAbgvvhDa7rWt8JHGlBlcHo6UWDOB9tYTzMQWJNqSaRsS4B GuLAQZNBi1PAElHlYb5xNwCQPMl35G5oQC8wPdvNNcHtXZ0pCl1/pwixlQpAe1dRWRHQ H4gnh21BSP+uKr419LTvs/4ofOphJs1HLpRo0/WTs6iJ/i0p02L+TVtMpE4KAXM3ZJKQ zrsimBP2kv+sO/o0a/STn89eiAhuPakFCVMBjEK+at+QrBDwQBCdiU/JnOjXQwl48tnr VxQQnqkTIQHujKaYYOdKOgdbhI2CqHilV1NEkGTUa6hcY/+WV9Xx0cOwd2uOTP1+WWuz YqTg== 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=xO8+QcS/sypcgqi50Iq0IApJl+12RbGbr6B6n84+oh0=; b=hZzFI65cIEuVqHSRvG0C2Yjbh5CwdoTrg89aX/bw7IVbz5uwOUq4pLoMRqKmmOKYBL 8XUf7ckmQnHyRKZGLDmCc2IHENxmZG39ZUAXgM3zTSpOxObiv24+L5g/U75ZOm/OKffe Q2CE9x2FQIAGFRN4zQ0XaUGS3kA29TWZgRvN54A9klo2TQyJLiOxfj4RtBgx/T8JqCJt qmYO3Xd6ri8S4PnfhInvMiYGOEOQbsDO8ho9NNObCgaLo7WDpyeYumQ3uNJo8YqQzIzo 4CS3m7Iw/wRMJN7ugTfSDo/9KInTfoKjATV8z5DYEBmh30RBr8azaullQUueqluAuMhF Uyjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=obFskZWg; 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 t66-v6si3437334pfg.292.2018.07.27.01.05.50; Fri, 27 Jul 2018 01:06:05 -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=obFskZWg; 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 S1730154AbeG0JZn (ORCPT + 99 others); Fri, 27 Jul 2018 05:25:43 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40065 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729431AbeG0JZn (ORCPT ); Fri, 27 Jul 2018 05:25:43 -0400 Received: by mail-pf1-f196.google.com with SMTP id e13-v6so1474854pff.7; Fri, 27 Jul 2018 01:05:01 -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=xO8+QcS/sypcgqi50Iq0IApJl+12RbGbr6B6n84+oh0=; b=obFskZWgZgCKI3cJfcA9T3XrCEHvk43AGXpzEifmIAo9m+LW/nh2EYtegacwAFn8d1 ptGd2WthkQ0HHiDEADfW26grTyVTRyrRIpttEbWpj2VqdCIXMc8geiyEVJALKwqsUMOh pwObEXu2+3NBamSXuj27EM3Uihq8mfc3qoaFfSz5Nx+AugEm4QneCjfGwVRcAusPWO28 xxF1qtibxWW6wEFapG7KDqX4egfprvfOx1sNZDOS5xAqit+HfkaY9KLGVq6ADOVsU/3S zr62ZJfFUJUuX3OBbdajbc7JaMbrlSdRJyYobSHGNEzrldt6dOzg4PdqWzimt/Ps7ST8 ptPg== 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=xO8+QcS/sypcgqi50Iq0IApJl+12RbGbr6B6n84+oh0=; b=MSwbGlrymehZsjly98mNZgci+PDnnBMdZT02caJzFpN/tiFSfoH1CrkyY81YLUy2Tb dNn0cajNKLA2AjEBIuSX+GzUmCdci9N3DIuGDeahygFexG1Gh/fIapf4EgQNpInEo2P2 R+UsGs7EZOTPK0Ilm5G3jJkSyj3nBMLbcR90VdE8AhNnVjC7sXmvyH5SzlNkpNQdOY18 p2grF2NV4+zxpKNOJ7oEreUz9gBhys1TvAx0/RUzY4bOicceVVWh28+rgYkqiYCzTkd+ I1BrQDa0rg28qv5/BVeNFkxUcj2iNO8ayvcNiYibVF0kcWNS7sqKh3ObsMM3f6chrfet FlCQ== X-Gm-Message-State: AOUpUlEBuMKsi1yIz0ZXTraGS/exOc+C1JY5f03so0dPV8bY/Khm8qXv QXN/rKVFTL8IEPSL5sKZr5drbP4t X-Received: by 2002:a62:229a:: with SMTP id p26-v6mr5590454pfj.53.1532678701099; Fri, 27 Jul 2018 01:05:01 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id x24-v6sm5254978pfh.67.2018.07.27.01.04.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 01:05:00 -0700 (PDT) From: Jia-Ju Bai To: jeffrey.t.kirsher@intel.com Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH 1/2] net: intel: igb: Replace GFP_ATOMIC with GFP_KERNEL in igb_sw_init() Date: Fri, 27 Jul 2018 16:04:53 +0800 Message-Id: <20180727080453.3198-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 igb_sw_init() is never called in atomic context. It calls kzalloc() and kcalloc() 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/intel/igb/igb_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index cce7ada89255..5332a1b608e6 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -3534,7 +3534,7 @@ static int igb_sw_init(struct igb_adapter *adapter) adapter->flags |= IGB_FLAG_HAS_MSIX; adapter->mac_table = kzalloc(sizeof(struct igb_mac_addr) * - hw->mac.rar_entry_count, GFP_ATOMIC); + hw->mac.rar_entry_count, GFP_KERNEL); if (!adapter->mac_table) return -ENOMEM; @@ -3544,7 +3544,7 @@ static int igb_sw_init(struct igb_adapter *adapter) /* Setup and initialize a copy of the hw vlan table array */ adapter->shadow_vfta = kcalloc(E1000_VLAN_FILTER_TBL_SIZE, sizeof(u32), - GFP_ATOMIC); + GFP_KERNEL); if (!adapter->shadow_vfta) return -ENOMEM; -- 2.17.0