Re: [PATCH -mm 2/4] x86_64 boot: Add linked list of structsetup_data

From: Huang, Ying
Date: Thu Mar 27 2008 - 22:07:44 EST


On Thu, 2008-03-27 at 06:25 -0500, Paul Jackson wrote:
> Huang wrote:
> + while (pa_data) {
> + data = early_ioremap(pa_data, PAGE_SIZE);
> + switch (data->type) {
> + default:
> + break;
> + }
>
> Isn't that switch statement equivalent to -always- breaking, as in:
>
> + while (pa_data) {
> + data = early_ioremap(pa_data, PAGE_SIZE);
> + break;
>
> I doubt you want to do that. I suppose what you want to do is check for
> data == NULL instead, as in:
>
> + while (pa_data) {
> + data = early_ioremap(pa_data, PAGE_SIZE);
> + if (!data)
> + break;

This break will break the switch instead of while. When setup_data
processing code is added, the code will looks like:

#define SETUP_DATA_E820_EXT 1

while (pa_data) {
data = early_ioremap(pa_data, PAGE_SIZE);
switch (data->type) {
case SETUP_DATA_E820_EXT:
parse_e820_ext(data, pa_data);
break;
default:
break;
}
...

Best Regards,
Huang Ying
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/