Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1426942img; Tue, 26 Feb 2019 22:10:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IYcqvS5z5/5sHPyty/Hqr1pqrZeHKM/9PXb4PBfVX2+UCibC9eDlaRYJppv5b0bB5P9v53S X-Received: by 2002:a63:fc62:: with SMTP id r34mr1420317pgk.154.1551247829392; Tue, 26 Feb 2019 22:10:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551247829; cv=none; d=google.com; s=arc-20160816; b=NcKhOnq+N3zq/tpg6jb1kWsetArDKWDJ5UDHJjfKkuBABVOVxo57SeBz7ATV6GVXLt 0TZTAdxheFdMxYqmUnk9QAPWj4x0L/jXPat25hmJe6qmRxkLHT2y3yC5UdNPJZqfWbt4 ltQ6qI7RThMvzKHf93NVUNhb/spkiUt/z9hOs4QFYmO7PzhnGI69gMxaVN5y3ETKSP3H I7WAZSi61Kt4cmCi29i/3VxJX8XMll2YaeZOy7huirwFtNHRgDSAQNanECYQw+YuaC+S e1YN/Jx3kmm9bAEyb+SnPeH6wffFpvxBPQauzNGzEYxXZWLWv+S1fwWg1apAEmfaH03B mpHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BIx9DViwNy1t8RFVYwK5Zxk5ryawOq3ot5m5H2OgpcE=; b=DdKNMvsQx6T4gY9b46tutxmQVMwa4RmUFyJ2IP7X0qm2di1CX8Lfp03PYJOglOsDOE 84E0iUrs89hOA/jBFWLGgDGyubPwamZdeCqdm2yQM3blw4x3aW6uKLJX/9Cnug3sLHYO Jlz36n8q3ENM4PYvXn24lwnXSzk0gXzg9Rcfci5pAx/RJFuBmfhtkcGMOwbABp8M1ZE/ ujccU7Hw8W61Iq5e86vEUoxbeCaHXjjOvAHLnWO7GGdoQ2BCnWunczRdvOkispBj26s5 IKp3r22jp7VukDIZYH86kADhsaT4/ANv516HA11mZpxaAICeztumkpmyWxllMjUGf2uF Fexw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=k64TF+Kv; 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 v11si14283195plo.377.2019.02.26.22.10.14; Tue, 26 Feb 2019 22:10:29 -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=k64TF+Kv; 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 S1729893AbfB0GJr (ORCPT + 99 others); Wed, 27 Feb 2019 01:09:47 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:38828 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726268AbfB0GJp (ORCPT ); Wed, 27 Feb 2019 01:09:45 -0500 Received: by mail-pf1-f195.google.com with SMTP id n125so7479408pfn.5; Tue, 26 Feb 2019 22:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BIx9DViwNy1t8RFVYwK5Zxk5ryawOq3ot5m5H2OgpcE=; b=k64TF+KvLoHtBjQ7kMUuIoxGeRDdAw8bVYtC/jm4rxwoEIHaNZlNpkcz8c5DA+QSpD J5TPphLekaosLTciPpGMSevEtYJQzQmI1Q8RiNjoidjfNOJdIK0S7vd8C15mZLMJwu38 RCueZb44167t8w+bCQlEwMyD/d9yAIzRn+14us5NPFdfxAt0ajiQSGHjTdhtV7x6K12J QZnPtQoFob4TAdC6GNhdJ5FgPkiBS+7/5+shuetvC+6hCF3wRlCwVn1CyXRaIw5+EgxA XI+ln2dBEJm+geMxNFplzauurzGKeoJ7AYy87fAJlBuh5rM8jSDcwwu7BqAzO3ElqQcx g6lg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=BIx9DViwNy1t8RFVYwK5Zxk5ryawOq3ot5m5H2OgpcE=; b=FYF9h/V50PijTsszmUuW6SA/TsR3VXnNGZM5H3UtQf2y0UZPcr0gppfIbKqn1ATofh Wx+E23xKjNn8U1EX67mFu9oFCC5O/T7kA2Ff4FQ1rskI3Hd5rOh/TIf+dvUR8EPdEmgp bW4juXW8+IK46JmWOjvXNtutlK4xo8nsAKOy3y8DKQiyet7JnaxUNAlIf+6m8RR0P9LM YFtL/41EdqMy5xW3sM29SFmd7uftzqTNkl3/TrY3Kagg93MW62Xikf52n8S1KnQMLkoX 0Y/zFqx/LoKTB3ZPQVTdOmp4+hKnDDip73JlFIlk1CGEJwANwPR2wFCxWxhKVfUXpJOR Wb2g== X-Gm-Message-State: AHQUAuYZpPRFwHv9iePbH0IRHipdKNdbfRbgME3CLhdexyg47uv8FfJG 7SQTMbdlDbBqE/xjZGQfPgiQaitwEw4= X-Received: by 2002:a62:f51d:: with SMTP id n29mr3084pfh.21.1551247784125; Tue, 26 Feb 2019 22:09:44 -0800 (PST) Received: from bobby.hsd1.or.comcast.net ([2601:1c0:5501:37e2::87c4]) by smtp.googlemail.com with ESMTPSA id d5sm20733473pfo.83.2019.02.26.22.09.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Feb 2019 22:09:43 -0800 (PST) From: Robert Eshleman To: bobbyeshleman@gmail.com Cc: Tariq Toukan , "David S. Miller" , Samuel Chessman , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/8] tlan: use pci_zalloc instead of pci_alloc Date: Tue, 26 Feb 2019 22:09:50 -0800 Message-Id: <51125a3daac49f7b5bb360a422663aee26e6776b.1551246708.git.bobbyeshleman@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch replaces a pci_alloc_consistent and memset(,0) call with a single call to pci_zalloc_consistent. Signed-off-by: Robert Eshleman --- drivers/net/ethernet/ti/tlan.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c index b4ab1a5f6cd0..e1f7e71c3b21 100644 --- 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); return -ENOMEM; } - memset(priv->dma_storage, 0, dma_size); priv->rx_list = (struct tlan_list *) ALIGN((unsigned long)priv->dma_storage, 8); priv->rx_list_dma = ALIGN(priv->dma_storage_dma, 8); -- 2.20.1