YOSHIFUJI Hideaki / 吉藤英明 wrote: > > In article <3DFC818F.80E3DC00@cinet.co.jp> (at Sun, 15 Dec 2002 22:20:15 +0900), Osamu Tomita says: > > > +#ifndef CONFIG_PC9800 > > if (mpf->mpf_physptr) > > reserve_bootmem(mpf->mpf_physptr, PAGE_SIZE); > > +#else > > + /* > > + * PC-9800's MPC table places on the very last of > > + * physical memory; so that simply reserving PAGE_SIZE > > + * from mpg->mpf_physptr yields BUG() in > > + * reserve_bootmem. > > + */ > > + if (mpf->mpf_physptr) { > > + /* > > + * We cannot access to MPC table to compute > > + * table size yet, as only few megabytes from > > + * the bottom is mapped now. > > + */ > > + unsigned long size = PAGE_SIZE; > > + unsigned long end = max_low_pfn * PAGE_SIZE; > > + if (mpf->mpf_physptr + size > end) > > + size = end - mpf->mpf_physptr; > > + reserve_bootmem(mpf->mpf_physptr, size); > > + } > > +#endif > > + > > I'm not sure if we need this #ifdef; > it doesn't seem that this #ifdef CONFIG_PC9800 part is harmful > for others at all. > > Well, if it is required, I prefer putting #ifdef..#endif inside the > if-clause like this: > > if (mpf->mpf_physptr) { > unsigned long size = PAGE_SIZE; > #ifdef CONFIG_PC9800 > /* > * PC-9800's MPC table places on the very last of > * physical memory; so that simply reserving PAGE_SIZE > * from mpg->mpf_physptr yields BUG() in > * reserve_bootmem. > * > * We cannot access to MPC table to compute > * table size yet, as only few megabytes from > * the bottom is mapped now. > */ > unsigned long end = max_low_pfn * PAGE_SIZE; > > if (mpf->mpf_physptr + size > end) > size = end - mpf->mpf_physptr; > #endif > reserve_bootmem(mpf->mpf_physptr, size); > } > Thanks for your advice! Indeed, No need "#ifdef" here. Because there is a check by "if (mpf->mpf_physptr + size > end)". I rewrite patch. Please comment. -- Osamu Tomita