Skip to content

Commit

Permalink
mm: check the argument of kunmap on architectures without highmem
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthew Wilcox authored and Linus Torvalds committed Jun 17, 2009
1 parent 69c8548 commit 31c9113
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/linux/highmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 31c9113

Please sign in to comment.