Skip to content

Commit

Permalink
Workaround to fix DEFINE() macro error for clang build
Browse files Browse the repository at this point in the history
Signed-off-by: chankruze <chankruze@gmail.com>
  • Loading branch information
chankruze committed May 20, 2019
1 parent 9c9865c commit af41c50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Kbuild
Expand Up @@ -8,7 +8,8 @@

# Default sed regexp - multiline due to syntax constraints
define sed-y
"/^->/{s:->#\(.*\):/* \1 */:; \
"s:[[:space:]]*\.ascii[[:space:]]*\"\(.*\)\":\1:; \
/^->/{s:->#\(.*\):/* \1 */:; \
s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
s:->::; p;}"
Expand Down
6 changes: 3 additions & 3 deletions include/linux/kbuild.h
Expand Up @@ -2,14 +2,14 @@
#define __LINUX_KBUILD_H

#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val))

#define BLANK() asm volatile("\n->" : : )
#define BLANK() asm volatile("\n.ascii \"->\"" : : )

#define OFFSET(sym, str, mem) \
DEFINE(sym, offsetof(struct str, mem))

#define COMMENT(x) \
asm volatile("\n->#" x)
asm volatile("\n.ascii \"->#" x "\"")

#endif

0 comments on commit af41c50

Please sign in to comment.