mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cheng Xu <chengyou@linux.alibaba.com>
To: Markus Elfring <Markus.Elfring@web.de>,
	Qianfeng Rong <rongqianfeng@vivo.com>,
	linux-rdma@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Kai Shen <kaishen@linux.alibaba.com>,
	Leon Romanovsky <leon@kernel.org>,
	Liao Yuanhong <liaoyuanhong@vivo.com>
Subject: Re: [PATCH] RDMA/erdma: Use vcalloc() instead of vzalloc()
Date: Thu, 21 Aug 2025 14:26:19 +0800	[thread overview]
Message-ID: <176d4590-6cfd-8a39-a855-ee21105496b5@linux.alibaba.com> (raw)
In-Reply-To: <e8a8404b-b524-4d9e-b0de-d743acf8d7b4@web.de>



On 8/20/25 10:34 PM, Markus Elfring wrote:
>> Replace vzalloc() with vcalloc() in vmalloc_to_dma_addrs(). …
> 
> 
> 
> …
>> +++ b/drivers/infiniband/hw/erdma/erdma_verbs.c
>> @@ -671,7 +671,7 @@ static u32 vmalloc_to_dma_addrs(struct erdma_dev *dev, dma_addr_t **dma_addrs,
>>  
>>  	npages = (PAGE_ALIGN((u64)buf + len) - PAGE_ALIGN_DOWN((u64)buf)) >>
>>  		 PAGE_SHIFT;
>> -	pg_dma = vzalloc(npages * sizeof(dma_addr_t));
>> +	pg_dma = vcalloc(npages, sizeof(dma_addr_t));
> …
> 
> How do you think about to adjust also the size determination?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.17-rc2#n944
> 
> 	pg_dma = vcalloc(npages, sizeof(*pg_dma));
> 

Hi Qianfeng and Markus,

Both your changes look good to me.

Qianfeng, Could you send v2 including Markus's change?

Thanks,
Cheng Xu

> 
> Regards,
> Markus

  reply	other threads:[~2025-08-21  6:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20 13:21 Qianfeng Rong
2025-08-20 14:34 ` Markus Elfring
2025-08-21  6:26   ` Cheng Xu [this message]
2025-08-21  6:44     ` Qianfeng Rong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176d4590-6cfd-8a39-a855-ee21105496b5@linux.alibaba.com \
    --to=chengyou@linux.alibaba.com \
    --cc=Markus.Elfring@web.de \
    --cc=jgg@ziepe.ca \
    --cc=kaishen@linux.alibaba.com \
    --cc=leon@kernel.org \
    --cc=liaoyuanhong@vivo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rongqianfeng@vivo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®