From: Ingo Molnar <mingo@kernel.org>
To: Alexander Kuleshov <kuleshovmail@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
"H . Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Borislav Petkov <bp@suse.de>,
Joerg Roedel <jroedel@suse.de>, Dave Young <dyoung@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Jiri Kosina <jkosina@suse.cz>, Baoquan He <bhe@redhat.com>,
Mark Salter <msalter@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] x86/setup: get ramdisk parameters only once
Date: Wed, 17 Feb 2016 09:25:55 +0100 [thread overview]
Message-ID: <20160217082555.GA1197@gmail.com> (raw)
In-Reply-To: <1455183083-23289-1-git-send-email-kuleshovmail@gmail.com>
* Alexander Kuleshov <kuleshovmail@gmail.com> wrote:
> void __init setup_arch(char **cmdline_p)
> {
> + struct ramdisk ramdisk_image = {
> + .start_addr = get_ramdisk_image(),
> + .size = get_ramdisk_size(),
> + .reserve_ramdisk = true
> + };
> +
> + /* Assume only end is not page aligned */
> + ramdisk_image.end_addr = PAGE_ALIGN(ramdisk_image.start_addr + ramdisk_image.size),
> +
> memblock_reserve(__pa_symbol(_text),
> (unsigned long)__bss_stop - (unsigned long)_text);
>
> - early_reserve_initrd();
> + if (!boot_params.hdr.type_of_loader || !ramdisk_image.start_addr
> + || !ramdisk_image.size)
Don't do pointless line breaks.
> + ramdisk_image.reserve_ramdisk = false; /* No initrd provided by bootloader */
> + else
> + memblock_reserve(ramdisk_image.start_addr,
> + ramdisk_image.end_addr - ramdisk_image.start_addr);
There's a simpler way to write that line ...
> /*
> * At this point everything still needed from the boot loader
> @@ -1135,7 +1137,8 @@ void __init setup_arch(char **cmdline_p)
> /* Allocate bigger log buffer */
> setup_log_buf(1);
>
> - reserve_initrd();
> + if (ramdisk_image.reserve_ramdisk)
> + reserve_initrd(&ramdisk_image);
It's cleaner to make that check inside reserve_initrd() ...
Thanks,
Ingo
prev parent reply other threads:[~2016-02-17 8:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 9:31 [PATCH v4] x86/setup: get ramdisk parameters only once Alexander Kuleshov
2016-02-17 8:25 ` Ingo Molnar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160217082555.GA1197@gmail.com \
--to=mingo@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=bp@suse.de \
--cc=dyoung@redhat.com \
--cc=hpa@zytor.com \
--cc=jkosina@suse.cz \
--cc=jroedel@suse.de \
--cc=kuleshovmail@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=msalter@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox