Thread (57 messages) flat view 57 messages, 5 authors, 2015-09-30

Re: [PATCH 10/31] powerpc/mm: Don't use pmd_val, pud_val and pgd_val as lvalue

From: Aneesh Kumar K.V <hidden>
Date: 2015-09-22 06:47:04
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

Scott Wood [off-list ref] writes:
On Mon, Sep 21, 2015 at 12:10:37PM +0530, Aneesh Kumar K.V wrote:
quoted
 /* PUD level exusts only on 4k pages */
 #ifndef CONFIG_PPC_64K_PAGES
 typedef struct { unsigned long pud; } pud_t;
-#define pud_val(x)	((x).pud)
 #define __pud(x)	((pud_t) { (x) })
+static inline unsigned long pud_val(pud_t pud)
+{
+	return x.pud;
+}
 #endif /* !CONFIG_PPC_64K_PAGES */
Where does "x" come from in this inline function?

This breaks the build with CONFIG_MM_STRICT_TYPECHECKS.

That should be
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index e555f273716d..31835988c12a 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -311,7 +311,7 @@ static inline unsigned long pmd_val(pmd_t x)
 #ifndef CONFIG_PPC_64K_PAGES
 typedef struct { unsigned long pud; } pud_t;
 #define __pud(x)	((pud_t) { (x) })
-static inline unsigned long pud_val(pud_t pud)
+static inline unsigned long pud_val(pud_t x)
 {
 	return x.pud;
 }


-aneesh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help