public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Sparsemem build fix.
@ 2006-05-31 13:27 Ralf Baechle
  2006-05-31 16:57 ` Andy Whitcroft
  0 siblings, 1 reply; 2+ messages in thread
From: Ralf Baechle @ 2006-05-31 13:27 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, linux-kernel, Chad Reese

<linux/mmzone.h> uses PAGE_SIZE, PAGE_SHIFT from <asm/page.h> without
including that header itself.  For some sparsemem configurations this
may result in build errors like:

  CC      init/initramfs.o
In file included from include/linux/gfp.h:4,
                 from include/linux/slab.h:15,
                 from include/linux/percpu.h:4,
                 from include/linux/rcupdate.h:41,
                 from include/linux/dcache.h:10,
                 from include/linux/fs.h:226,
                 from init/initramfs.c:2:
include/linux/mmzone.h:498:22: warning: "PAGE_SHIFT" is not defined
In file included from include/linux/gfp.h:4,
                 from include/linux/slab.h:15,
                 from include/linux/percpu.h:4,
                 from include/linux/rcupdate.h:41,
                 from include/linux/dcache.h:10,
                 from include/linux/fs.h:226,
                 from init/initramfs.c:2:
include/linux/mmzone.h:526: error: `PAGE_SIZE' undeclared here (not in a function)
include/linux/mmzone.h: In function `__pfn_to_section':
include/linux/mmzone.h:573: error: `PAGE_SHIFT' undeclared (first use in this function)
include/linux/mmzone.h:573: error: (Each undeclared identifier is reported only once
include/linux/mmzone.h:573: error: for each function it appears in.)
include/linux/mmzone.h: In function `pfn_valid':
include/linux/mmzone.h:578: error: `PAGE_SHIFT' undeclared (first use in this function)
make[1]: *** [init/initramfs.o] Error 1
make: *** [init] Error 2

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 3674035..2d83371 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -15,6 +15,7 @@ #include <linux/init.h>
 #include <linux/seqlock.h>
 #include <linux/nodemask.h>
 #include <asm/atomic.h>
+#include <asm/page.h>
 
 /* Free memory management - zoned buddy allocator.  */
 #ifndef CONFIG_FORCE_MAX_ZONEORDER

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Sparsemem build fix.
  2006-05-31 13:27 [PATCH] Sparsemem build fix Ralf Baechle
@ 2006-05-31 16:57 ` Andy Whitcroft
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Whitcroft @ 2006-05-31 16:57 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Linus Torvalds, Andrew Morton, linux-kernel, Chad Reese

Ralf Baechle wrote:
> <linux/mmzone.h> uses PAGE_SIZE, PAGE_SHIFT from <asm/page.h> without
> including that header itself.  For some sparsemem configurations this
> may result in build errors like:
> 
>   CC      init/initramfs.o
> In file included from include/linux/gfp.h:4,
>                  from include/linux/slab.h:15,
>                  from include/linux/percpu.h:4,
>                  from include/linux/rcupdate.h:41,
>                  from include/linux/dcache.h:10,
>                  from include/linux/fs.h:226,
>                  from init/initramfs.c:2:
> include/linux/mmzone.h:498:22: warning: "PAGE_SHIFT" is not defined
> In file included from include/linux/gfp.h:4,
>                  from include/linux/slab.h:15,
>                  from include/linux/percpu.h:4,
>                  from include/linux/rcupdate.h:41,
>                  from include/linux/dcache.h:10,
>                  from include/linux/fs.h:226,
>                  from init/initramfs.c:2:
> include/linux/mmzone.h:526: error: `PAGE_SIZE' undeclared here (not in a function)
> include/linux/mmzone.h: In function `__pfn_to_section':
> include/linux/mmzone.h:573: error: `PAGE_SHIFT' undeclared (first use in this function)
> include/linux/mmzone.h:573: error: (Each undeclared identifier is reported only once
> include/linux/mmzone.h:573: error: for each function it appears in.)
> include/linux/mmzone.h: In function `pfn_valid':
> include/linux/mmzone.h:578: error: `PAGE_SHIFT' undeclared (first use in this function)
> make[1]: *** [init/initramfs.o] Error 1
> make: *** [init] Error 2
> 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> 
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index 3674035..2d83371 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -15,6 +15,7 @@ #include <linux/init.h>
>  #include <linux/seqlock.h>
>  #include <linux/nodemask.h>
>  #include <asm/atomic.h>
> +#include <asm/page.h>
>  
>  /* Free memory management - zoned buddy allocator.  */
>  #ifndef CONFIG_FORCE_MAX_ZONEORDER
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

Seems completely reasonable.

-apw

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-05-31 16:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-31 13:27 [PATCH] Sparsemem build fix Ralf Baechle
2006-05-31 16:57 ` Andy Whitcroft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox