Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1435403img; Tue, 26 Feb 2019 22:22:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IYBr4Ltpuu8pBvdLBc1X/Y8/78H2z/0n/vN8ba+egx/S2Zqlu5WGyCrPmkb9RiSkmoydjRZ X-Received: by 2002:a17:902:b413:: with SMTP id x19mr499861plr.256.1551248568849; Tue, 26 Feb 2019 22:22:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551248568; cv=none; d=google.com; s=arc-20160816; b=cPqyiB7XCaQ8wWsug5Lfc/m5T7Rbbco0+1ojblEOz4F4MAZnGjpUn9Jyx6lo/SHrfh Qej5iYeV2Gd/7fqdpzo7LSg2bGPZrbjWvADmN7YusKLk4x3xHsqN9eG09FjOlq4IyCQs d61uOoqSLvt21wKL8SmDnCrHk8OS0luBeO8e12kyw7TDX8fLVPILT5/rztHcAmDirDjc Lrpmi31BVZB4rkpiSQLguIOCK/V8Po/ycKltStRw+LGNnDlv2gXnKXCzUVTgcXT2nYH/ 9qHFQLczRP3aWXKHooH+AJZpNT8h96onwlnOJFRi6dZ3AUSXGPA6FyCQlrPC5sYTQZyY ZZUQ== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=oVomWWCJYsL3uqXuiuN7L2w7GH3OA0XPkph3sGVZ1Bc=; b=aosspG3vbfsGoh8dEtcA0012o4xmLHrvIUud8IdfKAuc7PlCJS9UzBbt45G5fDnOMT 6py0YcB09XspTYdvB6f0VGA5jQ9Jw2iAiJE3Trw/REjJLXJh9TiBM8OKdUk/Ng51zslP YoJ1AIAXV8uY72RmMbEnCWN95VfwRrVrStyACGjsSMCbEhqd2Xa1mMoyz0wI8p+rjzpT LWx6sywHQTYvgusSJHBZzER7RW/15w5vproqcVA6oIgWk8t5K1se9yYVPJS1jLYF5ywj 8/bxLUIJhCQ/gtfDQc/oIIms9rBH/pJy1dDDO7i7YJLjMDtSV9lcXyj1JNpdOYG5Q0og riuQ== 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 6si14947904plf.16.2019.02.26.22.22.33; Tue, 26 Feb 2019 22:22:48 -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 S1729883AbfB0GWL (ORCPT + 99 others); Wed, 27 Feb 2019 01:22:11 -0500 Received: from smtprelay0230.hostedemail.com ([216.40.44.230]:41647 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729529AbfB0GWK (ORCPT ); Wed, 27 Feb 2019 01:22:10 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 2C6C3C1DCAF; Wed, 27 Feb 2019 06:22:09 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3867:3868:3870:4321:4605:5007:7903:8660:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12296:12438:12679:12740:12760:12895:13069:13148:13230:13311:13357:13439:14659:14721:21080:21611:21627:30029:30054:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:30,LUA_SUMMARY:none X-HE-Tag: crack31_4cd183cdee063 X-Filterd-Recvd-Size: 2007 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA; Wed, 27 Feb 2019 06:22:07 +0000 (UTC) Message-ID: Subject: Re: [PATCH 3/8] tlan: use pci_zalloc instead of pci_alloc From: Joe Perches To: Robert Eshleman Cc: Tariq Toukan , "David S. Miller" , Samuel Chessman , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 26 Feb 2019 22:22:06 -0800 In-Reply-To: <51125a3daac49f7b5bb360a422663aee26e6776b.1551246708.git.bobbyeshleman@gmail.com> References: <51125a3daac49f7b5bb360a422663aee26e6776b.1551246708.git.bobbyeshleman@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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