Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp383395pxa; Fri, 31 Jul 2020 15:00:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRCH6ofA6zc7iEGqzPj6it0S3IC4w1N3UJsIeXc5KIppBWkBzft+k/uR5gZB6mZbfrirYj X-Received: by 2002:a17:906:af6a:: with SMTP id os10mr2552540ejb.355.1596232813880; Fri, 31 Jul 2020 15:00:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596232813; cv=none; d=google.com; s=arc-20160816; b=Zjg1PdXW4leLVxG4NnCt1+ATTo4FGNpu29s9Tjt4jzP7nuHbwo/eaN1DAuDtjRU/ED laxf6xX1RpBFWWInhkAv6pOJ5tgFmuFcSCHdLPz2HSRuEkp15X7jjs4/RQAlSIdihZBJ F6PisxENqgq9fqSQAT+dQX3DdEm/e+8RZ5Vc2aYArJ+EuIulpj88x+dxnJdoS+0TKtnY pmiYp26UyrofA0QmS9fYvlwOUqlBlc8gYUoy4Uk2PSHsjl3hQ0nCAYAF9UvOzxzl14DI 39fBK47JMQSyPbV+r7mgq4esgO84qJBHnCPxYNF3qdMNmqPuPKuTBTvPUeI5yJoKhQA1 mmPw== 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=vsnuyCtpG9V9qxRzMxVEK7O7pxxeZkrmp70PMzYUkG4=; b=x1VnfFF0/Jz5h4UNtsiVLL1Ky+2kmq5aBNH04xZ/aFa3zmL15EQ8Sj5SSfjwuy5cwR z9bgorMoCEnkbEz4kxUbheLeWxYgcLv0Lij/Vql9XdIaf6yKhJ4MBLMk7WXoYlQ/Krc4 C6dXFr1+auZFoy0UOcLximU1YQe8f43C+vL0zQz8WiH+WwBuoJeLo409Uhy2t+8vNPCo 9MCge+UEVYgmpGY07FJA2uO2IC4W8dKiD2n5BDHHeyxUCwUGIY8vfxkMDti1KeXw7JIW EjwvQHoPRVKwdw4ygJ5x9/MPehmnzx2Up0rb5WVUxXiIcmdVON0We5UljaKJqHv6dYTa CWcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z70si3171727ede.247.2020.07.31.14.59.50; Fri, 31 Jul 2020 15:00:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726571AbgGaV6j (ORCPT + 99 others); Fri, 31 Jul 2020 17:58:39 -0400 Received: from smtprelay0210.hostedemail.com ([216.40.44.210]:40068 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726391AbgGaV6j (ORCPT ); Fri, 31 Jul 2020 17:58:39 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 9E9D8180A7FEE; Fri, 31 Jul 2020 21:58:38 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:966:968:988:989:1260:1277:1311:1313:1314:1345:1359:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3868:4321:4385:5007:6119:7903:8603:10004:10400:10848:11026:11232:11233:11658:11914:12043:12296:12297:12438:12740:12760:12895:13069:13311:13357:13439:14659:14721:21080:21451:21627:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:5,LUA_SUMMARY:none X-HE-Tag: chalk56_561320126f87 X-Filterd-Recvd-Size: 1949 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf18.hostedemail.com (Postfix) with ESMTPA; Fri, 31 Jul 2020 21:58:37 +0000 (UTC) Message-ID: <33d943d2b83f17371df09b5962c856ea2d894954.camel@perches.com> Subject: Re: [PATCH] scsi: libcxgbi: use kvzalloc instead of opencoded kzalloc/vzalloc From: Joe Perches To: Denis Efremov , "Martin K. Petersen" , "James E.J. Bottomley" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 31 Jul 2020 14:58:36 -0700 In-Reply-To: <20200731215524.14295-1-efremov@linux.com> References: <20200731215524.14295-1-efremov@linux.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.3-0ubuntu1 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 Sat, 2020-08-01 at 00:55 +0300, Denis Efremov wrote: > Remove cxgbi_alloc_big_mem(), cxgbi_free_big_mem() functions > and use kvzalloc/kvfree instead. Sensible, thanks. > diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c [] > @@ -77,9 +77,9 @@ int cxgbi_device_portmap_create(struct cxgbi_device *cdev, unsigned int base, > { > struct cxgbi_ports_map *pmap = &cdev->pmap; > > - pmap->port_csk = cxgbi_alloc_big_mem(max_conn * > - sizeof(struct cxgbi_sock *), > - GFP_KERNEL); > + pmap->port_csk = kvzalloc(array_size(max_conn, > + sizeof(struct cxgbi_sock *)), > + GFP_KERNEL); missing __GFP_NOWARN > diff --git a/drivers/scsi/cxgbi/libcxgbi.h b/drivers/scsi/cxgbi/libcxgbi.h [] > @@ -537,22 +537,6 @@ struct cxgbi_task_data { > #define iscsi_task_cxgbi_data(task) \ > ((task)->dd_data + sizeof(struct iscsi_tcp_task)) > > -static inline void *cxgbi_alloc_big_mem(unsigned int size, > - gfp_t gfp) > -{ > - void *p = kzalloc(size, gfp | __GFP_NOWARN);