]> git.baikalelectronics.ru Git - kernel.git/commit
shmem: Fix link error if huge pages support is disabled
authorGeert Uytterhoeven <geert@linux-m68k.org>
Wed, 3 Aug 2016 17:58:19 +0000 (19:58 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Aug 2016 22:20:12 +0000 (18:20 -0400)
commit16776336c9b01f28a6699b41a30330e2f8cfca08
tree82ddf106f95965a6b70a987134f6e0c2da169cd7
parentb80dbe0899c004b63189a2ac976f3098abb4fa2b
shmem: Fix link error if huge pages support is disabled

If CONFIG_TRANSPARENT_HUGE_PAGECACHE=n, HPAGE_PMD_NR evaluates to
BUILD_BUG_ON(), and may cause (e.g. with gcc 4.12):

    mm/built-in.o: In function `shmem_alloc_hugepage':
    shmem.c:(.text+0x17570): undefined reference to `__compiletime_assert_1365'

To fix this, move the assignment to hindex after the check for huge
pages support.

Fixes: 3325ca8a3e82 ("shmem: add huge pages support")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/shmem.c