From: Matthew Wilcox Date: Tue, 16 Jun 2009 22:32:45 +0000 (-0700) Subject: mm: check the argument of kunmap on architectures without highmem X-Git-Tag: v2.6.31-rc1~299^2~109 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=31c911329e048b715a1dfeaaf617be9430fd7f4e;p=karo-tx-linux.git 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 Signed-off-by: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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) 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) {