OSDN Git Service

asm-generic: current: Don't include thread-info.h if building asm
authorDavid Gow <davidgow@google.com>
Tue, 4 Jul 2023 08:30:21 +0000 (16:30 +0800)
committerRichard Weinberger <richard@nod.at>
Sat, 26 Aug 2023 20:38:49 +0000 (22:38 +0200)
commit760ee8f83825f6b6ee711bb50b61a2e9a89209a0
treed30cb0aea8c8ed3e228fb2944ce1431f521fb68f
parent11ae290ee6b824607cf5a837d1e893442ed0ba88
asm-generic: current: Don't include thread-info.h if building asm

asm/current.h is included by some assembly files (either directly, or
indirectly). This works on some architectures (such as x86), as their
implementation of current.h is careful to not include any C, but the
asm-generic version includes linux/thread-info.h unconditionally, which
leads to errors when either C code or non-asm-compatible preprocessor
directives are included.

Just wrap the contents behind an #ifndef __ASSEMBLY__ to avoid any C
code making its way in.

Signed-off-by: David Gow <davidgow@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
include/asm-generic/current.h