[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20090514161144.GT15360@parisc-linux.org>
Date: Thu, 14 May 2009 10:11:44 -0600
From: Matthew Wilcox <matthew@....cx>
To: Linus Torvalds <torvalds@...l.org>
Cc: David Woodhouse <dwmw2@...radead.org>,
Andrew Morton <akpm@...l.org>, linux-kernel@...r.kernel.org
Subject: [PATCH] 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 <dwmw2@...radead.org>
Signed-off-by: Matthew Wilcox <willy@...ux.intel.com>
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists