OSDN Git Service

powerpc/4xx: Fix compile error with 64K pages on 40x, 44x
authorChristian Lamparter <chunkeey@gmail.com>
Sun, 1 Oct 2017 14:33:03 +0000 (16:33 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 3 Oct 2017 10:59:48 +0000 (21:59 +1100)
commit070e004912fed099263408bf2ff1bbc6926abe2e
treee4e3a80f50c58bdf7841fc7fdbfa703e1993fc20
parent3b7af5c0fd9631762d1c4d7b4cee76f571dd3c2c
powerpc/4xx: Fix compile error with 64K pages on 40x, 44x

The mmu context on the 40x, 44x does not define pte_frag entry. This
causes gcc abort the compilation due to:

  setup-common.c: In function ‘setup_arch’:
  setup-common.c:908: error: ‘mm_context_t’ has no ‘pte_frag’

This patch fixes the issue by removing the pte_frag initialization in
setup-common.c.

This is possible, because the compiler will do the initialization,
since the mm_context is a sub struct of init_mm. init_mm is declared
in mm_types.h as external linkage.

According to C99 6.2.4.3:
  An object whose identifier is declared with external linkage
  [...] has static storage duration.

C99 defines in 6.7.8.10 that:
  If an object that has static storage duration is not
  initialized explicitly, then:
  - if it has pointer type, it is initialized to a null pointer

Fixes: b1923caa6e64 ("powerpc: Merge 32-bit and 64-bit setup_arch()")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/setup-common.c