dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Matthew Wilcox 2009-06-16 15:32:45 -07:00 committed by Linus Torvalds
parent 69c8548175
commit 31c911329e
1 changed files with 3 additions and 1 deletions

View File

@ -55,7 +55,9 @@ static inline void *kmap(struct page *page)
return page_address(page);
}
#define kunmap(page) do { (void) (page); } while (0)
static inline void kunmap(struct page *page)
{
}
static inline void *kmap_atomic(struct page *page, enum km_type idx)
{