lkml.org 
[lkml]   [2018]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] arch: simplify several early memory allocations
On Mon, Nov 26, 2018 at 12:21:34AM -0800, Christoph Hellwig wrote:
> > static void __init *early_alloc_aligned(unsigned long sz, unsigned long align)
> > {
> > - void *ptr = __va(memblock_phys_alloc(sz, align));
> > - memset(ptr, 0, sz);
> > - return ptr;
> > + return memblock_alloc(sz, align);
> > }
>
> What is the point of keeping this wrapper?

No point indeed. I'll remove it in v2.

> > static void __init *early_alloc(unsigned long sz)
> > {
> > - void *ptr = __va(memblock_phys_alloc(sz, sz));
> > - memset(ptr, 0, sz);
> > - return ptr;
> > + return memblock_alloc(sz, sz);
> > }
>
> Same here.
>

Here it provides a shortcut for allocations with align == size, but can be
removed as well.

--
Sincerely yours,
Mike.

\
 
 \ /
  Last update: 2018-11-26 09:47    [W:0.104 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site