[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1501231502350.5526@nanos>
Date: Fri, 23 Jan 2015 15:24:45 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: WANG Chao <chaowang@...hat.com>
cc: "H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...nel.org>,
"maintainer:X86 ARCHITECTURE..." <x86@...nel.org>,
Matt Fleming <matt.fleming@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Santosh Shilimkar <santosh.shilimkar@...com>,
Borislav Petkov <bp@...e.de>,
Daniel Kiper <daniel.kiper@...cle.com>,
Bryan O'Donoghue <pure.logic@...us-software.ie>,
"open list:X86 ARCHITECTURE..." <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] x86: add macro for_each_setup_data()
On Wed, 7 Jan 2015, WANG Chao wrote:
> +#define for_each_setup_data(pa_data, data) \
> + for (pa_data = boot_params.hdr.setup_data; \
> + pa_data && (data = early_memremap(pa_data, sizeof(*data))); \
> + pa_data = data->next, early_iounmap(data, sizeof(*data)))
> +
That makes the code obfuscated not clearer. Brain went into spiral
mode.
struct setup_iter {
u64 pa_data, pa_next;
u32 len, type;
};
....
{
struct setup_iter iter = { .pa_next = boot_params.hdr.setup_data };
while (get_next_setup_data(&iter)) {
switch (iter.type) {
case SETUP_E820_EXT:
parse_e820_ext(iter.pa_data, iter.len);
....
Perhaps?
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists