Re: [PATCH v2] x86/setup: Merge {early_,}reserve_initrd() to one function

From: Alexander Kuleshov
Date: Tue Feb 09 2016 - 06:51:21 EST


Hello Ingo,

On Tue, Feb 9, 2016 at 3:16 PM, Ingo Molnar <mingo@xxxxxxxxxx> wrote:
>
> So I don't think the code got easier to understand - in particular the
> memblock_reserve()/free() pattern, depending on a flag value, is confusing.
>
> The duplication is there - but please factor it out into a helper structure
> ('struct ramdisk') and a helper function that sets up the structure.

What if instead of `struct ramdisk`, we will move all definitions/check from
the early_reserve_initrd to the setup_arch() and than will pass these values
to the reserve_initrd()?