lkml.org 
[lkml]   [2016]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] x86/setup: Merge {early_,}reserve_initrd() to one function

* Alexander Kuleshov <kuleshovmail@gmail.com> wrote:

> Hello Ingo,
>
> On Tue, Feb 9, 2016 at 3:16 PM, Ingo Molnar <mingo@kernel.org> 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()?

There's too many of them, putting them into 'struct ramdisk' cleans up and
documents the whole code.

And yes, 'struct ramdisk' state should be defined in setup_arch(), that way it
does not have to be calculated twice: so the patch becomes not just a code size
reduction but a (small) runtime reduction as well.

Should be tested with a real ramdisk, to make sure everything still works fine.

Thanks,

Ingo

\
 
 \ /
  Last update: 2016-02-09 13:21    [W:0.083 / U:0.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site