[PATCH 03/14] resource: add walk_system_ram_res_rev()

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

 



On Thu, Aug 24, 2017 at 10:06:28AM +0100, Ard Biesheuvel wrote:
> On 24 August 2017 at 09:18, AKASHI Takahiro <takahiro.akashi at 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



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux