Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2464882pxk; Sun, 20 Sep 2020 05:11:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxArPFD3OR9XC4tznvs3RicrsJD/f/wWj92Ng3zy3vUxStgsHxrTCTgS0fbn5uOi1cwq2AD X-Received: by 2002:a05:6402:70f:: with SMTP id w15mr48504896edx.202.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=Ud0Rq+07xX2F3QEETrK47aW8UFE31g/hX08FIOQcWFw21CgW5KT2eWJz+70LDaMzl+ kU1mwWjEGKJYfBk2vzraP7Sii6efglB53g5bsQcxd+M1Qc3yGOqIphccidrqJTmnMbOj siHFVkO62tcR5tsUP6xn0Mh7/E3G7N4XvF7vvFq1zUZYwIFvvGoqFPt05yuc7+WbIpxT CpAC/ZR11fa63F5HMmTwXvYldcadADOmE4q3yxJuYP30DVl42aLPs9eKuDfwWCpX05pr 6mtVcjm5FYkV/pkftyBrguOFVHjATT0a5rdixcGAlghMSYxX2AFSag2xr13P94bjN+mY qMxA== 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=Oc3HkSCCmd2HmPwAJ4jZXC3CXqD3JJ9fJ4tiorhtHrI=; b=dGHqZqE7/NW6JZlcPKmOEn3Aaf6vf2O2r1ADui08AC2d1hKw60R7GlNMKnOiumkR2k 0GLsmA8BzBaQ3KuF48rGtc2jSJT1AZ7i3fHu9lZIkFBlRWp/cdoGGIzJ9gaPU4y5jbNM 1XeIEcFLx3IhHlPatUX+gwoDspnVqNC5INskG5kG9w1zLvpA2pf7jbot4c9fzrwo5A2T dMEagNxD4Cmz28Y9W58tN0XN74HgLKH51BRYWZp3T+L/mqPePsWpgonHFthCsLeJpNMg 6EJTFC1h8SaP2Tjg7VwWSpzCsKwirjbfo37uW1A6Fwm//N49ZFYq3WUaHj0Q9dLr2JmD FYFA== 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 bu11si3275386ejb.657.2020.09.20.05.10.30; 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 S1726477AbgITMJY (ORCPT + 99 others); Sun, 20 Sep 2020 08:09:24 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:50064 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726405AbgITMJP (ORCPT ); Sun, 20 Sep 2020 08:09:15 -0400 X-IronPort-AV: E=Sophos;i="5.77,282,1596492000"; d="scan'208";a="468612193" 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: Santosh Shilimkar Cc: kernel-janitors@vger.kernel.org, "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: [PATCH 07/14] RDS: drop double zeroing Date: Sun, 20 Sep 2020 13:26:19 +0200 Message-Id: <1600601186-7420-8-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 --- net/rds/rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -u -p a/net/rds/rdma.c b/net/rds/rdma.c --- a/net/rds/rdma.c +++ b/net/rds/rdma.c @@ -269,7 +269,7 @@ static int __rds_rdma_map(struct rds_soc goto out; } else { nents = ret; - sg = kcalloc(nents, sizeof(*sg), GFP_KERNEL); + sg = kmalloc_array(nents, sizeof(*sg), GFP_KERNEL); if (!sg) { ret = -ENOMEM; goto out;