Correct build warnings with CONFIG_TRANSPARENT_HUGEPAGE disabled
PATCH 1/1 Correct build warnings with CONFIG_TRANSPARENT_HUGEPAGE disabled
Building with CONFIG_TRANSPARENT_HUGEPAGE disabled causes the following build wearnings;
powerpc/arch/powerpc/include/asm/mmu-hash64.h: In function ‘__hash_page_thp’:powerpc/arch/powerpc/include/asm/mmu-hash64.h:354: warning: no return statement in function returning non-void
This patch adds a return -1 to the static inline for __hash_page_thp() to correct the warnings.
--- arch/powerpc/include/asm/mmu-hash64.h | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/include/asm/mmu-hash64.h +1 -0
@@ -351,6 +351,7 @@ int ssize, unsigned int psize) {BUG (); +return -1 ; }#endif extern void hash_failure_debug(unsigned long ea, unsigned long access,
Quoted 4 lines · Nathan Fontenot
Building with
CONFIG_TRANSPARENT_HUGEPAGEdisabled causes the following build wearnings;
powerpc/arch/powerpc/include/asm/mmu-hash64.h: In function =E2=80=98__has=
h_page_thp=E2=80=99:
Quoted 1 line
powerpc/arch/powerpc/include/asm/mmu-hash64.h:354: warning: no return sta=
tement in function returning non-void
Quoted 5 lines
This patch adds a return -1 to the static inline for
__hash_page_thp()to correct the warnings.Signed-off-by Nathan Fontenot <[email protected]>
Wondering why i am not finding this
[root@llmp24l02 thp]# make arch/powerpc/mm/hash_utils_64.o
....
.....
CC arch/powerpc/mm/hash_utils_64.o
[root@llmp24l02 thp]# grep TRANSPARENT_HUGEPAGE .config CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=3Dy
# CONFIG_TRANSPARENT_HUGEPAGE is not set
[root@llmp24l02 thp]#=20
[root@llmp24l02 thp]# gcc --version
gcc (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Quoted 6 lines
--- arch/powerpc/include/asm/mmu-hash64.h | 1 + 1 file changed, 1 insertion(+)Index:
powerpc/arch/powerpc/include/asm/mmu-hash64.h=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Quoted 1 line
---
powerpc.orig/arch/powerpc/include/asm/mmu-hash64.h2013-06-24 07:54:0=
8.000000000 -0500
Quoted 1 line
+++
powerpc/arch/powerpc/include/asm/mmu-hash64.h2013-06-24 08:07:56.000=
000000 -0500
Quoted 8 lines
arch/powerpc/include/asm/mmu-hash64.h +1
-0@@ -351,6 +351,7 @@ int ssize, unsigned int psize) {BUG (); +return -1 ; }#endif extern void hash_failure_debug(unsigned long ea, unsigned long access,
Quoted 6 lines · Aneesh Kumar K.V
Quoted 4 lines · Nathan Fontenot
Building with
CONFIG_TRANSPARENT_HUGEPAGEdisabled causes the following build wearnings;
powerpc/arch/powerpc/include/asm/mmu-hash64.h: In function =E2=80=98__ha=
sh_page_thp=E2=80=99:
Quoted 1 line
Quoted 1 line
powerpc/arch/powerpc/include/asm/mmu-hash64.h:354: warning: no return st=
atement in function returning non-void
Quoted 10 lines
Quoted 5 lines
This patch adds a return -1 to the static inline for
__hash_page_thp()to correct the warnings.Signed-off-by Nathan Fontenot <[email protected]>Reviewed-by Aneesh Kumar K.V <[email protected]>Wondering why i am not finding this
Quoted 13 lines
[root@llmp24l02 thp]# make
arch/powerpc/mm/hash_utils_64.o
....
.....
CCarch/powerpc/mm/hash_utils_64.o
[root@llmp24l02 thp]# grepTRANSPARENT_HUGEPAGE.configCONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=3Dy
#CONFIG_TRANSPARENT_HUGEPAGEis not set
[root@llmp24l02 thp]#=20
[root@llmp24l02 thp]# gcc --version
gcc (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOS=
E.
Quoted 2 lines
new compilers have __builtin_unreachable in BUG. That is why it didn't trigger for me.=20
new compiler:
_____________
static inline __attribute__((always_inline)) __attribute__((no_instrument_f= unction)) int __hash_page_thp(unsigned long ea, unsigned long access,
unsigned long vsid, pmd_t *pmdp,
unsigned long trap, int local,
int ssize, unsigned int psize)
{
do { __asm__ __volatile__( "1: twi 31,0,0\n" ".section __bug_table,\"a\"\n=
" "2:\t" ".llong" " " "1b, %0\n" "\t.short %1, %2\n" ".org 2b+%3\n" ".previ= ous\n" : : "i" ("/home/opensource/sources/kernels/linux-powerpc/arch/powerp= c/include/asm/mmu-hash64.h"), "i" (353), "i" (0), "i" (sizeof(struct bug_en= try))); __builtin_unreachable(); } while (0);
}
failure:
__________
static inline __attribute__((always_inline)) __attribute__((no_instrument_f= unction)) int __hash_page_thp(unsigned long ea, unsigned long access,
unsigned long vsid, pmd_t *pmdp,
unsigned long trap, int local,
int ssize, unsigned int psize)
{
do { __asm__ __volatile__( "1: twi 31,0,0\n" ".section __bug_table,\"a\"\n=
" "2:\t" ".llong" " " "1b, %0\n" "\t.short %1, %2\n" ".org 2b+%3\n" ".previ= ous\n" : : "i" ("/home/nfont/src/powerpc/arch/powerpc/include/asm/mmu-hash6= 4.h"), "i" (353), "i" (0), "i" (sizeof(struct bug_entry))); do { } while (1= ); } while (0);
}
-aneesh
PiBmYWlsdXJlOg0KPiBfX19fX19fX19fDQo+IHN0YXRpYyBpbmxpbmUgX19hdHRyaWJ1dGVfXygo YWx3YXlzX2lubGluZSkpIF9fYXR0cmlidXRlX18oKG5vX2luc3RydW1lbnRfZnVuY3Rpb24pKSBp bnQNCj4gX19oYXNoX3BhZ2VfdGhwKHVuc2lnbmVkIGxvbmcgZWEsIHVuc2lnbmVkIGxvbmcgYWNj ZXNzL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