On Fri, 04 Aug 2006 15:32:52 +0200, Franck Bui-Huu <vagabon.xyz@xxxxxxxxx> wrote: > This function although doing simple things is hard to follow. It's > mainly due to: > > - a lot of #ifdef > - bad local names > - redundant tests > > So this patch try to address these issues. It also do not use > max_pfn global which is marked as an unused exported symbol. Looks good for me, except this: > - if (max_low_pfn > MAXMEM_PFN) { > - max_low_pfn = MAXMEM_PFN; > -#ifndef CONFIG_HIGHMEM > - /* Maximum memory usable is what is directly addressable */ > - printk(KERN_WARNING "Warning only %ldMB will be used.\n", > - MAXMEM >> 20); > - printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n"); > + if (highest > PFN_DOWN(HIGHMEM_START)) { > +#ifdef CONFIG_HIGHMEM > + highstart_pfn = PFN_DOWN(HIGHMEM_START); > + highend_pfn = highest; > #endif > + highest = PFN_DOWN(HIGHMEM_START); > } You drop two warnings here. I'm afraid this leads so many "I have 1GB memory but can not use all of them. Why?" questions. BTW, "Use a HIGHMEM enabled kernel" might not be good. I suppose Ralf wants something like this :-) #if defined(CPU_SUPPORTS_64BIT_KERNEL) && defined(SYS_SUPPORTS_64BIT_KERNEL) printk(KERN_WARNING "Use a 64-bit kernel.\n"); #elif defined(CPU_SUPPORTS_HIGHMEM) && defined(SYS_SUPPORTS_HIGHMEM) printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n"); #else /* put a good excuse here... */ #endif --- Atsushi Nemoto