Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2726333ybx; Sun, 3 Nov 2019 02:36:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwO6AuQkBZXlILJCmF5qkTFjbUxbvfQG4AUZTyENXhZEVngOY2MXLaSC97ADKPtuqDVRNEh X-Received: by 2002:a05:6402:1452:: with SMTP id d18mr23193546edx.158.1572777371167; Sun, 03 Nov 2019 02:36:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572777371; cv=none; d=google.com; s=arc-20160816; b=tAA2VA9n1zpWeNRGre+3qP+ta5brp2DBlNIn3SxLpArCGz2H5pVr88Jh1HxyJYsgVq fPyhC2XyJkZMhQrSvI1BKfIz3aeAEUMhqMH0olGXJuxftHTHkI64GWpsCd4JaIFrQE/0 daKmVSfZYdegPbZbfJFneCGE9EDlRBt+HFUq1Otz7AAuMT/Wvg1zODPPqDTYndeAj95T EjTdksPTYStEEhae/MlZa6zphLEPu2g44p2ddtIB/tMZD+VfUTXTGzD3/VsQzou4AwcC X9dZMfMNbPCGOoTylgd8lxGnDH0TYaxE5naKqwmNodrhrqjTQny9f5gfyiKYjr4bsF5z NpbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=jV1EgGL+zFUeNDtmOWsWKtoNHsFnAGZiSGnOgki3+Aw=; b=JZJKApMaMyOJ2JufYTvRp+FuKMLhLlozmwwy8rEx5ceqt7Jiz8vXAwNL6kdvX6/+M0 YEqV7JeA5YYqsQpkZebREkYwDzDmmvol6RBRjD7TjVFnLSXjkaP1z9/u7EGHAP3DLlzj N38EUlhKLc+qtLD+D+sKzQ9e7Btzc4tLltSM5QTfthHr8ZWIvRskHMabcX6Q9DHxbBgN sAS5VO6x36YMGr6J1fG+HdjNHqVMw590bgTdeAhwqhrPp5N7Jm9/QUA1V5FNlI46Vz63 bIH3QtDz+nuLGcrs9CLF0K6vWSCrBFVVyql1jxRDhn+ls0Bt0VivbJ2w+WZ5W48Pao53 Wx7A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ce3si5074342edb.441.2019.11.03.02.35.48; Sun, 03 Nov 2019 02:36:11 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727603AbfKCKfG (ORCPT + 99 others); Sun, 3 Nov 2019 05:35:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:56866 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727156AbfKCKfG (ORCPT ); Sun, 3 Nov 2019 05:35:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3C42FB114; Sun, 3 Nov 2019 10:35:04 +0000 (UTC) From: Thomas Bogendoerfer To: Ralf Baechle , "David S. Miller" , linux-mips@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christoph Hellwig Subject: [net v2 2/4] net: sgi: ioc3-eth: fix usage of GFP_* flags Date: Sun, 3 Nov 2019 11:34:31 +0100 Message-Id: <20191103103433.26826-2-tbogendoerfer@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191103103433.26826-1-tbogendoerfer@suse.de> References: <20191103103433.26826-1-tbogendoerfer@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christoph Hellwig dma_alloc_coherent always zeroes memory, there is no need for __GFP_ZERO. Also doing a GFP_ATOMIC allocation just before a GFP_KERNEL one is clearly bogus. Fixes: ed870f6a7aa2 ("net: sgi: ioc3-eth: use dma-direct for dma allocations") Signed-off-by: Christoph Hellwig --- drivers/net/ethernet/sgi/ioc3-eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c index 4879dedf1f60..d1546f04d1fd 100644 --- a/drivers/net/ethernet/sgi/ioc3-eth.c +++ b/drivers/net/ethernet/sgi/ioc3-eth.c @@ -1244,7 +1244,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* Allocate rx ring. 4kb = 512 entries, must be 4kb aligned */ ip->rxr = dma_alloc_coherent(ip->dma_dev, RX_RING_SIZE, &ip->rxr_dma, - GFP_ATOMIC); + GFP_KERNEL); if (!ip->rxr) { pr_err("ioc3-eth: rx ring allocation failed\n"); err = -ENOMEM; @@ -1253,7 +1253,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* Allocate tx rings. 16kb = 128 bufs, must be 16kb aligned */ ip->tx_ring = dma_alloc_coherent(ip->dma_dev, TX_RING_SIZE + SZ_16K - 1, - &ip->txr_dma, GFP_KERNEL | __GFP_ZERO); + &ip->txr_dma, GFP_KERNEL); if (!ip->tx_ring) { pr_err("ioc3-eth: tx ring allocation failed\n"); err = -ENOMEM; -- 2.16.4