mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: WANG Chao <chaowang@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@kernel.org>,
	"maintainer:X86 ARCHITECTURE..." <x86@kernel.org>,
	Matt Fleming <matt.fleming@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	Borislav Petkov <bp@suse.de>,
	Daniel Kiper <daniel.kiper@oracle.com>,
	"Bryan O'Donoghue" <pure.logic@nexus-software.ie>,
	"open list:X86 ARCHITECTURE..." <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] x86: add macro for_each_setup_data()
Date: Fri, 23 Jan 2015 15:24:45 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1501231502350.5526@nanos> (raw)
In-Reply-To: <1420628150-16872-2-git-send-email-chaowang@redhat.com>

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

  reply	other threads:[~2015-01-23 14:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-07 10:55 [PATCH 1/2] x86: early_memremap exact size of struct setup_data WANG Chao
2015-01-07 10:55 ` [PATCH 2/2] x86: add macro for_each_setup_data() WANG Chao
2015-01-23 14:24   ` Thomas Gleixner [this message]
2015-01-23 15:18 ` [tip:x86/mm] x86, setup: Let early_memremap() handle page alignment tip-bot for WANG Chao

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=alpine.DEB.2.11.1501231502350.5526@nanos \
    --to=tglx@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=bp@suse.de \
    --cc=chaowang@redhat.com \
    --cc=daniel.kiper@oracle.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=mingo@kernel.org \
    --cc=pure.logic@nexus-software.ie \
    --cc=santosh.shilimkar@ti.com \
    --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

all inboxes | Powered by JetHome®