Re: [PATCH 1/4] driver/scsi/fnic/fnic_trace: Use vzalloc to zero instead of vmalloc+memset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2018-08-01 at 18:30 +0300, Andy Shevchenko wrote:
> On Wed, Aug 1, 2018 at 4:26 PM, zhong jiang <zhongjiang@xxxxxxxxxx> wrote:
> > The vzalloc is better than vmalloc+memset, so replace them to make
> > the code concise.
> > -       fnic_trace_buf_p = (unsigned long)vmalloc((trace_max_pages * PAGE_SIZE));
> > +       fnic_trace_buf_p = (unsigned long)vzalloc((trace_max_pages * PAGE_SIZE));
> 
> At the same time you may get rid of unnecessary parens.

And at the same time, perhaps use kvcalloc and kvfree
instead of always using vmalloc as the allocation size
can be less than the allowable for a single kmalloc.





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux