]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: boot: include compiler_attributes.h
authorNick Desaulniers <ndesaulniers@google.com>
Mon, 16 Nov 2020 04:35:30 +0000 (20:35 -0800)
committerGustavo A. R. Silva <gustavoars@kernel.org>
Wed, 18 Nov 2020 20:02:13 +0000 (14:02 -0600)
commit575d553a25f31e24123ae70097ab1d1990834872
tree97e5197e4316cd4abc5830ed1b29efe84a4505bd
parent52303c159aaf2219cfa60dd0f7bf7c06a1d70995
powerpc: boot: include compiler_attributes.h

The kernel uses `-include` to include include/linux/compiler_types.h
into all translation units (see scripts/Makefile.lib), which #includes
compiler_attributes.h.

arch/powerpc/boot/ uses different compiler flags from the rest of the
kernel. As such, it doesn't contain the definitions from these headers,
and redefines a few that it needs.

For the purpose of enabling -Wimplicit-fallthrough for ppc, include
compiler_attributes.h via `-include`.

It was also noted in 967926f7483b that we could -D__KERNEL__ and
-include compiler_types.h like the main kernel does, though testing that
produces a whole sea of warnings to cleanup. This approach is minimally
invasive. And it also helps to entice a cleanup.

Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://github.com/ClangBuiltLinux/linux/issues/236
[ Gustavo: Massage a bit as per Miguel's suggestion. ]
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
arch/powerpc/boot/Makefile
arch/powerpc/boot/decompress.c