提交 31c91132 编写于 作者: M Matthew Wilcox 提交者: Linus Torvalds

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: NDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: NMatthew Wilcox <willy@linux.intel.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 69c85481
...@@ -55,7 +55,9 @@ static inline void *kmap(struct page *page) ...@@ -55,7 +55,9 @@ static inline void *kmap(struct page *page)
return page_address(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) static inline void *kmap_atomic(struct page *page, enum km_type idx)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册