Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: add pmd_t initializer __pmd() to work around a GCC bug.

THP migration is added but only supports x86_64 at the moment. For all
other architectures, swp_entry_to_pmd() only returns a zero pmd_t.

Due to a GCC zero initializer bug #53119, the standard (pmd_t){0}
initializer is not accepted by all GCC versions. __pmd() is a feasible
workaround. In addition, sparc32's pmd_t is an array instead of a single
value, so we need (pmd_t){ {0}, } instead of (pmd_t){0}. Thus,
a different __pmd() definition is needed in sparc32.

Signed-off-by: Zi Yan <zi.yan@cs.rutgers.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Zi Yan and committed by
David S. Miller
9157259d 26273939

+2
+2
arch/sparc/include/asm/page_32.h
··· 68 68 #define iopgprot_val(x) ((x).iopgprot) 69 69 70 70 #define __pte(x) ((pte_t) { (x) } ) 71 + #define __pmd(x) ((pmd_t) { { (x) }, }) 71 72 #define __iopte(x) ((iopte_t) { (x) } ) 72 73 #define __pgd(x) ((pgd_t) { (x) } ) 73 74 #define __ctxd(x) ((ctxd_t) { (x) } ) ··· 96 95 #define iopgprot_val(x) (x) 97 96 98 97 #define __pte(x) (x) 98 + #define __pmd(x) ((pmd_t) { { (x) }, }) 99 99 #define __iopte(x) (x) 100 100 #define __pgd(x) (x) 101 101 #define __ctxd(x) (x)