Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4021487pxa; Sun, 9 Aug 2020 20:55:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvdjDgS18KLxV5JZZzFgcjGPcwkhwgJDpQXVAL0D8ROxisxy6C36qYtOTzaybFxIWvUVGB X-Received: by 2002:a50:af83:: with SMTP id h3mr1444913edd.139.1597031719755; Sun, 09 Aug 2020 20:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597031719; cv=none; d=google.com; s=arc-20160816; b=UlC9uIIxkn/yp7Mt53f1eK2faIQ22B6OxFKiIH5KYJZPWgnGhL5cEqSA6LMjiDXv2p 7O65TAil9tf/gnDcB6cVnA1VQ3fMBoszldX12T4eN8eFbtft0p/8Mb2x/ZiDGaW+zkyO WdNhpdgtBuksP26cCga3zR0Rh6VOaHNv8o1bQjEOgngeaTwhSg41UUecwKusRHLY9ZQg ZEFizwlyVj2PZ9iNk8cSmCvPC98u43Mt6FI6u045Us1LRbKAls3gR2WHvUne5vm02GFm c76lpP06WQHRZn7Am5ecYeKZ/4xhxLNTtd79MXwzJk4tJBGKCNebVLYNdzwm85QQSrsJ nNbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=84bq2eVZP/J9K+NjLEUCnEVIr+p4XUgWluN/PDileB4=; b=zb79LDx8LOznKcHD/vyknXNEGaCqCXary8rSdhsDxLV87ZgPhH73eMJAdF5NPNuVEU x8BnxWhYG5zNFy5Nd9NspemxQS8eFEdACT2J9B4icKLcE9RYDAB713SPBimkDyzkJ6L1 KyrCQOcmlaORuyLM4SfKBi/HroGQm6H4cy9MTTdP2dEQJBNOeo7RFykfkaY/YqSAT664 Bljr9BieXhP0iTd1btrDU3X3bSxtTAiAKDZ4U8HjxHWRxlniBJJTtISz8ENelS1d6ug7 +BfsszQVrd9v7kmsdb2WBpfJxgk3X00tYfBcNRc4oz/UpA+xLFya1q0cDjB6IMiBB1Yn MbJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@pensando.io header.s=google header.b=vv3C+gcD; 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 bu19si9815544ejb.305.2020.08.09.20.54.56; Sun, 09 Aug 2020 20:55:19 -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; dkim=fail header.i=@pensando.io header.s=google header.b=vv3C+gcD; 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 S1726515AbgHJDyW (ORCPT + 99 others); Sun, 9 Aug 2020 23:54:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726481AbgHJDyW (ORCPT ); Sun, 9 Aug 2020 23:54:22 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37F17C061786 for ; Sun, 9 Aug 2020 20:54:22 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id mt12so4092119pjb.4 for ; Sun, 09 Aug 2020 20:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=84bq2eVZP/J9K+NjLEUCnEVIr+p4XUgWluN/PDileB4=; b=vv3C+gcDGVxjL/s4FaN5isodWCPVa8ltSCmng0R1vzhJYMgFGPNIc8ZUDDKJEN51GB diSghQx1h5aFjxCPXWTdyoZuFkWsdNSjUfubK2eHswpfoJ6Z5DnWLYmfQrPWMCsBRFUZ 4zVrKAUc05rLzbLxp8b9Aop/f7UHEPebEtqgK5HGQHnvr1kLKAJdFdblVeYnpPKnEr5n IKJr8nhLBglgjuVbKNFTDy2Ehe3ES2iWTTpNSPNZp5NqLQdEsx8W6bjLMG4ZX+ndAYxF 7gCfW+10eQtsSUhWVgzR/Y1iJyvu7/nhibTpBpFIBZO3KCy4ex4ZWStSyMNsOMxfjH4j nL1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=84bq2eVZP/J9K+NjLEUCnEVIr+p4XUgWluN/PDileB4=; b=fa7V2Dt7IxR500hD4Zqs0iZ2VQpzc3BAmnhPygFMWASqPrSi7uW3RY6+8xfAJz6T+e OsOlwRS05KkDn7IlR1hmwdYXqSWDNZXbav8m6Yg3LX150OOeq13h00l7VBW2HCR2PoG1 /vnxRMPrTCpOMEXhNClG93+0uy+mTECRJSGLaqvs4XZ9Cb0gLOUpDlqdd8TmHh+dpr90 1cyUoyCE4gw5RRJ9VtEA9Z0ikKIocbjdXJ7QUQXHEPFkHJ6cAHwCRKbs9pyw4fAwRMyz eyG8ab24y8bpl6rYCqCCzZyuTO23K3RrwNQpyy9w+dOL57sUmFl/cOzf6xfrtsVF00a8 M2fA== X-Gm-Message-State: AOAM5321bKuNYCiY0OQ38y/T0r3oCharToZ+N2k00cfEt9n0cyvfokas JwS2TvyUz0oePEPnGU9cVosOmnUKbGs= X-Received: by 2002:a17:90a:e986:: with SMTP id v6mr26536533pjy.88.1597031661180; Sun, 09 Aug 2020 20:54:21 -0700 (PDT) Received: from Shannons-MacBook-Pro.local (static-50-53-47-17.bvtn.or.frontiernet.net. [50.53.47.17]) by smtp.gmail.com with ESMTPSA id mp3sm55496383pjb.0.2020.08.09.20.54.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Aug 2020 20:54:20 -0700 (PDT) Subject: Re: [PATCH] ionic_lif: Use devm_kcalloc() in ionic_qcq_alloc() To: Xu Wang , drivers@pensando.io, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org References: <20200810023807.9260-1-vulab@iscas.ac.cn> From: Shannon Nelson Message-ID: Date: Sun, 9 Aug 2020 20:54:19 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200810023807.9260-1-vulab@iscas.ac.cn> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/9/20 7:38 PM, Xu Wang wrote: > A multiplication for the size determination of a memory allocation > indicated that an array data structure should be processed. > Thus use the corresponding function "devm_kcalloc". > > Signed-off-by: Xu Wang Acked-by: Shannon Nelson > --- > drivers/net/ethernet/pensando/ionic/ionic_lif.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c > index 1944bf5264db..26988ad7ec97 100644 > --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c > +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c > @@ -412,7 +412,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type, > > new->flags = flags; > > - new->q.info = devm_kzalloc(dev, sizeof(*new->q.info) * num_descs, > + new->q.info = devm_kcalloc(dev, num_descs, sizeof(*new->q.info), > GFP_KERNEL); > if (!new->q.info) { > netdev_err(lif->netdev, "Cannot allocate queue info\n"); > @@ -462,7 +462,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type, > new->intr.index = IONIC_INTR_INDEX_NOT_ASSIGNED; > } > > - new->cq.info = devm_kzalloc(dev, sizeof(*new->cq.info) * num_descs, > + new->cq.info = devm_kcalloc(dev, num_descs, sizeof(*new->cq.info), > GFP_KERNEL); > if (!new->cq.info) { > netdev_err(lif->netdev, "Cannot allocate completion queue info\n");