lkml.org 
[lkml]   [2017]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/14] resource: add walk_system_ram_res_rev()
On Thu, Aug 24, 2017 at 10:06:28AM +0100, Ard Biesheuvel wrote:
> On 24 August 2017 at 09:18, AKASHI Takahiro <takahiro.akashi@linaro.org> wrote:
> > + /* create a list */
> > + rams = vmalloc(sizeof(struct resource) * count);
> > + if (!rams)
> > + return ret;
> > +
> > + res.start = start;
> > + res.end = end;
> > + res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
> > + orig_end = res.end;
> > + i = 0;
> > + while ((res.start < res.end) &&
> > + (!find_next_iomem_res(&res, IORES_DESC_NONE, true))) {
> > + if (i >= count) {
> > + /* unlikely but */
> > + vfree(rams);
> > + count += 16;
>
> If the count is likely to be < 16, why are we using vmalloc() here?

Ah, you're right :)

-Takahiro AKASHI

\
 
 \ /
  Last update: 2017-08-25 02:51    [W:0.167 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site