Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2464884pxk; Sun, 20 Sep 2020 05:11:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAkr0AXtP7J9XDSW54Bx/sw7afdUIYdKkQriaS1QiHw6xB3NTF+sTNhStoZSGX8gTdHwjN X-Received: by 2002:a17:906:c348:: with SMTP id ci8mr46578920ejb.417.1600603866256; Sun, 20 Sep 2020 05:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600603866; cv=none; d=google.com; s=arc-20160816; b=gg+Ce2+VEJlJeQBRGDJKq2A5yhDQP1O3Ws/5eAMF4MMEASIWG3gD1YdeH0yw+LYE5N j26/lM+aGoUotGhul9dOrYlZ3e3mkXva2u4w4YACnoHnu/ZaYKjAiMfJ5vg+mV/DIntw /MdYsUSXBxoNfAmgQRbHoSDOmyeZktAtr005DOxmI9NIVLmKljMdHyX2ADa5Zf0qSTkp W2hczQqzWPtn/v/prv2IYDqd8Ej+uuDq3h0tNwRyXBZJLAOuiJJ+BAkWEOLO+w0X8JgD a4xz1uF64wnGt7tJJbcI2gsjpE9cElyaU3SPHslFjEGitosjqe2XRL8e5tEnETd617yT 4WyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=+GrkTaquCWHBdWjoa62/PGlDbEJeh4xPJT9nKwulv0s=; b=yyPV1CuvKbg1CLiIe8tOmjUiSfrIeUVsHnlZkNS9iE9vyV1fl7vfqFXv82maURkNAJ Y77jbIonPD7Er97sKnSEbP7Wdn7gUr1fXmjO1u5obv2vp2PX7i7ek8sOop/ItRaOMISu pCOCk6oZXTAFS6WcLlLpApVg8CpY/rJFMS7Ynyh1KfMkRCNjs4yhT5QYEcpveso/+5jX i+jOPm3/1GJNSIZOeUpwcIucm5Bl5FK4fd1fO9Mbyj1ymaXNth5MAp9Gci7wPY49HESe T4BbneO8/HmVOKeov+TUpyQmZAqGGXecpLVE0c1R3wRpzl5ftKGzcSkDjh4krNnLqy3D NBTQ== 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 dt14si6151615ejb.133.2020.09.20.05.10.28; Sun, 20 Sep 2020 05:11:06 -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 S1726460AbgITMJW (ORCPT + 99 others); Sun, 20 Sep 2020 08:09:22 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:50034 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726406AbgITMJP (ORCPT ); Sun, 20 Sep 2020 08:09:15 -0400 X-IronPort-AV: E=Sophos;i="5.77,282,1596492000"; d="scan'208";a="468612191" Received: from palace.lip6.fr ([132.227.105.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES256-SHA256; 20 Sep 2020 14:08:58 +0200 From: Julia Lawall To: Gal Pressman Cc: kernel-janitors@vger.kernel.org, Yossi Leybovich , Doug Ledford , Jason Gunthorpe , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/14] RDMA/efa: drop double zeroing Date: Sun, 20 Sep 2020 13:26:17 +0200 Message-Id: <1600601186-7420-6-git-send-email-Julia.Lawall@inria.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1600601186-7420-1-git-send-email-Julia.Lawall@inria.fr> References: <1600601186-7420-1-git-send-email-Julia.Lawall@inria.fr> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sg_init_table zeroes its first argument, so the allocation of that argument doesn't have to. the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,n,flags; @@ x = - kcalloc + kmalloc_array (n,sizeof(*x),flags) ... sg_init_table(x,n) // Signed-off-by: Julia Lawall --- drivers/infiniband/hw/efa/efa_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -u -p a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c --- a/drivers/infiniband/hw/efa/efa_verbs.c +++ b/drivers/infiniband/hw/efa/efa_verbs.c @@ -1157,7 +1157,7 @@ static struct scatterlist *efa_vmalloc_b struct page *pg; int i; - sglist = kcalloc(page_cnt, sizeof(*sglist), GFP_KERNEL); + sglist = kmalloc_array(page_cnt, sizeof(*sglist), GFP_KERNEL); if (!sglist) return NULL; sg_init_table(sglist, page_cnt);