[PATCH] Check the argument of kunmap on architectures withouthighmem

From: Matthew Wilcox
Date: Thu May 14 2009 - 12:11:55 EST



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@xxxxxxxxxxxxx>
Signed-off-by: Matthew Wilcox <willy@xxxxxxxxxxxxxxx>

diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 1fcb712..211ff44 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)
{

--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/