]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Convert non-highmem kmap_atomic() to static inline function
authorGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 1 May 2007 20:33:07 +0000 (22:33 +0200)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 5 May 2007 00:59:08 +0000 (17:59 -0700)
Convert kmap_atomic() in the non-highmem case from a macro to a static
inline function, for better type-checking and the ability to pass void
pointers instead of struct page pointers.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/highmem.h

index 645d440807c229c0e5deba21f3ed3260f0416007..7bab8eae23411615bdcebe6129f3463c8850ca8e 100644 (file)
@@ -42,8 +42,14 @@ static inline void *kmap(struct page *page)
 
 #define kunmap(page) do { (void) (page); } while (0)
 
-#define kmap_atomic(page, idx) \
-       ({ pagefault_disable(); page_address(page); })
+#include <asm/kmap_types.h>
+
+static inline void *kmap_atomic(struct page *page, enum km_type idx)
+{
+       pagefault_disable();
+       return page_address(page);
+}
+
 #define kunmap_atomic(addr, idx)       do { pagefault_enable(); } while (0)
 #define kmap_atomic_pfn(pfn, idx)      kmap_atomic(pfn_to_page(pfn), (idx))
 #define kmap_atomic_to_page(ptr)       virt_to_page(ptr)