summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Kbuild12
-rw-r--r--arch/ia64/kernel/Makefile8
-rw-r--r--arch/um/Makefile2
-rw-r--r--arch/x86/um/shared/sysdep/kernel-offsets.h2
-rw-r--r--arch/x86/um/user-offsets.c4
-rw-r--r--include/linux/kbuild.h2
-rw-r--r--scripts/mod/Makefile11
7 files changed, 8 insertions, 33 deletions
diff --git a/Kbuild b/Kbuild
index 3d0ae152af7c..63fc0e132bdc 100644
--- a/Kbuild
+++ b/Kbuild
@@ -7,14 +7,6 @@
# 4) Check for missing system calls
# 5) Generate constants.py (may need bounds.h)
-# Default sed regexp - multiline due to syntax constraints
-define sed-y
- "/^->/{s:->#\(.*\):/* \1 */:; \
- s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
- s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
- s:->::; p;}"
-endef
-
# Use filechk to avoid rebuilds when a header changes, but the resulting file
# does not
define filechk_offsets
@@ -26,9 +18,7 @@ define filechk_offsets
echo " *"; \
echo " * This file was generated by Kbuild"; \
echo " */"; \
- echo ""; \
- sed -ne $(sed-y); \
- echo ""; \
+ sed -ne '/#define/{s/\$$//;s/#//2;s/$$/*\//;p;}'; \
echo "#endif" )
endef
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index 3686d6abafde..853a5aca9389 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -50,10 +50,6 @@ CFLAGS_traps.o += -mfixed-range=f2-f5,f16-f31
# The gate DSO image is built using a special linker script.
include $(src)/Makefile.gate
-# Calculate NR_IRQ = max(IA64_NATIVE_NR_IRQS, XEN_NR_IRQS, ...) based on config
-define sed-y
- "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
-endef
quiet_cmd_nr_irqs = GEN $@
define cmd_nr_irqs
(set -e; \
@@ -65,9 +61,7 @@ define cmd_nr_irqs
echo " * This file was generated by Kbuild"; \
echo " *"; \
echo " */"; \
- echo ""; \
- sed -ne $(sed-y) $<; \
- echo ""; \
+ sed -ne '/#define/{s/\$$//;s/#//2;s/$$/*\//p;}' $<; \
echo "#endif" ) > $@
endef
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 0ca46ededfc7..c5069e2811fb 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -158,7 +158,7 @@ define filechk_gen-asm-offsets
echo " *"; \
echo " */"; \
echo ""; \
- sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
+ sed -ne '/#define/{s/\$$//;s/#//2;s/$$/*\//p;}'; \
echo ""; )
endef
diff --git a/arch/x86/um/shared/sysdep/kernel-offsets.h b/arch/x86/um/shared/sysdep/kernel-offsets.h
index 46a9df99f3c5..462473f6492f 100644
--- a/arch/x86/um/shared/sysdep/kernel-offsets.h
+++ b/arch/x86/um/shared/sysdep/kernel-offsets.h
@@ -5,7 +5,7 @@
#include <asm/mman.h>
#define DEFINE(sym, val) \
- asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+ asm volatile ("#define " #sym " %0 /*" #val :: "i" (val))
#define BLANK() asm volatile("\n->" : : )
diff --git a/arch/x86/um/user-offsets.c b/arch/x86/um/user-offsets.c
index cb3c22370cf5..0f5e25cf7321 100644
--- a/arch/x86/um/user-offsets.c
+++ b/arch/x86/um/user-offsets.c
@@ -21,10 +21,10 @@ static char syscalls[] = {
#endif
#define DEFINE(sym, val) \
- asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+ asm volatile ("#define " #sym " %0 /*" #val :: "i" (val))
#define DEFINE_LONGS(sym, val) \
- asm volatile("\n->" #sym " %0 " #val : : "i" (val/sizeof(unsigned long)))
+ asm volatile ("#define " #sym " %0 /*" #val :: "i" (val / sizeof(unsigned long)))
void foo(void)
{
diff --git a/include/linux/kbuild.h b/include/linux/kbuild.h
index 22a72198c14b..d9015dea55cd 100644
--- a/include/linux/kbuild.h
+++ b/include/linux/kbuild.h
@@ -2,7 +2,7 @@
#define __LINUX_KBUILD_H
#define DEFINE(sym, val) \
- asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+ asm volatile ("#define " #sym " %0 /*" #val :: "i" (val))
#define BLANK() asm volatile("\n->" : : )
diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile
index 19d9bcadc0cc..8257ef422c0a 100644
--- a/scripts/mod/Makefile
+++ b/scripts/mod/Makefile
@@ -7,13 +7,6 @@ modpost-objs := modpost.o file2alias.o sumversion.o
devicetable-offsets-file := devicetable-offsets.h
-define sed-y
- "/^->/{s:->#\(.*\):/* \1 */:; \
- s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
- s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
- s:->::; p;}"
-endef
-
quiet_cmd_offsets = GEN $@
define cmd_offsets
(set -e; \
@@ -25,9 +18,7 @@ define cmd_offsets
echo " * This file was generated by Kbuild"; \
echo " *"; \
echo " */"; \
- echo ""; \
- sed -ne $(sed-y) $<; \
- echo ""; \
+ sed -ne '/#define/{s/\$$//;s/#//2;s/$$/*\//;p;}' $<; \
echo "#endif" ) > $@
endef