Re: [PATCH 5/5] arch: simplify several early memory allocations

2018-11-26 Thread Mike Rapoport
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(

Re: [PATCH 5/5] arch: simplify several early memory allocations

2018-11-26 Thread Christoph Hellwig
> 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? > static v

Re: [PATCH 5/5] arch: simplify several early memory allocations

2018-11-25 Thread Mike Rapoport
On Mon, Nov 26, 2018 at 08:03:55AM +0100, Christophe LEROY wrote: > > > Le 25/11/2018 à 22:44, Mike Rapoport a écrit : > >There are several early memory allocations in arch/ code that use > >memblock_phys_alloc() to allocate memory, convert the returned physical > >address to the virtual address

Re: [PATCH 5/5] arch: simplify several early memory allocations

2018-11-25 Thread Christophe LEROY
Le 25/11/2018 à 22:44, Mike Rapoport a écrit : There are several early memory allocations in arch/ code that use memblock_phys_alloc() to allocate memory, convert the returned physical address to the virtual address and then set the allocated memory to zero. Exactly the same behaviour can be

[PATCH 5/5] arch: simplify several early memory allocations

2018-11-25 Thread Mike Rapoport
There are several early memory allocations in arch/ code that use memblock_phys_alloc() to allocate memory, convert the returned physical address to the virtual address and then set the allocated memory to zero. Exactly the same behaviour can be achieved simply by calling memblock_alloc(): it allo