parisc: Change kunmap macro to static inline function [Linux 3.9]

This Linux kernel change "parisc: Change kunmap macro to static inline function" is included in the Linux 3.9 release. This change is authored by John David Anglin <dave.anglin [at] bell.net> on Tue Apr 23 00:23:50 2013 +0000. The commit for this change in Linux stable tree is 87be2f8 (patch).

parisc: Change kunmap macro to static inline function

Change kunmap macro to static inline function to fix build error
compiling drivers/base/dma-buf.c.

Without the change, the following error can occur:

   CC      drivers/base/dma-buf.o
drivers/base/dma-buf.c: In function 'dma_buf_kunmap':
drivers/base/dma-buf.c:427:46:
error: macro "kunmap" passed 3 arguments, but takes just 1

I believe parisc is the only arch to implement kunmap using a macro.

Signed-off-by: John David Anglin <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Helge Deller <[email protected]>
Signed-off-by: Helge Deller <[email protected]>

There are 5 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 arch/parisc/include/asm/cacheflush.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h
index 79f694f..f0e2784 100644
--- a/arch/parisc/include/asm/cacheflush.h
+++ b/arch/parisc/include/asm/cacheflush.h
@@ -140,7 +140,10 @@ static inline void *kmap(struct page *page)
    return page_address(page);
 }

-#define kunmap(page)           kunmap_parisc(page_address(page))
+static inline void kunmap(struct page *page)
+{
+   kunmap_parisc(page_address(page));
+}

 static inline void *kmap_atomic(struct page *page)
 {

Leave a Reply

Your email address will not be published. Required fields are marked *