Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31c91132 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds
Browse files

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: default avatarDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarMatthew Wilcox <willy@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 69c85481
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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)
{