Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp59109img; Wed, 27 Feb 2019 16:42:20 -0800 (PST) X-Google-Smtp-Source: AHgI3IZXs76J4Zm0o08W8C5l7wGcfjOzooyuj6b3MMOzFpc5Ya6f4lwCXCzDtmGg48ocbj56/Mh4 X-Received: by 2002:a17:902:5e3:: with SMTP id f90mr5095077plf.287.1551314540780; Wed, 27 Feb 2019 16:42:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551314540; cv=none; d=google.com; s=arc-20160816; b=A3K0f2JWFAmglwJpoCOcY23i6lPGvbXE3Axng25PxC0bME9WpJfVK+gs9pG7d0yxY9 +v/3sXgXw/aA1a9UkhbbjVW9bH9OiRawUww+xe5JyinVOOY3PDBPse3yOpFVFwHmamxY 98NwJOQM/0C8DdJC3aWlEK4ad5vyrdIs6IqEeaUy/jJpETdAVnXmBpE5aRc98ZdF9sbN 6Q7+2tc6ggFm252gFrCg7r8xo9d3nbnGgZQ5DM4sk/9eWUNzQbsu+9EtApgptd9woERx b6yhJuOKoixAKUaEwttYN0RcXvK/wPEeE9DxouupFkHHELBdGvIMiNHuFDsTm2aK7wba kc4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QaQgui+Uqm7iZjL3134DAwSFPs3Gz5Qy3G0UKS3OGfM=; b=XaYdaXhh84TTxBwDDVHtQghoRRyNUcqDEe2DLRA9JnzfwlfrQlHslB+i7WvfjlMxm9 r/CugwPW9KqKAayc2yvEWTorysZ/USG3lKUjw9+RxjK4csh5DGhQj5TowfMUEevIWAO8 S1uIJfQKqdLbt6w9AziuunH/QxIabx2HD0T36/nKHy+MnUHD0zk9WVdSHLmRNanpsRVp L4dxYYaggPZWpwrdg8bRKed5o7GAKW6bHk9UM+UpC0f2NZpc+7rgb6xAOVojHe7+gO2j g+MpNurGv6uZ7XRURq5dvdDIaXPHdjy5dMNhPVy6z7frLDlWMZ3HITNoVuy4EoACy5Ra WPcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NazPIa6i; 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 y185si15448212pgd.117.2019.02.27.16.42.04; Wed, 27 Feb 2019 16:42:20 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NazPIa6i; 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 S1730577AbfB1All (ORCPT + 99 others); Wed, 27 Feb 2019 19:41:41 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:37965 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730131AbfB1All (ORCPT ); Wed, 27 Feb 2019 19:41:41 -0500 Received: by mail-pg1-f194.google.com with SMTP id m2so8796450pgl.5; Wed, 27 Feb 2019 16:41:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QaQgui+Uqm7iZjL3134DAwSFPs3Gz5Qy3G0UKS3OGfM=; b=NazPIa6iJZNoFtWD7cGGaFiEVBgTXdNdje7haVepGKjUIQllpMcAFoZqxHB5HmO17W ZD+oy0LUW5h4av3i055X6y+DCdKZH4sB/0TiT9GmRasNaFmA/mgvFPAT0/jadamQN7Oe d+Gqa+q1uZBC7A1weRAC7BjnVuKYqrx0RrxZkTDGWm233bPy2HEiwd2rsNnC7x45e2Bt eV5qaiZGMMgi8Xpni06DXE7429T9QeOcDsKzX7BDDsM0/mgukoNkd1vfvtZhbFHRtSCc A3WLERTQInKuVv4ZQXEXYsdwr6dnu1bIrt4gpHSzr7839azzlw8Fom3GcWjC1FZ0khvb NfIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QaQgui+Uqm7iZjL3134DAwSFPs3Gz5Qy3G0UKS3OGfM=; b=YPElMc0VWY2Xzt4FIXz8cW47OiHwT8CJ5eYzomQF9LlYfZ21nGyePLKzAxcBe/RD2P ve6TI6+DIfvdYr7JNtsW3lAXeV9OpB52ps/v+o2eCJ49DaBMZwT0KV+nf5XA6pha1sy0 28pG4wF0K9en1diYKYbFlcqDlhyqzpb2+aU+3I76JYx7b7wO2dUKcztwECB4xRFrIAPg tqznDeIbPqaz9/iffuCzQCrg/DPO8B4XKBNwn28l/S2zjjkrScr2VDFwLVcEOj7p4G6l OqGjwH6iD54ViVyVzcpNd6RVxlJustssDbEowjbOpGdrWe9QlLMpTID1yhUq/cN49GD9 hm4A== X-Gm-Message-State: AHQUAuYth13F5i1Vleu+ZHbim9A88LKOWFUBJWFcPCUc58VFHVthwHml AD07fATwo+eKq6sZQFOgtzE= X-Received: by 2002:a63:6244:: with SMTP id w65mr5636697pgb.300.1551314500180; Wed, 27 Feb 2019 16:41:40 -0800 (PST) Received: from bobby.localdomain ([2601:1c0:5501:37e2::87c4]) by smtp.gmail.com with ESMTPSA id x15sm22033649pfn.74.2019.02.27.16.41.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Feb 2019 16:41:39 -0800 (PST) Date: Wed, 27 Feb 2019 16:41:51 -0800 From: Robert Eshleman To: Joe Perches Cc: Tariq Toukan , "David S. Miller" , Samuel Chessman , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/8] tlan: use pci_zalloc instead of pci_alloc Message-ID: <20190228004151.GA26282@bobby.localdomain> References: <51125a3daac49f7b5bb360a422663aee26e6776b.1551246708.git.bobbyeshleman@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 26, 2019 at 10:22:06PM -0800, Joe Perches wrote: > On Tue, 2019-02-26 at 22:09 -0800, Robert Eshleman wrote: > > This patch replaces a pci_alloc_consistent and memset(,0) call > > with a single call to pci_zalloc_consistent. > [] > > diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c > [] > > @@ -845,17 +845,16 @@ static int tlan_init(struct net_device *dev) > > > > dma_size = (TLAN_NUM_RX_LISTS + TLAN_NUM_TX_LISTS) > > * (sizeof(struct tlan_list)); > > - priv->dma_storage = pci_alloc_consistent(priv->pci_dev, > > - dma_size, > > - &priv->dma_storage_dma); > > + priv->dma_storage = pci_zalloc_consistent(priv->pci_dev, > > + dma_size, > > + &priv->dma_storage_dma); > > priv->dma_size = dma_size; > > > > - if (priv->dma_storage == NULL) { > > + if (!priv->dma_storage) { > > pr_err("Could not allocate lists and buffers for %s\n", > > dev->name); > > unrelated trivia: > > This pr_err (and likely others in this file) > could be replace by netdev_err > Definitely good to know (I may make that change too). Thanks Joe. -Bobby