diff options
author | Matthew Wilcox <matthew@wil.cx> | 2009-06-16 18:32:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 22:47:41 -0400 |
commit | 31c911329e048b715a1dfeaaf617be9430fd7f4e (patch) | |
tree | a8eca5337528c21ab54ae5ad152d04a471b906cf /include/linux/highmem.h | |
parent | 69c854817566db82c362797b4a6521d0b00fe1d8 (diff) |
mm: check the argument of kunmap on architectures without highmem
If you're using a non-highmem architecture, passing an argument with the
wrong type to kunmap() doesn't give you a warning because the ifdef
doesn't check the type.
Using a static inline function solves the problem nicely.
Reported-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/highmem.h')
-rw-r--r-- | include/linux/highmem.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 1fcb7126a01f..211ff4497269 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -55,7 +55,9 @@ static inline void *kmap(struct page *page) | |||
55 | return page_address(page); | 55 | return page_address(page); |
56 | } | 56 | } |
57 | 57 | ||
58 | #define kunmap(page) do { (void) (page); } while (0) | 58 | static inline void kunmap(struct page *page) |
59 | { | ||
60 | } | ||
59 | 61 | ||
60 | static inline void *kmap_atomic(struct page *page, enum km_type idx) | 62 | static inline void *kmap_atomic(struct page *page, enum km_type idx) |
61 | { | 63 | { |