Commit 254f9c5c authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

Convert non-highmem kmap_atomic() to static inline function

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: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f5456e04
...@@ -42,8 +42,14 @@ static inline void *kmap(struct page *page) ...@@ -42,8 +42,14 @@ static inline void *kmap(struct page *page)
#define kunmap(page) do { (void) (page); } while (0) #define kunmap(page) do { (void) (page); } while (0)
#define kmap_atomic(page, idx) \ #include <asm/kmap_types.h>
({ pagefault_disable(); page_address(page); })
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 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_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx))
#define kmap_atomic_to_page(ptr) virt_to_page(ptr) #define kmap_atomic_to_page(ptr) virt_to_page(ptr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment