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-Url: https://git.stricted.de/?a=commitdiff_plain;h=31c911329e048b715a1dfeaaf617be9430fd7f4e;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.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 1fcb7126a01..211ff449726 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) {