Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1330162
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] x86/setup: Merge {early_,}reserve_initrd() to one function |
| Date | 2016-02-09 13:20 +0100 |
| Message-ID | <r0fqY-3Sj-59@gated-at.bofh.it> (permalink) |
| References | <qZYq8-qH-43@gated-at.bofh.it> <r0cCK-21t-11@gated-at.bofh.it> <r0f7z-3uX-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
* 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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2] x86/setup: Merge {early_,}reserve_initrd() to one function Alexander Kuleshov <kuleshovmail@gmail.com> - 2016-02-08 19:10 +0100
Re: [PATCH v2] x86/setup: Merge {early_,}reserve_initrd() to one function Ingo Molnar <mingo@kernel.org> - 2016-02-09 10:20 +0100
Re: [PATCH v2] x86/setup: Merge {early_,}reserve_initrd() to one function Alexander Kuleshov <kuleshovmail@gmail.com> - 2016-02-09 13:00 +0100
Re: [PATCH v2] x86/setup: Merge {early_,}reserve_initrd() to one function Ingo Molnar <mingo@kernel.org> - 2016-02-09 13:20 +0100
csiph-web