public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Exclude PUD/PMD alloc functions if !MMU
@ 2005-01-04 19:56 David Howells
  2005-01-05  2:15 ` Nick Piggin
  0 siblings, 1 reply; 3+ messages in thread
From: David Howells @ 2005-01-04 19:56 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel


Don't declare pud_alloc() and pmd_alloc() if a nommu kernel is being
compiled. These functions require various things that aren't defined for
nommu.

Signed-Off-By: David Howells <dhowells@redhat.com>
---
warthog>diffstat nommu-exclusions-2610mm1.diff 
 mm.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -uNrp /warthog/kernels/linux-2.6.10-mm1/include/linux/mm.h linux-2.6.10-mm1-frv/include/linux/mm.h
--- /warthog/kernels/linux-2.6.10-mm1/include/linux/mm.h	2005-01-04 11:15:27.000000000 +0000
+++ linux-2.6.10-mm1-frv/include/linux/mm.h	2005-01-04 17:39:56.462745022 +0000
@@ -668,7 +668,7 @@ extern void remove_shrinker(struct shrin
  * The following ifdef needed to get the 4level-fixup.h header to work.
  * Remove it when 4level-fixup.h has been removed.
  */
-#ifndef __ARCH_HAS_4LEVEL_HACK 
+#if defined(CONFIG_MMU) && !defined(__ARCH_HAS_4LEVEL_HACK)
 static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
 {
 	if (pgd_none(*pgd))

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

* Re: [PATCH] Exclude PUD/PMD alloc functions if !MMU
  2005-01-04 19:56 [PATCH] Exclude PUD/PMD alloc functions if !MMU David Howells
@ 2005-01-05  2:15 ` Nick Piggin
  2005-01-05 11:45   ` David Howells
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Piggin @ 2005-01-05  2:15 UTC (permalink / raw)
  To: David Howells; +Cc: akpm, linux-kernel

David Howells wrote:
> Don't declare pud_alloc() and pmd_alloc() if a nommu kernel is being
> compiled. These functions require various things that aren't defined for
> nommu.
> 
> Signed-Off-By: David Howells <dhowells@redhat.com>
> ---
> warthog>diffstat nommu-exclusions-2610mm1.diff 
>  mm.h |    2 +-
>  1 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff -uNrp /warthog/kernels/linux-2.6.10-mm1/include/linux/mm.h linux-2.6.10-mm1-frv/include/linux/mm.h
> --- /warthog/kernels/linux-2.6.10-mm1/include/linux/mm.h	2005-01-04 11:15:27.000000000 +0000
> +++ linux-2.6.10-mm1-frv/include/linux/mm.h	2005-01-04 17:39:56.462745022 +0000
> @@ -668,7 +668,7 @@ extern void remove_shrinker(struct shrin
>   * The following ifdef needed to get the 4level-fixup.h header to work.
>   * Remove it when 4level-fixup.h has been removed.
>   */
> -#ifndef __ARCH_HAS_4LEVEL_HACK 
> +#if defined(CONFIG_MMU) && !defined(__ARCH_HAS_4LEVEL_HACK)
>  static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
>  {
>  	if (pgd_none(*pgd))

I think you need to do it in the following way:

#ifdef CONFIG_MMU
#ifndef __ARCH_HAS_4LEVEL_HACK
static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
{
          if (pgd_none(*pgd))
...
#else /* __ARCH_HAS_4LEVEL_HACK */
...
#endif /* __ARCH_HAS_4LEVEL_HACK */
#endif /* CONFIG_MMU */

No?

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

* Re: [PATCH] Exclude PUD/PMD alloc functions if !MMU
  2005-01-05  2:15 ` Nick Piggin
@ 2005-01-05 11:45   ` David Howells
  0 siblings, 0 replies; 3+ messages in thread
From: David Howells @ 2005-01-05 11:45 UTC (permalink / raw)
  To: Nick Piggin; +Cc: akpm, linux-kernel


Nick Piggin <nickpiggin@yahoo.com.au> wrote:

> I think you need to do it in the following way:

That works too.

David

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

end of thread, other threads:[~2005-01-05 11:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-04 19:56 [PATCH] Exclude PUD/PMD alloc functions if !MMU David Howells
2005-01-05  2:15 ` Nick Piggin
2005-01-05 11:45   ` David Howells

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