Skip to content

Commit 760ee8f

Browse files
sulixrichardweinberger
authored andcommitted
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>
1 parent 11ae290 commit 760ee8f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/asm-generic/current.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
#ifndef __ASM_GENERIC_CURRENT_H
33
#define __ASM_GENERIC_CURRENT_H
44

5+
#ifndef __ASSEMBLY__
56
#include <linux/thread_info.h>
67

78
#define get_current() (current_thread_info()->task)
89
#define current get_current()
10+
#endif
911

1012
#endif /* __ASM_GENERIC_CURRENT_H */

0 commit comments

Comments
 (0)