aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/kbuild/makefiles.txt94
-rw-r--r--scripts/coccinelle/misc/simple_return.cocci180
-rwxr-xr-xscripts/package/builddeb26
-rwxr-xr-xscripts/tags.sh10
4 files changed, 228 insertions, 82 deletions
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 764f5991a3fc..a311db829e9b 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -174,7 +174,7 @@ more details, with real examples.
174 174
175--- 3.3 Loadable module goals - obj-m 175--- 3.3 Loadable module goals - obj-m
176 176
177 $(obj-m) specify object files which are built as loadable 177 $(obj-m) specifies object files which are built as loadable
178 kernel modules. 178 kernel modules.
179 179
180 A module may be built from one source file or several source 180 A module may be built from one source file or several source
@@ -277,7 +277,7 @@ more details, with real examples.
277 down in the ext2 directory. 277 down in the ext2 directory.
278 Kbuild only uses this information to decide that it needs to visit 278 Kbuild only uses this information to decide that it needs to visit
279 the directory, it is the Makefile in the subdirectory that 279 the directory, it is the Makefile in the subdirectory that
280 specifies what is modules and what is built-in. 280 specifies what is modular and what is built-in.
281 281
282 It is good practice to use a CONFIG_ variable when assigning directory 282 It is good practice to use a CONFIG_ variable when assigning directory
283 names. This allows kbuild to totally skip the directory if the 283 names. This allows kbuild to totally skip the directory if the
@@ -403,7 +403,7 @@ more details, with real examples.
403 echoing information to user in a rule is often a good practice 403 echoing information to user in a rule is often a good practice
404 but when execution "make -s" one does not expect to see any output 404 but when execution "make -s" one does not expect to see any output
405 except for warnings/errors. 405 except for warnings/errors.
406 To support this kbuild define $(kecho) which will echo out the 406 To support this kbuild defines $(kecho) which will echo out the
407 text following $(kecho) to stdout except if "make -s" is used. 407 text following $(kecho) to stdout except if "make -s" is used.
408 408
409 Example: 409 Example:
@@ -417,7 +417,7 @@ more details, with real examples.
417 417
418 The kernel may be built with several different versions of 418 The kernel may be built with several different versions of
419 $(CC), each supporting a unique set of features and options. 419 $(CC), each supporting a unique set of features and options.
420 kbuild provide basic support to check for valid options for $(CC). 420 kbuild provides basic support to check for valid options for $(CC).
421 $(CC) is usually the gcc compiler, but other alternatives are 421 $(CC) is usually the gcc compiler, but other alternatives are
422 available. 422 available.
423 423
@@ -456,8 +456,8 @@ more details, with real examples.
456 Note: as-instr-option uses KBUILD_AFLAGS for $(AS) options 456 Note: as-instr-option uses KBUILD_AFLAGS for $(AS) options
457 457
458 cc-option 458 cc-option
459 cc-option is used to check if $(CC) supports a given option, and not 459 cc-option is used to check if $(CC) supports a given option, and if
460 supported to use an optional second option. 460 not supported to use an optional second option.
461 461
462 Example: 462 Example:
463 #arch/x86/Makefile 463 #arch/x86/Makefile
@@ -557,8 +557,8 @@ more details, with real examples.
557 false ; \ 557 false ; \
558 fi 558 fi
559 559
560 In this example for a specific GCC version the build will error out explaining 560 In this example for a specific GCC version the build will error out
561 to the user why it stops. 561 explaining to the user why it stops.
562 562
563 cc-cross-prefix 563 cc-cross-prefix
564 cc-cross-prefix is used to check if there exists a $(CC) in path with 564 cc-cross-prefix is used to check if there exists a $(CC) in path with
@@ -656,7 +656,7 @@ Both possibilities are described in the following.
656 In the example above the executable is composed of the C++ file 656 In the example above the executable is composed of the C++ file
657 qconf.cc - identified by $(qconf-cxxobjs). 657 qconf.cc - identified by $(qconf-cxxobjs).
658 658
659 If qconf is composed by a mixture of .c and .cc files, then an 659 If qconf is composed of a mixture of .c and .cc files, then an
660 additional line can be used to identify this. 660 additional line can be used to identify this.
661 661
662 Example: 662 Example:
@@ -733,7 +733,7 @@ Both possibilities are described in the following.
733 hostprogs-$(CONFIG_KALLSYMS) += kallsyms 733 hostprogs-$(CONFIG_KALLSYMS) += kallsyms
734 734
735 Kbuild knows about both 'y' for built-in and 'm' for module. 735 Kbuild knows about both 'y' for built-in and 'm' for module.
736 So if a config symbol evaluate to 'm', kbuild will still build 736 So if a config symbol evaluates to 'm', kbuild will still build
737 the binary. In other words, Kbuild handles hostprogs-m exactly 737 the binary. In other words, Kbuild handles hostprogs-m exactly
738 like hostprogs-y. But only hostprogs-y is recommended to be used 738 like hostprogs-y. But only hostprogs-y is recommended to be used
739 when no CONFIG symbols are involved. 739 when no CONFIG symbols are involved.
@@ -754,8 +754,8 @@ Additional files can be specified in kbuild makefiles by use of $(clean-files).
754 #drivers/pci/Makefile 754 #drivers/pci/Makefile
755 clean-files := devlist.h classlist.h 755 clean-files := devlist.h classlist.h
756 756
757When executing "make clean", the two files "devlist.h classlist.h" will 757When executing "make clean", the two files "devlist.h classlist.h" will be
758be deleted. Kbuild will assume files to be in same relative directory as the 758deleted. Kbuild will assume files to be in the same relative directory as the
759Makefile except if an absolute path is specified (path starting with '/'). 759Makefile except if an absolute path is specified (path starting with '/').
760 760
761To delete a directory hierarchy use: 761To delete a directory hierarchy use:
@@ -786,7 +786,7 @@ is not sufficient this sometimes needs to be explicit.
786The above assignment instructs kbuild to descend down in the 786The above assignment instructs kbuild to descend down in the
787directory compressed/ when "make clean" is executed. 787directory compressed/ when "make clean" is executed.
788 788
789To support the clean infrastructure in the Makefiles that builds the 789To support the clean infrastructure in the Makefiles that build the
790final bootimage there is an optional target named archclean: 790final bootimage there is an optional target named archclean:
791 791
792 Example: 792 Example:
@@ -818,17 +818,16 @@ a few targets.
818When kbuild executes, the following steps are followed (roughly): 818When kbuild executes, the following steps are followed (roughly):
8191) Configuration of the kernel => produce .config 8191) Configuration of the kernel => produce .config
8202) Store kernel version in include/linux/version.h 8202) Store kernel version in include/linux/version.h
8213) Symlink include/asm to include/asm-$(ARCH) 8213) Updating all other prerequisites to the target prepare:
8224) Updating all other prerequisites to the target prepare:
823 - Additional prerequisites are specified in arch/$(ARCH)/Makefile 822 - Additional prerequisites are specified in arch/$(ARCH)/Makefile
8245) Recursively descend down in all directories listed in 8234) Recursively descend down in all directories listed in
825 init-* core* drivers-* net-* libs-* and build all targets. 824 init-* core* drivers-* net-* libs-* and build all targets.
826 - The values of the above variables are expanded in arch/$(ARCH)/Makefile. 825 - The values of the above variables are expanded in arch/$(ARCH)/Makefile.
8276) All object files are then linked and the resulting file vmlinux is 8265) All object files are then linked and the resulting file vmlinux is
828 located at the root of the obj tree. 827 located at the root of the obj tree.
829 The very first objects linked are listed in head-y, assigned by 828 The very first objects linked are listed in head-y, assigned by
830 arch/$(ARCH)/Makefile. 829 arch/$(ARCH)/Makefile.
8317) Finally, the architecture-specific part does any required post processing 8306) Finally, the architecture-specific part does any required post processing
832 and builds the final bootimage. 831 and builds the final bootimage.
833 - This includes building boot records 832 - This includes building boot records
834 - Preparing initrd images and the like 833 - Preparing initrd images and the like
@@ -927,7 +926,7 @@ When kbuild executes, the following steps are followed (roughly):
927 926
928 KBUILD_AFLAGS_MODULE Options for $(AS) when building modules 927 KBUILD_AFLAGS_MODULE Options for $(AS) when building modules
929 928
930 $(KBUILD_AFLAGS_MODULE) is used to add arch specific options that 929 $(KBUILD_AFLAGS_MODULE) is used to add arch-specific options that
931 are used for $(AS). 930 are used for $(AS).
932 From commandline AFLAGS_MODULE shall be used (see kbuild.txt). 931 From commandline AFLAGS_MODULE shall be used (see kbuild.txt).
933 932
@@ -938,13 +937,13 @@ When kbuild executes, the following steps are followed (roughly):
938 937
939 KBUILD_CFLAGS_MODULE Options for $(CC) when building modules 938 KBUILD_CFLAGS_MODULE Options for $(CC) when building modules
940 939
941 $(KBUILD_CFLAGS_MODULE) is used to add arch specific options that 940 $(KBUILD_CFLAGS_MODULE) is used to add arch-specific options that
942 are used for $(CC). 941 are used for $(CC).
943 From commandline CFLAGS_MODULE shall be used (see kbuild.txt). 942 From commandline CFLAGS_MODULE shall be used (see kbuild.txt).
944 943
945 KBUILD_LDFLAGS_MODULE Options for $(LD) when linking modules 944 KBUILD_LDFLAGS_MODULE Options for $(LD) when linking modules
946 945
947 $(KBUILD_LDFLAGS_MODULE) is used to add arch specific options 946 $(KBUILD_LDFLAGS_MODULE) is used to add arch-specific options
948 used when linking modules. This is often a linker script. 947 used when linking modules. This is often a linker script.
949 From commandline LDFLAGS_MODULE shall be used (see kbuild.txt). 948 From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).
950 949
@@ -1066,7 +1065,7 @@ When kbuild executes, the following steps are followed (roughly):
1066 1065
1067 extra-y 1066 extra-y
1068 1067
1069 extra-y specify additional targets created in the current 1068 extra-y specifies additional targets created in the current
1070 directory, in addition to any targets specified by obj-*. 1069 directory, in addition to any targets specified by obj-*.
1071 1070
1072 Listing all targets in extra-y is required for two purposes: 1071 Listing all targets in extra-y is required for two purposes:
@@ -1093,7 +1092,7 @@ When kbuild executes, the following steps are followed (roughly):
1093 1092
1094 Usage: 1093 Usage:
1095 target: source(s) FORCE 1094 target: source(s) FORCE
1096 $(call if_changed,ld/objcopy/gzip) 1095 $(call if_changed,ld/objcopy/gzip/...)
1097 1096
1098 When the rule is evaluated, it is checked to see if any files 1097 When the rule is evaluated, it is checked to see if any files
1099 need an update, or the command line has changed since the last 1098 need an update, or the command line has changed since the last
@@ -1111,7 +1110,7 @@ When kbuild executes, the following steps are followed (roughly):
1111 significant; for instance, the below will fail (note the extra space 1110 significant; for instance, the below will fail (note the extra space
1112 after the comma): 1111 after the comma):
1113 target: source(s) FORCE 1112 target: source(s) FORCE
1114 #WRONG!# $(call if_changed, ld/objcopy/gzip) 1113 #WRONG!# $(call if_changed, ld/objcopy/gzip/...)
1115 1114
1116 ld 1115 ld
1117 Link target. Often, LDFLAGS_$@ is used to set specific options to ld. 1116 Link target. Often, LDFLAGS_$@ is used to set specific options to ld.
@@ -1142,8 +1141,8 @@ When kbuild executes, the following steps are followed (roughly):
1142 2) delete target during make clean 1141 2) delete target during make clean
1143 1142
1144 The ": %: %.o" part of the prerequisite is a shorthand that 1143 The ": %: %.o" part of the prerequisite is a shorthand that
1145 free us from listing the setup.o and bootsect.o files. 1144 frees us from listing the setup.o and bootsect.o files.
1146 Note: It is a common mistake to forget the "target :=" assignment, 1145 Note: It is a common mistake to forget the "targets :=" assignment,
1147 resulting in the target file being recompiled for no 1146 resulting in the target file being recompiled for no
1148 obvious reason. 1147 obvious reason.
1149 1148
@@ -1164,29 +1163,6 @@ When kbuild executes, the following steps are followed (roughly):
1164 clean-files += *.dtb 1163 clean-files += *.dtb
1165 DTC_FLAGS ?= -p 1024 1164 DTC_FLAGS ?= -p 1024
1166 1165
1167 dtc_cpp
1168 This is just like dtc as describe above, except that the C pre-
1169 processor is invoked upon the .dtsp file before compiling the result
1170 with dtc.
1171
1172 In order for build dependencies to work, all files compiled using
1173 dtc_cpp must use the C pre-processor's #include functionality and not
1174 dtc's /include/ functionality.
1175
1176 Using the C pre-processor allows use of #define to create named
1177 constants. In turn, the #defines will typically appear in a header
1178 file, which may be shared with regular C code. Since the dtc language
1179 represents a data structure rather than code in C syntax, similar
1180 restrictions are placed on a header file included by a device tree
1181 file as for a header file included by an assembly language file.
1182 In particular, the C pre-processor is passed -x assembler-with-cpp,
1183 which sets macro __ASSEMBLY__. __DTS__ is also set. These allow header
1184 files to restrict their content to that compatible with device tree
1185 source.
1186
1187 A central rule exists to create $(obj)/%.dtb from $(src)/%.dtsp;
1188 architecture Makefiles do no need to explicitly write out that rule.
1189
1190--- 6.8 Custom kbuild commands 1166--- 6.8 Custom kbuild commands
1191 1167
1192 When kbuild is executing with KBUILD_VERBOSE=0, then only a shorthand 1168 When kbuild is executing with KBUILD_VERBOSE=0, then only a shorthand
@@ -1237,11 +1213,11 @@ When kbuild executes, the following steps are followed (roughly):
1237 When building the *.lds target, kbuild uses the variables: 1213 When building the *.lds target, kbuild uses the variables:
1238 KBUILD_CPPFLAGS : Set in top-level Makefile 1214 KBUILD_CPPFLAGS : Set in top-level Makefile
1239 cppflags-y : May be set in the kbuild makefile 1215 cppflags-y : May be set in the kbuild makefile
1240 CPPFLAGS_$(@F) : Target specific flags. 1216 CPPFLAGS_$(@F) : Target-specific flags.
1241 Note that the full filename is used in this 1217 Note that the full filename is used in this
1242 assignment. 1218 assignment.
1243 1219
1244 The kbuild infrastructure for *lds file are used in several 1220 The kbuild infrastructure for *lds files is used in several
1245 architecture-specific files. 1221 architecture-specific files.
1246 1222
1247--- 6.10 Generic header files 1223--- 6.10 Generic header files
@@ -1254,11 +1230,11 @@ When kbuild executes, the following steps are followed (roughly):
1254 1230
1255=== 7 Kbuild syntax for exported headers 1231=== 7 Kbuild syntax for exported headers
1256 1232
1257The kernel include a set of headers that is exported to userspace. 1233The kernel includes a set of headers that is exported to userspace.
1258Many headers can be exported as-is but other headers require a 1234Many headers can be exported as-is but other headers require a
1259minimal pre-processing before they are ready for user-space. 1235minimal pre-processing before they are ready for user-space.
1260The pre-processing does: 1236The pre-processing does:
1261- drop kernel specific annotations 1237- drop kernel-specific annotations
1262- drop include of compiler.h 1238- drop include of compiler.h
1263- drop all sections that are kernel internal (guarded by ifdef __KERNEL__) 1239- drop all sections that are kernel internal (guarded by ifdef __KERNEL__)
1264 1240
@@ -1268,7 +1244,7 @@ See subsequent chapter for the syntax of the Kbuild file.
1268 1244
1269 --- 7.1 header-y 1245 --- 7.1 header-y
1270 1246
1271 header-y specify header files to be exported. 1247 header-y specifies header files to be exported.
1272 1248
1273 Example: 1249 Example:
1274 #include/linux/Kbuild 1250 #include/linux/Kbuild
@@ -1278,7 +1254,7 @@ See subsequent chapter for the syntax of the Kbuild file.
1278 The convention is to list one file per line and 1254 The convention is to list one file per line and
1279 preferably in alphabetic order. 1255 preferably in alphabetic order.
1280 1256
1281 header-y also specify which subdirectories to visit. 1257 header-y also specifies which subdirectories to visit.
1282 A subdirectory is identified by a trailing '/' which 1258 A subdirectory is identified by a trailing '/' which
1283 can be seen in the example above for the usb subdirectory. 1259 can be seen in the example above for the usb subdirectory.
1284 1260
@@ -1296,9 +1272,9 @@ See subsequent chapter for the syntax of the Kbuild file.
1296 1272
1297 --- 7.3 destination-y 1273 --- 7.3 destination-y
1298 1274
1299 When an architecture have a set of exported headers that needs to be 1275 When an architecture has a set of exported headers that needs to be
1300 exported to a different directory destination-y is used. 1276 exported to a different directory destination-y is used.
1301 destination-y specify the destination directory for all exported 1277 destination-y specifies the destination directory for all exported
1302 headers in the file where it is present. 1278 headers in the file where it is present.
1303 1279
1304 Example: 1280 Example:
@@ -1391,9 +1367,9 @@ The top Makefile exports the following variables:
1391 1367
1392 INSTALL_MOD_STRIP 1368 INSTALL_MOD_STRIP
1393 1369
1394 If this variable is specified, will cause modules to be stripped 1370 If this variable is specified, it will cause modules to be stripped
1395 after they are installed. If INSTALL_MOD_STRIP is '1', then the 1371 after they are installed. If INSTALL_MOD_STRIP is '1', then the
1396 default option --strip-debug will be used. Otherwise, 1372 default option --strip-debug will be used. Otherwise, the
1397 INSTALL_MOD_STRIP value will be used as the option(s) to the strip 1373 INSTALL_MOD_STRIP value will be used as the option(s) to the strip
1398 command. 1374 command.
1399 1375
diff --git a/scripts/coccinelle/misc/simple_return.cocci b/scripts/coccinelle/misc/simple_return.cocci
new file mode 100644
index 000000000000..47f7084b6360
--- /dev/null
+++ b/scripts/coccinelle/misc/simple_return.cocci
@@ -0,0 +1,180 @@
1/// Simplify a trivial if-return sequence. Possibly combine with a
2/// preceding function call.
3//
4// Confidence: High
5// Copyright: (C) 2014 Julia Lawall, INRIA/LIP6. GPLv2.
6// Copyright: (C) 2014 Gilles Muller, INRIA/LiP6. GPLv2.
7// URL: http://coccinelle.lip6.fr/
8// Comments:
9// Options: --no-includes --include-headers
10
11virtual patch
12virtual context
13virtual org
14virtual report
15
16@r depends on patch@
17local idexpression e;
18identifier i,f,fn;
19@@
20
21fn(...) { <...
22- e@i =
23+ return
24 f(...);
25-if (i != 0) return i;
26-return 0;
27...> }
28
29@depends on patch@
30identifier r.i;
31type t;
32@@
33
34-t i;
35 ... when != i
36
37@depends on patch@
38expression e;
39@@
40
41-if (e != 0)
42 return e;
43-return 0;
44
45// -----------------------------------------------------------------------
46
47@s1 depends on context || org || report@
48local idexpression e;
49identifier i,f,fn;
50position p,p1,p2;
51@@
52
53fn(...) { <...
54* e@i@p = f(...);
55 if (\(i@p1 != 0\|i@p2 < 0\))
56 return i;
57 return 0;
58...> }
59
60@s2 depends on context || org || report forall@
61identifier s1.i;
62type t;
63position q,s1.p;
64expression e,f;
65@@
66
67* t i@q;
68 ... when != i
69 e@p = f(...);
70
71@s3 depends on context || org || report@
72expression e;
73position p1!=s1.p1;
74position p2!=s1.p2;
75@@
76
77*if (\(e@p1 != 0\|e@p2 < 0\))
78 return e;
79 return 0;
80
81// -----------------------------------------------------------------------
82
83@script:python depends on org@
84p << s1.p;
85p1 << s1.p1;
86q << s2.q;
87@@
88
89cocci.print_main("decl",q)
90cocci.print_secs("use",p)
91cocci.include_match(False)
92
93@script:python depends on org@
94p << s1.p;
95p2 << s1.p2;
96q << s2.q;
97@@
98
99cocci.print_main("decl",q)
100cocci.print_secs("use with questionable test",p)
101cocci.include_match(False)
102
103@script:python depends on org@
104p << s1.p;
105p1 << s1.p1;
106@@
107
108cocci.print_main("use",p)
109
110@script:python depends on org@
111p << s1.p;
112p2 << s1.p2;
113@@
114
115cocci.print_main("use with questionable test",p)
116
117@script:python depends on org@
118p << s3.p1;
119@@
120
121cocci.print_main("test",p)
122
123@script:python depends on org@
124p << s3.p2;
125@@
126
127cocci.print_main("questionable test",p)
128
129// -----------------------------------------------------------------------
130
131@script:python depends on report@
132p << s1.p;
133p1 << s1.p1;
134q << s2.q;
135@@
136
137msg = "WARNING: end returns can be simpified and declaration on line %s can be dropped" % (q[0].line)
138coccilib.report.print_report(p[0],msg)
139cocci.include_match(False)
140
141@script:python depends on report@
142p << s1.p;
143p1 << s1.p1;
144q << s2.q
145;
146@@
147
148msg = "WARNING: end returns may be simpified if negative or 0 value and declaration on line %s can be dropped" % (q[0].line)
149coccilib.report.print_report(p[0],msg)
150cocci.include_match(False)
151
152@script:python depends on report@
153p << s1.p;
154p1 << s1.p1;
155@@
156
157msg = "WARNING: end returns can be simpified"
158coccilib.report.print_report(p[0],msg)
159
160@script:python depends on report@
161p << s1.p;
162p2 << s1.p2;
163@@
164
165msg = "WARNING: end returns can be simpified if negative or 0 value"
166coccilib.report.print_report(p[0],msg)
167
168@script:python depends on report@
169p << s3.p1;
170@@
171
172msg = "WARNING: end returns can be simpified"
173coccilib.report.print_report(p[0],msg)
174
175@script:python depends on report@
176p << s3.p2;
177@@
178
179msg = "WARNING: end returns can be simpified if tested value is negative or 0"
180coccilib.report.print_report(p[0],msg)
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 35d5a5877d04..59726243c2eb 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -37,7 +37,7 @@ create_package() {
37 s390*) 37 s390*)
38 debarch=s390$(grep -q CONFIG_64BIT=y $KCONFIG_CONFIG && echo x || true) ;; 38 debarch=s390$(grep -q CONFIG_64BIT=y $KCONFIG_CONFIG && echo x || true) ;;
39 ppc*) 39 ppc*)
40 debarch=powerpc ;; 40 debarch=$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo ppc64el || echo powerpc) ;;
41 parisc*) 41 parisc*)
42 debarch=hppa ;; 42 debarch=hppa ;;
43 mips*) 43 mips*)
@@ -64,7 +64,7 @@ create_package() {
64 fi 64 fi
65 65
66 # Create the package 66 # Create the package
67 dpkg-gencontrol -isp $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir" 67 dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir"
68 dpkg --build "$pdir" .. 68 dpkg --build "$pdir" ..
69} 69}
70 70
@@ -152,18 +152,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
152 rmdir "$tmpdir/lib/modules/$version" 152 rmdir "$tmpdir/lib/modules/$version"
153 fi 153 fi
154 if [ -n "$BUILD_DEBUG" ] ; then 154 if [ -n "$BUILD_DEBUG" ] ; then
155 ( 155 for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do
156 cd $tmpdir 156 module=lib/modules/$module
157 for module in $(find lib/modules/ -name *.ko); do 157 mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
158 mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module) 158 # only keep debug symbols in the debug file
159 # only keep debug symbols in the debug file 159 $OBJCOPY --only-keep-debug $tmpdir/$module $dbg_dir/usr/lib/debug/$module
160 $OBJCOPY --only-keep-debug $module $dbg_dir/usr/lib/debug/$module 160 # strip original module from debug symbols
161 # strip original module from debug symbols 161 $OBJCOPY --strip-debug $tmpdir/$module
162 $OBJCOPY --strip-debug $module 162 # then add a link to those
163 # then add a link to those 163 $OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $tmpdir/$module
164 $OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module 164 done
165 done
166 )
167 fi 165 fi
168fi 166fi
169 167
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 293828bfd4ac..cdb491d84503 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -193,10 +193,6 @@ exuberant()
193 --regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \ 193 --regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
194 --regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \ 194 --regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \
195 --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \ 195 --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \
196 --regex-c++='/TESTPCGFLAG\(([^,)]*).*/PageCgroup\1/' \
197 --regex-c++='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/' \
198 --regex-c++='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/' \
199 --regex-c++='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \
200 --regex-c++='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \ 196 --regex-c++='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \
201 --regex-c++='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \ 197 --regex-c++='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \
202 --regex-c++='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/'\ 198 --regex-c++='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/'\
@@ -259,17 +255,13 @@ emacs()
259 --regex='/__CLEARPAGEFLAG_NOOP(\([^,)]*\).*/__ClearPage\1/' \ 255 --regex='/__CLEARPAGEFLAG_NOOP(\([^,)]*\).*/__ClearPage\1/' \
260 --regex='/TESTCLEARFLAG_FALSE(\([^,)]*\).*/TestClearPage\1/' \ 256 --regex='/TESTCLEARFLAG_FALSE(\([^,)]*\).*/TestClearPage\1/' \
261 --regex='/__TESTCLEARFLAG_FALSE(\([^,)]*\).*/__TestClearPage\1/' \ 257 --regex='/__TESTCLEARFLAG_FALSE(\([^,)]*\).*/__TestClearPage\1/' \
262 --regex='/TESTPCGFLAG\(([^,)]*).*/PageCgroup\1/' \
263 --regex='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/' \
264 --regex='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/' \
265 --regex='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \
266 --regex='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \ 258 --regex='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \
267 --regex='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \ 259 --regex='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \
268 --regex='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/' \ 260 --regex='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/' \
269 --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' \ 261 --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' \
270 --regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \ 262 --regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \
271 --regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'\ 263 --regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'\
272 --regex='/DEFINE_HASHTABLE\((\w*)/\1/v/' 264 --regex='/[^#]*DEFINE_HASHTABLE(\([^,)]*\)/\1/'
273 265
274 all_kconfigs | xargs $1 -a \ 266 all_kconfigs | xargs $1 -a \
275 --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/' 267 --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'