Skip to content

Commit

Permalink
Fix highmem PPC build failure
Browse files Browse the repository at this point in the history
Commit f4112de ("mm: introduce
debug_kmap_atomic") broke PPC builds with CONFIG_HIGHMEM=y:

   CC      init/main.o
  In file included from include/linux/highmem.h:25,
                   from include/linux/pagemap.h:11,
                   from include/linux/mempolicy.h:63,
                   from init/main.c:53:
  arch/powerpc/include/asm/highmem.h: In function 'kmap_atomic_prot':
  arch/powerpc/include/asm/highmem.h:98: error: implicit declaration of function 'debug_kmap_atomic'
  In file included from include/linux/pagemap.h:11,
                   from include/linux/mempolicy.h:63,
                   from init/main.c:53:
  include/linux/highmem.h: At top level:
  include/linux/highmem.h:196: warning: conflicting types for 'debug_kmap_atomic'
  include/linux/highmem.h:196: error: static declaration of 'debug_kmap_atomic' follows non-static declaration
  include/asm/highmem.h:98: error: previous implicit declaration of 'debug_kmap_atomic' was here
  make[1]: *** [init/main.o] Error 1
  make: *** [init] Error 2

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
kumargala authored and torvalds committed Apr 3, 2009
1 parent c54c4de commit 3688e07
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions include/linux/highmem.h
Expand Up @@ -19,8 +19,21 @@ static inline void flush_kernel_dcache_page(struct page *page)
}
#endif

#ifdef CONFIG_HIGHMEM
#include <asm/kmap_types.h>

#if defined(CONFIG_DEBUG_HIGHMEM) && defined(CONFIG_TRACE_IRQFLAGS_SUPPORT)

void debug_kmap_atomic(enum km_type type);

#else

static inline void debug_kmap_atomic(enum km_type type)
{
}

#endif

#ifdef CONFIG_HIGHMEM
#include <asm/highmem.h>

/* declarations for linux/mm/highmem.c */
Expand All @@ -44,8 +57,6 @@ static inline void *kmap(struct page *page)

#define kunmap(page) do { (void) (page); } while (0)

#include <asm/kmap_types.h>

static inline void *kmap_atomic(struct page *page, enum km_type idx)
{
pagefault_disable();
Expand Down Expand Up @@ -187,16 +198,4 @@ static inline void copy_highpage(struct page *to, struct page *from)
kunmap_atomic(vto, KM_USER1);
}

#if defined(CONFIG_DEBUG_HIGHMEM) && defined(CONFIG_TRACE_IRQFLAGS_SUPPORT)

void debug_kmap_atomic(enum km_type type);

#else

static inline void debug_kmap_atomic(enum km_type type)
{
}

#endif

#endif /* _LINUX_HIGHMEM_H */

0 comments on commit 3688e07

Please sign in to comment.