diff options
author | James Morris <james.morris@microsoft.com> | 2018-09-04 14:35:54 -0400 |
---|---|---|
committer | James Morris <james.morris@microsoft.com> | 2018-09-04 14:35:54 -0400 |
commit | e42f6f9be4f83c537aa81b4c6239ea94ff5b29ce (patch) | |
tree | f956a5ea0e83fc6d0df3e64681e7bbc1f201f3ee /scripts | |
parent | 4408e300a67ab2ce2505087986a9fe922c800ffd (diff) | |
parent | 57361846b52bc686112da6ca5368d11210796804 (diff) |
Merge tag 'v4.19-rc2' into next-general
Sync to Linux 4.19-rc2 for downstream developers.
Diffstat (limited to 'scripts')
67 files changed, 1109 insertions, 825 deletions
diff --git a/scripts/.gitignore b/scripts/.gitignore index 0442c06eefcb..12d302d70128 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore | |||
@@ -1,6 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Generated files | 2 | # Generated files |
3 | # | 3 | # |
4 | bin2c | ||
4 | conmakehash | 5 | conmakehash |
5 | kallsyms | 6 | kallsyms |
6 | pnmtologo | 7 | pnmtologo |
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index c8156d61678c..ce53639a864a 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -56,7 +56,7 @@ kecho := $($(quiet)kecho) | |||
56 | define filechk | 56 | define filechk |
57 | $(Q)set -e; \ | 57 | $(Q)set -e; \ |
58 | mkdir -p $(dir $@); \ | 58 | mkdir -p $(dir $@); \ |
59 | $(filechk_$(1)) < $< > $@.tmp; \ | 59 | $(filechk_$(1)) > $@.tmp; \ |
60 | if [ -r $@ ] && cmp -s $@ $@.tmp; then \ | 60 | if [ -r $@ ] && cmp -s $@ $@.tmp; then \ |
61 | rm -f $@.tmp; \ | 61 | rm -f $@.tmp; \ |
62 | else \ | 62 | else \ |
@@ -126,7 +126,7 @@ cc-option = $(call __cc-option, $(CC),\ | |||
126 | # hostcc-option | 126 | # hostcc-option |
127 | # Usage: cflags-y += $(call hostcc-option,-march=winchip-c6,-march=i586) | 127 | # Usage: cflags-y += $(call hostcc-option,-march=winchip-c6,-march=i586) |
128 | hostcc-option = $(call __cc-option, $(HOSTCC),\ | 128 | hostcc-option = $(call __cc-option, $(HOSTCC),\ |
129 | $(HOSTCFLAGS) $(HOST_EXTRACFLAGS),$(1),$(2)) | 129 | $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS),$(1),$(2)) |
130 | 130 | ||
131 | # cc-option-yn | 131 | # cc-option-yn |
132 | # Usage: flag := $(call cc-option-yn,-march=winchip-c6) | 132 | # Usage: flag := $(call cc-option-yn,-march=winchip-c6) |
@@ -153,18 +153,14 @@ cc-fullversion = $(shell $(CONFIG_SHELL) \ | |||
153 | # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) | 153 | # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) |
154 | cc-ifversion = $(shell [ $(cc-version) $(1) $(2) ] && echo $(3) || echo $(4)) | 154 | cc-ifversion = $(shell [ $(cc-version) $(1) $(2) ] && echo $(3) || echo $(4)) |
155 | 155 | ||
156 | # cc-if-fullversion | ||
157 | # Usage: EXTRA_CFLAGS += $(call cc-if-fullversion, -lt, 040502, -O1) | ||
158 | cc-if-fullversion = $(shell [ $(cc-fullversion) $(1) $(2) ] && echo $(3) || echo $(4)) | ||
159 | |||
160 | # cc-ldoption | 156 | # cc-ldoption |
161 | # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) | 157 | # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) |
162 | cc-ldoption = $(call try-run,\ | 158 | cc-ldoption = $(call try-run,\ |
163 | $(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) | 159 | $(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) |
164 | 160 | ||
165 | # ld-option | 161 | # ld-option |
166 | # Usage: LDFLAGS += $(call ld-option, -X) | 162 | # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y) |
167 | ld-option = $(call try-run, $(LD) $(LDFLAGS) $(1) -v,$(1),$(2)) | 163 | ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3)) |
168 | 164 | ||
169 | # ar-option | 165 | # ar-option |
170 | # Usage: KBUILD_ARFLAGS := $(call ar-option,D) | 166 | # Usage: KBUILD_ARFLAGS := $(call ar-option,D) |
@@ -214,7 +210,7 @@ hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj | |||
214 | # Prefix -I with $(srctree) if it is not an absolute path. | 210 | # Prefix -I with $(srctree) if it is not an absolute path. |
215 | # skip if -I has no parameter | 211 | # skip if -I has no parameter |
216 | addtree = $(if $(patsubst -I%,%,$(1)), \ | 212 | addtree = $(if $(patsubst -I%,%,$(1)), \ |
217 | $(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1))) | 213 | $(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)),$(1)) |
218 | 214 | ||
219 | # Find all -I options and call addtree | 215 | # Find all -I options and call addtree |
220 | flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) | 216 | flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) |
@@ -400,3 +396,6 @@ endif | |||
400 | endef | 396 | endef |
401 | # | 397 | # |
402 | ############################################################################### | 398 | ############################################################################### |
399 | |||
400 | # delete partially updated (i.e. corrupted) files on error | ||
401 | .DELETE_ON_ERROR: | ||
diff --git a/scripts/Makefile b/scripts/Makefile index 25ab143cbe14..61affa300d25 100644 --- a/scripts/Makefile +++ b/scripts/Makefile | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | HOST_EXTRACFLAGS += -I$(srctree)/tools/include | 11 | HOST_EXTRACFLAGS += -I$(srctree)/tools/include |
12 | 12 | ||
13 | hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c | ||
13 | hostprogs-$(CONFIG_KALLSYMS) += kallsyms | 14 | hostprogs-$(CONFIG_KALLSYMS) += kallsyms |
14 | hostprogs-$(CONFIG_LOGO) += pnmtologo | 15 | hostprogs-$(CONFIG_LOGO) += pnmtologo |
15 | hostprogs-$(CONFIG_VT) += conmakehash | 16 | hostprogs-$(CONFIG_VT) += conmakehash |
@@ -22,8 +23,8 @@ hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert | |||
22 | 23 | ||
23 | HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include | 24 | HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include |
24 | HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include | 25 | HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include |
25 | HOSTLOADLIBES_sign-file = -lcrypto | 26 | HOSTLDLIBS_sign-file = -lcrypto |
26 | HOSTLOADLIBES_extract-cert = -lcrypto | 27 | HOSTLDLIBS_extract-cert = -lcrypto |
27 | 28 | ||
28 | always := $(hostprogs-y) $(hostprogs-m) | 29 | always := $(hostprogs-y) $(hostprogs-m) |
29 | 30 | ||
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index e7889f486ca1..5a2d1c9578a0 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -53,13 +53,6 @@ endif | |||
53 | 53 | ||
54 | include scripts/Makefile.lib | 54 | include scripts/Makefile.lib |
55 | 55 | ||
56 | ifdef host-progs | ||
57 | ifneq ($(hostprogs-y),$(host-progs)) | ||
58 | $(warning kbuild: $(obj)/Makefile - Usage of host-progs is deprecated. Please replace with hostprogs-y!) | ||
59 | hostprogs-y += $(host-progs) | ||
60 | endif | ||
61 | endif | ||
62 | |||
63 | # Do not include host rules unless needed | 56 | # Do not include host rules unless needed |
64 | ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),) | 57 | ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),) |
65 | include scripts/Makefile.host | 58 | include scripts/Makefile.host |
@@ -197,7 +190,7 @@ cmd_modversions_c = \ | |||
197 | $(call cmd_gensymtypes_c,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \ | 190 | $(call cmd_gensymtypes_c,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \ |
198 | > $(@D)/.tmp_$(@F:.o=.ver); \ | 191 | > $(@D)/.tmp_$(@F:.o=.ver); \ |
199 | \ | 192 | \ |
200 | $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ | 193 | $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ |
201 | -T $(@D)/.tmp_$(@F:.o=.ver); \ | 194 | -T $(@D)/.tmp_$(@F:.o=.ver); \ |
202 | rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ | 195 | rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ |
203 | else \ | 196 | else \ |
@@ -206,11 +199,8 @@ cmd_modversions_c = \ | |||
206 | endif | 199 | endif |
207 | 200 | ||
208 | ifdef CONFIG_FTRACE_MCOUNT_RECORD | 201 | ifdef CONFIG_FTRACE_MCOUNT_RECORD |
209 | # gcc 5 supports generating the mcount tables directly | 202 | ifndef CC_USING_RECORD_MCOUNT |
210 | ifneq ($(call cc-option,-mrecord-mcount,y),y) | 203 | # compiler will not generate __mcount_loc use recordmcount or recordmcount.pl |
211 | KBUILD_CFLAGS += -mrecord-mcount | ||
212 | else | ||
213 | # else do it all manually | ||
214 | ifdef BUILD_C_RECORDMCOUNT | 204 | ifdef BUILD_C_RECORDMCOUNT |
215 | ifeq ("$(origin RECORDMCOUNT_WARN)", "command line") | 205 | ifeq ("$(origin RECORDMCOUNT_WARN)", "command line") |
216 | RECORDMCOUNT_FLAGS = -w | 206 | RECORDMCOUNT_FLAGS = -w |
@@ -230,7 +220,7 @@ sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH | |||
230 | "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \ | 220 | "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \ |
231 | "$(if $(CONFIG_64BIT),64,32)" \ | 221 | "$(if $(CONFIG_64BIT),64,32)" \ |
232 | "$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \ | 222 | "$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \ |
233 | "$(LD)" "$(NM)" "$(RM)" "$(MV)" \ | 223 | "$(LD) $(KBUILD_LDFLAGS)" "$(NM)" "$(RM)" "$(MV)" \ |
234 | "$(if $(part-of-module),1,0)" "$(@)"; | 224 | "$(if $(part-of-module),1,0)" "$(@)"; |
235 | recordmcount_source := $(srctree)/scripts/recordmcount.pl | 225 | recordmcount_source := $(srctree)/scripts/recordmcount.pl |
236 | endif # BUILD_C_RECORDMCOUNT | 226 | endif # BUILD_C_RECORDMCOUNT |
@@ -239,7 +229,7 @@ cmd_record_mcount = \ | |||
239 | "$(CC_FLAGS_FTRACE)" ]; then \ | 229 | "$(CC_FLAGS_FTRACE)" ]; then \ |
240 | $(sub_cmd_record_mcount) \ | 230 | $(sub_cmd_record_mcount) \ |
241 | fi; | 231 | fi; |
242 | endif # -record-mcount | 232 | endif # CC_USING_RECORD_MCOUNT |
243 | endif # CONFIG_FTRACE_MCOUNT_RECORD | 233 | endif # CONFIG_FTRACE_MCOUNT_RECORD |
244 | 234 | ||
245 | ifdef CONFIG_STACK_VALIDATION | 235 | ifdef CONFIG_STACK_VALIDATION |
@@ -256,8 +246,6 @@ objtool_args += --no-fp | |||
256 | endif | 246 | endif |
257 | ifdef CONFIG_GCOV_KERNEL | 247 | ifdef CONFIG_GCOV_KERNEL |
258 | objtool_args += --no-unreachable | 248 | objtool_args += --no-unreachable |
259 | else | ||
260 | objtool_args += $(call cc-ifversion, -lt, 0405, --no-unreachable) | ||
261 | endif | 249 | endif |
262 | ifdef CONFIG_RETPOLINE | 250 | ifdef CONFIG_RETPOLINE |
263 | ifneq ($(RETPOLINE_CFLAGS),) | 251 | ifneq ($(RETPOLINE_CFLAGS),) |
@@ -404,7 +392,7 @@ cmd_modversions_S = \ | |||
404 | $(call cmd_gensymtypes_S,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \ | 392 | $(call cmd_gensymtypes_S,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \ |
405 | > $(@D)/.tmp_$(@F:.o=.ver); \ | 393 | > $(@D)/.tmp_$(@F:.o=.ver); \ |
406 | \ | 394 | \ |
407 | $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ | 395 | $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ |
408 | -T $(@D)/.tmp_$(@F:.o=.ver); \ | 396 | -T $(@D)/.tmp_$(@F:.o=.ver); \ |
409 | rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ | 397 | rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ |
410 | else \ | 398 | else \ |
@@ -590,7 +578,4 @@ endif | |||
590 | # We never want them to be removed automatically. | 578 | # We never want them to be removed automatically. |
591 | .SECONDARY: $(targets) | 579 | .SECONDARY: $(targets) |
592 | 580 | ||
593 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
594 | # information in a variable se we can use it in if_changed and friends. | ||
595 | |||
596 | .PHONY: $(PHONY) | 581 | .PHONY: $(PHONY) |
diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index 808d09f27ad4..0b80e3207b20 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean | |||
@@ -38,7 +38,6 @@ subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn)) | |||
38 | 38 | ||
39 | __clean-files := $(extra-y) $(extra-m) $(extra-) \ | 39 | __clean-files := $(extra-y) $(extra-m) $(extra-) \ |
40 | $(always) $(targets) $(clean-files) \ | 40 | $(always) $(targets) $(clean-files) \ |
41 | $(host-progs) \ | ||
42 | $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \ | 41 | $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \ |
43 | $(hostlibs-y) $(hostlibs-m) $(hostlibs-) \ | 42 | $(hostlibs-y) $(hostlibs-m) $(hostlibs-) \ |
44 | $(hostcxxlibs-y) $(hostcxxlibs-m) | 43 | $(hostcxxlibs-y) $(hostcxxlibs-m) |
@@ -88,7 +87,4 @@ PHONY += $(subdir-ymn) | |||
88 | $(subdir-ymn): | 87 | $(subdir-ymn): |
89 | $(Q)$(MAKE) $(clean)=$@ | 88 | $(Q)$(MAKE) $(clean)=$@ |
90 | 89 | ||
91 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
92 | # information in a variable se we can use it in if_changed and friends. | ||
93 | |||
94 | .PHONY: $(PHONY) | 90 | .PHONY: $(PHONY) |
diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins index c961b9a65d11..0a482f341576 100644 --- a/scripts/Makefile.gcc-plugins +++ b/scripts/Makefile.gcc-plugins | |||
@@ -1,33 +1,44 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | |||
2 | gcc-plugin-$(CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) += cyc_complexity_plugin.so | 3 | gcc-plugin-$(CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) += cyc_complexity_plugin.so |
3 | 4 | ||
4 | gcc-plugin-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) += latent_entropy_plugin.so | 5 | gcc-plugin-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) += latent_entropy_plugin.so |
5 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) += -DLATENT_ENTROPY_PLUGIN | 6 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) \ |
7 | += -DLATENT_ENTROPY_PLUGIN | ||
6 | ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY | 8 | ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY |
7 | DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable | 9 | DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable |
8 | endif | 10 | endif |
11 | export DISABLE_LATENT_ENTROPY_PLUGIN | ||
9 | 12 | ||
10 | gcc-plugin-$(CONFIG_GCC_PLUGIN_SANCOV) += sancov_plugin.so | 13 | gcc-plugin-$(CONFIG_GCC_PLUGIN_SANCOV) += sancov_plugin.so |
14 | |||
11 | gcc-plugin-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) += structleak_plugin.so | 15 | gcc-plugin-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) += structleak_plugin.so |
12 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE) += -fplugin-arg-structleak_plugin-verbose | 16 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE) \ |
13 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) += -fplugin-arg-structleak_plugin-byref-all | 17 | += -fplugin-arg-structleak_plugin-verbose |
14 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) += -DSTRUCTLEAK_PLUGIN | 18 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \ |
19 | += -fplugin-arg-structleak_plugin-byref-all | ||
20 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \ | ||
21 | += -DSTRUCTLEAK_PLUGIN | ||
15 | 22 | ||
16 | gcc-plugin-$(CONFIG_GCC_PLUGIN_RANDSTRUCT) += randomize_layout_plugin.so | 23 | gcc-plugin-$(CONFIG_GCC_PLUGIN_RANDSTRUCT) += randomize_layout_plugin.so |
17 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_RANDSTRUCT) += -DRANDSTRUCT_PLUGIN | 24 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_RANDSTRUCT) \ |
18 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE) += -fplugin-arg-randomize_layout_plugin-performance-mode | 25 | += -DRANDSTRUCT_PLUGIN |
26 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE) \ | ||
27 | += -fplugin-arg-randomize_layout_plugin-performance-mode | ||
19 | 28 | ||
29 | # All the plugin CFLAGS are collected here in case a build target needs to | ||
30 | # filter them out of the KBUILD_CFLAGS. | ||
20 | GCC_PLUGINS_CFLAGS := $(strip $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y)) $(gcc-plugin-cflags-y)) | 31 | GCC_PLUGINS_CFLAGS := $(strip $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y)) $(gcc-plugin-cflags-y)) |
21 | 32 | # The sancov_plugin.so is included via CFLAGS_KCOV, so it is removed here. | |
22 | export GCC_PLUGINS_CFLAGS GCC_PLUGIN GCC_PLUGIN_SUBDIR | ||
23 | export DISABLE_LATENT_ENTROPY_PLUGIN | ||
24 | |||
25 | # sancov_plugin.so can be only in CFLAGS_KCOV because avoid duplication. | ||
26 | GCC_PLUGINS_CFLAGS := $(filter-out %/sancov_plugin.so, $(GCC_PLUGINS_CFLAGS)) | 33 | GCC_PLUGINS_CFLAGS := $(filter-out %/sancov_plugin.so, $(GCC_PLUGINS_CFLAGS)) |
34 | export GCC_PLUGINS_CFLAGS | ||
27 | 35 | ||
36 | # Add the flags to the build! | ||
28 | KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS) | 37 | KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS) |
38 | |||
39 | # All enabled GCC plugins are collected here for building below. | ||
29 | GCC_PLUGIN := $(gcc-plugin-y) | 40 | GCC_PLUGIN := $(gcc-plugin-y) |
30 | GCC_PLUGIN_SUBDIR := $(gcc-plugin-subdir-y) | 41 | export GCC_PLUGIN |
31 | 42 | ||
32 | # Actually do the build, if requested. | 43 | # Actually do the build, if requested. |
33 | PHONY += gcc-plugins | 44 | PHONY += gcc-plugins |
diff --git a/scripts/Makefile.host b/scripts/Makefile.host index aa971cc3f339..0393f75db4d4 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host | |||
@@ -62,9 +62,9 @@ host-cxxshobjs := $(addprefix $(obj)/,$(host-cxxshobjs)) | |||
62 | ##### | 62 | ##### |
63 | # Handle options to gcc. Support building with separate output directory | 63 | # Handle options to gcc. Support building with separate output directory |
64 | 64 | ||
65 | _hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ | 65 | _hostc_flags = $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ |
66 | $(HOSTCFLAGS_$(basetarget).o) | 66 | $(HOSTCFLAGS_$(basetarget).o) |
67 | _hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ | 67 | _hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ |
68 | $(HOSTCXXFLAGS_$(basetarget).o) | 68 | $(HOSTCXXFLAGS_$(basetarget).o) |
69 | 69 | ||
70 | ifeq ($(KBUILD_SRC),) | 70 | ifeq ($(KBUILD_SRC),) |
@@ -84,17 +84,17 @@ hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags) | |||
84 | # Create executable from a single .c file | 84 | # Create executable from a single .c file |
85 | # host-csingle -> Executable | 85 | # host-csingle -> Executable |
86 | quiet_cmd_host-csingle = HOSTCC $@ | 86 | quiet_cmd_host-csingle = HOSTCC $@ |
87 | cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(HOSTLDFLAGS) -o $@ $< \ | 87 | cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(KBUILD_HOSTLDFLAGS) -o $@ $< \ |
88 | $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) | 88 | $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F)) |
89 | $(host-csingle): $(obj)/%: $(src)/%.c FORCE | 89 | $(host-csingle): $(obj)/%: $(src)/%.c FORCE |
90 | $(call if_changed_dep,host-csingle) | 90 | $(call if_changed_dep,host-csingle) |
91 | 91 | ||
92 | # Link an executable based on list of .o files, all plain c | 92 | # Link an executable based on list of .o files, all plain c |
93 | # host-cmulti -> executable | 93 | # host-cmulti -> executable |
94 | quiet_cmd_host-cmulti = HOSTLD $@ | 94 | quiet_cmd_host-cmulti = HOSTLD $@ |
95 | cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \ | 95 | cmd_host-cmulti = $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ \ |
96 | $(addprefix $(obj)/,$($(@F)-objs)) \ | 96 | $(addprefix $(obj)/,$($(@F)-objs)) \ |
97 | $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) | 97 | $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F)) |
98 | $(host-cmulti): FORCE | 98 | $(host-cmulti): FORCE |
99 | $(call if_changed,host-cmulti) | 99 | $(call if_changed,host-cmulti) |
100 | $(call multi_depend, $(host-cmulti), , -objs) | 100 | $(call multi_depend, $(host-cmulti), , -objs) |
@@ -109,10 +109,10 @@ $(host-cobjs): $(obj)/%.o: $(src)/%.c FORCE | |||
109 | # Link an executable based on list of .o files, a mixture of .c and .cc | 109 | # Link an executable based on list of .o files, a mixture of .c and .cc |
110 | # host-cxxmulti -> executable | 110 | # host-cxxmulti -> executable |
111 | quiet_cmd_host-cxxmulti = HOSTLD $@ | 111 | quiet_cmd_host-cxxmulti = HOSTLD $@ |
112 | cmd_host-cxxmulti = $(HOSTCXX) $(HOSTLDFLAGS) -o $@ \ | 112 | cmd_host-cxxmulti = $(HOSTCXX) $(KBUILD_HOSTLDFLAGS) -o $@ \ |
113 | $(foreach o,objs cxxobjs,\ | 113 | $(foreach o,objs cxxobjs,\ |
114 | $(addprefix $(obj)/,$($(@F)-$(o)))) \ | 114 | $(addprefix $(obj)/,$($(@F)-$(o)))) \ |
115 | $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) | 115 | $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F)) |
116 | $(host-cxxmulti): FORCE | 116 | $(host-cxxmulti): FORCE |
117 | $(call if_changed,host-cxxmulti) | 117 | $(call if_changed,host-cxxmulti) |
118 | $(call multi_depend, $(host-cxxmulti), , -objs -cxxobjs) | 118 | $(call multi_depend, $(host-cxxmulti), , -objs -cxxobjs) |
@@ -143,9 +143,9 @@ $(host-cxxshobjs): $(obj)/%.o: $(src)/%.c FORCE | |||
143 | # Link a shared library, based on position independent .o files | 143 | # Link a shared library, based on position independent .o files |
144 | # *.o -> .so shared library (host-cshlib) | 144 | # *.o -> .so shared library (host-cshlib) |
145 | quiet_cmd_host-cshlib = HOSTLLD -shared $@ | 145 | quiet_cmd_host-cshlib = HOSTLLD -shared $@ |
146 | cmd_host-cshlib = $(HOSTCC) $(HOSTLDFLAGS) -shared -o $@ \ | 146 | cmd_host-cshlib = $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -shared -o $@ \ |
147 | $(addprefix $(obj)/,$($(@F:.so=-objs))) \ | 147 | $(addprefix $(obj)/,$($(@F:.so=-objs))) \ |
148 | $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) | 148 | $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F)) |
149 | $(host-cshlib): FORCE | 149 | $(host-cshlib): FORCE |
150 | $(call if_changed,host-cshlib) | 150 | $(call if_changed,host-cshlib) |
151 | $(call multi_depend, $(host-cshlib), .so, -objs) | 151 | $(call multi_depend, $(host-cshlib), .so, -objs) |
@@ -153,9 +153,9 @@ $(call multi_depend, $(host-cshlib), .so, -objs) | |||
153 | # Link a shared library, based on position independent .o files | 153 | # Link a shared library, based on position independent .o files |
154 | # *.o -> .so shared library (host-cxxshlib) | 154 | # *.o -> .so shared library (host-cxxshlib) |
155 | quiet_cmd_host-cxxshlib = HOSTLLD -shared $@ | 155 | quiet_cmd_host-cxxshlib = HOSTLLD -shared $@ |
156 | cmd_host-cxxshlib = $(HOSTCXX) $(HOSTLDFLAGS) -shared -o $@ \ | 156 | cmd_host-cxxshlib = $(HOSTCXX) $(KBUILD_HOSTLDFLAGS) -shared -o $@ \ |
157 | $(addprefix $(obj)/,$($(@F:.so=-objs))) \ | 157 | $(addprefix $(obj)/,$($(@F:.so=-objs))) \ |
158 | $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) | 158 | $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F)) |
159 | $(host-cxxshlib): FORCE | 159 | $(host-cxxshlib): FORCE |
160 | $(call if_changed,host-cxxshlib) | 160 | $(call if_changed,host-cxxshlib) |
161 | $(call multi_depend, $(host-cxxshlib), .so, -objs) | 161 | $(call multi_depend, $(host-cxxshlib), .so, -objs) |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 1bb594fcfe12..61e596650ed3 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -162,7 +162,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ | |||
162 | cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ | 162 | cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ |
163 | $(__cpp_flags) | 163 | $(__cpp_flags) |
164 | 164 | ||
165 | ld_flags = $(LDFLAGS) $(ldflags-y) | 165 | ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) |
166 | 166 | ||
167 | DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes | 167 | DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes |
168 | 168 | ||
@@ -225,8 +225,7 @@ $(obj)/%: $(src)/%_shipped | |||
225 | # --------------------------------------------------------------------------- | 225 | # --------------------------------------------------------------------------- |
226 | 226 | ||
227 | quiet_cmd_ld = LD $@ | 227 | quiet_cmd_ld = LD $@ |
228 | cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \ | 228 | cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@ |
229 | $(filter-out FORCE,$^) -o $@ | ||
230 | 229 | ||
231 | # Objcopy | 230 | # Objcopy |
232 | # --------------------------------------------------------------------------- | 231 | # --------------------------------------------------------------------------- |
@@ -416,7 +415,7 @@ define filechk_offsets | |||
416 | echo " * This file was generated by Kbuild"; \ | 415 | echo " * This file was generated by Kbuild"; \ |
417 | echo " */"; \ | 416 | echo " */"; \ |
418 | echo ""; \ | 417 | echo ""; \ |
419 | sed -ne $(sed-offsets); \ | 418 | sed -ne $(sed-offsets) < $<; \ |
420 | echo ""; \ | 419 | echo ""; \ |
421 | echo "#endif" ) | 420 | echo "#endif" ) |
422 | endef | 421 | endef |
diff --git a/scripts/Makefile.modbuiltin b/scripts/Makefile.modbuiltin index a763b4775d06..a072a4267746 100644 --- a/scripts/Makefile.modbuiltin +++ b/scripts/Makefile.modbuiltin | |||
@@ -8,10 +8,10 @@ src := $(obj) | |||
8 | PHONY := __modbuiltin | 8 | PHONY := __modbuiltin |
9 | __modbuiltin: | 9 | __modbuiltin: |
10 | 10 | ||
11 | -include include/config/auto.conf | 11 | include include/config/auto.conf |
12 | # tristate.conf sets tristate variables to uppercase 'Y' or 'M' | 12 | # tristate.conf sets tristate variables to uppercase 'Y' or 'M' |
13 | # That way, we get the list of built-in modules in obj-Y | 13 | # That way, we get the list of built-in modules in obj-Y |
14 | -include include/config/tristate.conf | 14 | include include/config/tristate.conf |
15 | 15 | ||
16 | include scripts/Kbuild.include | 16 | include scripts/Kbuild.include |
17 | 17 | ||
@@ -54,8 +54,4 @@ PHONY += $(subdir-ym) | |||
54 | $(subdir-ym): | 54 | $(subdir-ym): |
55 | $(Q)$(MAKE) $(modbuiltin)=$@ | 55 | $(Q)$(MAKE) $(modbuiltin)=$@ |
56 | 56 | ||
57 | |||
58 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
59 | # information in a variable se we can use it in if_changed and friends. | ||
60 | |||
61 | .PHONY: $(PHONY) | 57 | .PHONY: $(PHONY) |
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index 51ca0244fc8a..ff5ca9817a85 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst | |||
@@ -35,8 +35,4 @@ modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D)) | |||
35 | $(modules): | 35 | $(modules): |
36 | $(call cmd,modules_install,$(MODLIB)/$(modinst_dir)) | 36 | $(call cmd,modules_install,$(MODLIB)/$(modinst_dir)) |
37 | 37 | ||
38 | |||
39 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
40 | # information in a variable so we can use it in if_changed and friends. | ||
41 | |||
42 | .PHONY: $(PHONY) | 38 | .PHONY: $(PHONY) |
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index df4174405feb..7d4af0d0accb 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost | |||
@@ -120,7 +120,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink) | |||
120 | # Step 6), final link of the modules with optional arch pass after final link | 120 | # Step 6), final link of the modules with optional arch pass after final link |
121 | quiet_cmd_ld_ko_o = LD [M] $@ | 121 | quiet_cmd_ld_ko_o = LD [M] $@ |
122 | cmd_ld_ko_o = \ | 122 | cmd_ld_ko_o = \ |
123 | $(LD) -r $(LDFLAGS) \ | 123 | $(LD) -r $(KBUILD_LDFLAGS) \ |
124 | $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ | 124 | $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ |
125 | -o $@ $(filter-out FORCE,$^) ; \ | 125 | -o $@ $(filter-out FORCE,$^) ; \ |
126 | $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) | 126 | $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) |
@@ -149,8 +149,4 @@ ifneq ($(cmd_files),) | |||
149 | include $(cmd_files) | 149 | include $(cmd_files) |
150 | endif | 150 | endif |
151 | 151 | ||
152 | |||
153 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
154 | # information in a variable se we can use it in if_changed and friends. | ||
155 | |||
156 | .PHONY: $(PHONY) | 152 | .PHONY: $(PHONY) |
diff --git a/scripts/Makefile.modsign b/scripts/Makefile.modsign index 171483bc0538..da56aa78d245 100644 --- a/scripts/Makefile.modsign +++ b/scripts/Makefile.modsign | |||
@@ -27,7 +27,4 @@ modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D)) | |||
27 | $(modules): | 27 | $(modules): |
28 | $(call cmd,sign_ko,$(MODLIB)/$(modinst_dir)) | 28 | $(call cmd,sign_ko,$(MODLIB)/$(modinst_dir)) |
29 | 29 | ||
30 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
31 | # information in a variable se we can use it in if_changed and friends. | ||
32 | |||
33 | .PHONY: $(PHONY) | 30 | .PHONY: $(PHONY) |
diff --git a/scripts/Makefile.ubsan b/scripts/Makefile.ubsan index b593b36ccff8..38b2b4818e8e 100644 --- a/scripts/Makefile.ubsan +++ b/scripts/Makefile.ubsan | |||
@@ -14,10 +14,6 @@ ifdef CONFIG_UBSAN_ALIGNMENT | |||
14 | CFLAGS_UBSAN += $(call cc-option, -fsanitize=alignment) | 14 | CFLAGS_UBSAN += $(call cc-option, -fsanitize=alignment) |
15 | endif | 15 | endif |
16 | 16 | ||
17 | ifdef CONFIG_UBSAN_NULL | ||
18 | CFLAGS_UBSAN += $(call cc-option, -fsanitize=null) | ||
19 | endif | ||
20 | |||
21 | # -fsanitize=* options makes GCC less smart than usual and | 17 | # -fsanitize=* options makes GCC less smart than usual and |
22 | # increase number of 'maybe-uninitialized false-positives | 18 | # increase number of 'maybe-uninitialized false-positives |
23 | CFLAGS_UBSAN += $(call cc-option, -Wno-maybe-uninitialized) | 19 | CFLAGS_UBSAN += $(call cc-option, -Wno-maybe-uninitialized) |
diff --git a/scripts/basic/.gitignore b/scripts/basic/.gitignore index 9528ec9e5adc..a776371a3502 100644 --- a/scripts/basic/.gitignore +++ b/scripts/basic/.gitignore | |||
@@ -1,2 +1 @@ | |||
1 | fixdep | fixdep | |
2 | bin2c | ||
diff --git a/scripts/basic/Makefile b/scripts/basic/Makefile index 0372b33febe5..af49b446f17d 100644 --- a/scripts/basic/Makefile +++ b/scripts/basic/Makefile | |||
@@ -9,7 +9,6 @@ | |||
9 | # fixdep: Used to generate dependency information during build process | 9 | # fixdep: Used to generate dependency information during build process |
10 | 10 | ||
11 | hostprogs-y := fixdep | 11 | hostprogs-y := fixdep |
12 | hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c | ||
13 | always := $(hostprogs-y) | 12 | always := $(hostprogs-y) |
14 | 13 | ||
15 | # fixdep is needed to compile other host programs | 14 | # fixdep is needed to compile other host programs |
diff --git a/scripts/basic/bin2c.c b/scripts/bin2c.c index c3d7eef3ad06..c3d7eef3ad06 100644 --- a/scripts/basic/bin2c.c +++ b/scripts/bin2c.c | |||
diff --git a/scripts/cc-can-link.sh b/scripts/cc-can-link.sh index 208eb2825dab..6efcead31989 100755 --- a/scripts/cc-can-link.sh +++ b/scripts/cc-can-link.sh | |||
@@ -1,7 +1,7 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # SPDX-License-Identifier: GPL-2.0 | 2 | # SPDX-License-Identifier: GPL-2.0 |
3 | 3 | ||
4 | cat << "END" | $@ -x c - -o /dev/null >/dev/null 2>&1 && echo "y" | 4 | cat << "END" | $@ -x c - -o /dev/null >/dev/null 2>&1 |
5 | #include <stdio.h> | 5 | #include <stdio.h> |
6 | int main(void) | 6 | int main(void) |
7 | { | 7 | { |
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e3b7362b0ee4..5219280bf7ff 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -13,6 +13,7 @@ use POSIX; | |||
13 | use File::Basename; | 13 | use File::Basename; |
14 | use Cwd 'abs_path'; | 14 | use Cwd 'abs_path'; |
15 | use Term::ANSIColor qw(:constants); | 15 | use Term::ANSIColor qw(:constants); |
16 | use Encode qw(decode encode); | ||
16 | 17 | ||
17 | my $P = $0; | 18 | my $P = $0; |
18 | my $D = dirname(abs_path($P)); | 19 | my $D = dirname(abs_path($P)); |
@@ -240,11 +241,11 @@ $check_orig = $check; | |||
240 | 241 | ||
241 | my $exit = 0; | 242 | my $exit = 0; |
242 | 243 | ||
244 | my $perl_version_ok = 1; | ||
243 | if ($^V && $^V lt $minimum_perl_version) { | 245 | if ($^V && $^V lt $minimum_perl_version) { |
246 | $perl_version_ok = 0; | ||
244 | printf "$P: requires at least perl version %vd\n", $minimum_perl_version; | 247 | printf "$P: requires at least perl version %vd\n", $minimum_perl_version; |
245 | if (!$ignore_perl_version) { | 248 | exit(1) if (!$ignore_perl_version); |
246 | exit(1); | ||
247 | } | ||
248 | } | 249 | } |
249 | 250 | ||
250 | #if no filenames are given, push '-' to read patch from stdin | 251 | #if no filenames are given, push '-' to read patch from stdin |
@@ -346,9 +347,10 @@ our $Sparse = qr{ | |||
346 | __force| | 347 | __force| |
347 | __iomem| | 348 | __iomem| |
348 | __must_check| | 349 | __must_check| |
349 | __init_refok| | ||
350 | __kprobes| | 350 | __kprobes| |
351 | __ref| | 351 | __ref| |
352 | __refconst| | ||
353 | __refdata| | ||
352 | __rcu| | 354 | __rcu| |
353 | __private | 355 | __private |
354 | }x; | 356 | }x; |
@@ -847,6 +849,17 @@ sub is_maintained_obsolete { | |||
847 | return $status =~ /obsolete/i; | 849 | return $status =~ /obsolete/i; |
848 | } | 850 | } |
849 | 851 | ||
852 | sub is_SPDX_License_valid { | ||
853 | my ($license) = @_; | ||
854 | |||
855 | return 1 if (!$tree || which("python") eq "" || !(-e "$root/scripts/spdxcheck.py") || !(-e "$root/.git")); | ||
856 | |||
857 | my $root_path = abs_path($root); | ||
858 | my $status = `cd "$root_path"; echo "$license" | python scripts/spdxcheck.py -`; | ||
859 | return 0 if ($status ne ""); | ||
860 | return 1; | ||
861 | } | ||
862 | |||
850 | my $camelcase_seeded = 0; | 863 | my $camelcase_seeded = 0; |
851 | sub seed_camelcase_includes { | 864 | sub seed_camelcase_includes { |
852 | return if ($camelcase_seeded); | 865 | return if ($camelcase_seeded); |
@@ -1026,11 +1039,11 @@ if (!$quiet) { | |||
1026 | hash_show_words(\%use_type, "Used"); | 1039 | hash_show_words(\%use_type, "Used"); |
1027 | hash_show_words(\%ignore_type, "Ignored"); | 1040 | hash_show_words(\%ignore_type, "Ignored"); |
1028 | 1041 | ||
1029 | if ($^V lt 5.10.0) { | 1042 | if (!$perl_version_ok) { |
1030 | print << "EOM" | 1043 | print << "EOM" |
1031 | 1044 | ||
1032 | NOTE: perl $^V is not modern enough to detect all possible issues. | 1045 | NOTE: perl $^V is not modern enough to detect all possible issues. |
1033 | An upgrade to at least perl v5.10.0 is suggested. | 1046 | An upgrade to at least perl $minimum_perl_version is suggested. |
1034 | EOM | 1047 | EOM |
1035 | } | 1048 | } |
1036 | if ($exit) { | 1049 | if ($exit) { |
@@ -2235,10 +2248,14 @@ sub process { | |||
2235 | 2248 | ||
2236 | our $clean = 1; | 2249 | our $clean = 1; |
2237 | my $signoff = 0; | 2250 | my $signoff = 0; |
2251 | my $author = ''; | ||
2252 | my $authorsignoff = 0; | ||
2238 | my $is_patch = 0; | 2253 | my $is_patch = 0; |
2254 | my $is_binding_patch = -1; | ||
2239 | my $in_header_lines = $file ? 0 : 1; | 2255 | my $in_header_lines = $file ? 0 : 1; |
2240 | my $in_commit_log = 0; #Scanning lines before patch | 2256 | my $in_commit_log = 0; #Scanning lines before patch |
2241 | my $has_commit_log = 0; #Encountered lines before patch | 2257 | my $has_commit_log = 0; #Encountered lines before patch |
2258 | my $commit_log_lines = 0; #Number of commit log lines | ||
2242 | my $commit_log_possible_stack_dump = 0; | 2259 | my $commit_log_possible_stack_dump = 0; |
2243 | my $commit_log_long_line = 0; | 2260 | my $commit_log_long_line = 0; |
2244 | my $commit_log_has_diff = 0; | 2261 | my $commit_log_has_diff = 0; |
@@ -2485,6 +2502,19 @@ sub process { | |||
2485 | $check = $check_orig; | 2502 | $check = $check_orig; |
2486 | } | 2503 | } |
2487 | $checklicenseline = 1; | 2504 | $checklicenseline = 1; |
2505 | |||
2506 | if ($realfile !~ /^MAINTAINERS/) { | ||
2507 | my $last_binding_patch = $is_binding_patch; | ||
2508 | |||
2509 | $is_binding_patch = () = $realfile =~ m@^(?:Documentation/devicetree/|include/dt-bindings/)@; | ||
2510 | |||
2511 | if (($last_binding_patch != -1) && | ||
2512 | ($last_binding_patch ^ $is_binding_patch)) { | ||
2513 | WARN("DT_SPLIT_BINDING_PATCH", | ||
2514 | "DT binding docs and includes should be a separate patch. See: Documentation/devicetree/bindings/submitting-patches.txt\n"); | ||
2515 | } | ||
2516 | } | ||
2517 | |||
2488 | next; | 2518 | next; |
2489 | } | 2519 | } |
2490 | 2520 | ||
@@ -2496,6 +2526,18 @@ sub process { | |||
2496 | 2526 | ||
2497 | $cnt_lines++ if ($realcnt != 0); | 2527 | $cnt_lines++ if ($realcnt != 0); |
2498 | 2528 | ||
2529 | # Verify the existence of a commit log if appropriate | ||
2530 | # 2 is used because a $signature is counted in $commit_log_lines | ||
2531 | if ($in_commit_log) { | ||
2532 | if ($line !~ /^\s*$/) { | ||
2533 | $commit_log_lines++; #could be a $signature | ||
2534 | } | ||
2535 | } elsif ($has_commit_log && $commit_log_lines < 2) { | ||
2536 | WARN("COMMIT_MESSAGE", | ||
2537 | "Missing commit description - Add an appropriate one\n"); | ||
2538 | $commit_log_lines = 2; #warn only once | ||
2539 | } | ||
2540 | |||
2499 | # Check if the commit log has what seems like a diff which can confuse patch | 2541 | # Check if the commit log has what seems like a diff which can confuse patch |
2500 | if ($in_commit_log && !$commit_log_has_diff && | 2542 | if ($in_commit_log && !$commit_log_has_diff && |
2501 | (($line =~ m@^\s+diff\b.*a/[\w/]+@ && | 2543 | (($line =~ m@^\s+diff\b.*a/[\w/]+@ && |
@@ -2517,10 +2559,24 @@ sub process { | |||
2517 | } | 2559 | } |
2518 | } | 2560 | } |
2519 | 2561 | ||
2562 | # Check the patch for a From: | ||
2563 | if (decode("MIME-Header", $line) =~ /^From:\s*(.*)/) { | ||
2564 | $author = $1; | ||
2565 | $author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i); | ||
2566 | $author =~ s/"//g; | ||
2567 | } | ||
2568 | |||
2520 | # Check the patch for a signoff: | 2569 | # Check the patch for a signoff: |
2521 | if ($line =~ /^\s*signed-off-by:/i) { | 2570 | if ($line =~ /^\s*signed-off-by:/i) { |
2522 | $signoff++; | 2571 | $signoff++; |
2523 | $in_commit_log = 0; | 2572 | $in_commit_log = 0; |
2573 | if ($author ne '') { | ||
2574 | my $l = $line; | ||
2575 | $l =~ s/"//g; | ||
2576 | if ($l =~ /^\s*signed-off-by:\s*\Q$author\E/i) { | ||
2577 | $authorsignoff = 1; | ||
2578 | } | ||
2579 | } | ||
2524 | } | 2580 | } |
2525 | 2581 | ||
2526 | # Check if MAINTAINERS is being updated. If so, there's probably no need to | 2582 | # Check if MAINTAINERS is being updated. If so, there's probably no need to |
@@ -2606,12 +2662,6 @@ sub process { | |||
2606 | "A patch subject line should describe the change not the tool that found it\n" . $herecurr); | 2662 | "A patch subject line should describe the change not the tool that found it\n" . $herecurr); |
2607 | } | 2663 | } |
2608 | 2664 | ||
2609 | # Check for old stable address | ||
2610 | if ($line =~ /^\s*cc:\s*.*<?\bstable\@kernel\.org\b>?.*$/i) { | ||
2611 | ERROR("STABLE_ADDRESS", | ||
2612 | "The 'stable' address should be 'stable\@vger.kernel.org'\n" . $herecurr); | ||
2613 | } | ||
2614 | |||
2615 | # Check for unwanted Gerrit info | 2665 | # Check for unwanted Gerrit info |
2616 | if ($in_commit_log && $line =~ /^\s*change-id:/i) { | 2666 | if ($in_commit_log && $line =~ /^\s*change-id:/i) { |
2617 | ERROR("GERRIT_CHANGE_ID", | 2667 | ERROR("GERRIT_CHANGE_ID", |
@@ -2966,8 +3016,14 @@ sub process { | |||
2966 | 3016 | ||
2967 | if ($comment !~ /^$/ && | 3017 | if ($comment !~ /^$/ && |
2968 | $rawline !~ /^\+\Q$comment\E SPDX-License-Identifier: /) { | 3018 | $rawline !~ /^\+\Q$comment\E SPDX-License-Identifier: /) { |
2969 | WARN("SPDX_LICENSE_TAG", | 3019 | WARN("SPDX_LICENSE_TAG", |
2970 | "Missing or malformed SPDX-License-Identifier tag in line $checklicenseline\n" . $herecurr); | 3020 | "Missing or malformed SPDX-License-Identifier tag in line $checklicenseline\n" . $herecurr); |
3021 | } elsif ($rawline =~ /(SPDX-License-Identifier: .*)/) { | ||
3022 | my $spdx_license = $1; | ||
3023 | if (!is_SPDX_License_valid($spdx_license)) { | ||
3024 | WARN("SPDX_LICENSE_TAG", | ||
3025 | "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr); | ||
3026 | } | ||
2971 | } | 3027 | } |
2972 | } | 3028 | } |
2973 | } | 3029 | } |
@@ -3085,7 +3141,7 @@ sub process { | |||
3085 | } | 3141 | } |
3086 | 3142 | ||
3087 | # check indentation starts on a tab stop | 3143 | # check indentation starts on a tab stop |
3088 | if ($^V && $^V ge 5.10.0 && | 3144 | if ($perl_version_ok && |
3089 | $sline =~ /^\+\t+( +)(?:$c90_Keywords\b|\{\s*$|\}\s*(?:else\b|while\b|\s*$)|$Declare\s*$Ident\s*[;=])/) { | 3145 | $sline =~ /^\+\t+( +)(?:$c90_Keywords\b|\{\s*$|\}\s*(?:else\b|while\b|\s*$)|$Declare\s*$Ident\s*[;=])/) { |
3090 | my $indent = length($1); | 3146 | my $indent = length($1); |
3091 | if ($indent % 8) { | 3147 | if ($indent % 8) { |
@@ -3098,7 +3154,7 @@ sub process { | |||
3098 | } | 3154 | } |
3099 | 3155 | ||
3100 | # check multi-line statement indentation matches previous line | 3156 | # check multi-line statement indentation matches previous line |
3101 | if ($^V && $^V ge 5.10.0 && | 3157 | if ($perl_version_ok && |
3102 | $prevline =~ /^\+([ \t]*)((?:$c90_Keywords(?:\s+if)\s*)|(?:$Declare\s*)?(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*|(?:\*\s*)*$Lval\s*=\s*$Ident\s*)\(.*(\&\&|\|\||,)\s*$/) { | 3158 | $prevline =~ /^\+([ \t]*)((?:$c90_Keywords(?:\s+if)\s*)|(?:$Declare\s*)?(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*|(?:\*\s*)*$Lval\s*=\s*$Ident\s*)\(.*(\&\&|\|\||,)\s*$/) { |
3103 | $prevline =~ /^\+(\t*)(.*)$/; | 3159 | $prevline =~ /^\+(\t*)(.*)$/; |
3104 | my $oldindent = $1; | 3160 | my $oldindent = $1; |
@@ -3787,6 +3843,26 @@ sub process { | |||
3787 | "type '$tmp' should be specified in [[un]signed] [short|int|long|long long] order\n" . $herecurr); | 3843 | "type '$tmp' should be specified in [[un]signed] [short|int|long|long long] order\n" . $herecurr); |
3788 | } | 3844 | } |
3789 | 3845 | ||
3846 | # check for unnecessary <signed> int declarations of short/long/long long | ||
3847 | while ($sline =~ m{\b($TypeMisordered(\s*\*)*|$C90_int_types)\b}g) { | ||
3848 | my $type = trim($1); | ||
3849 | next if ($type !~ /\bint\b/); | ||
3850 | next if ($type !~ /\b(?:short|long\s+long|long)\b/); | ||
3851 | my $new_type = $type; | ||
3852 | $new_type =~ s/\b\s*int\s*\b/ /; | ||
3853 | $new_type =~ s/\b\s*(?:un)?signed\b\s*/ /; | ||
3854 | $new_type =~ s/^const\s+//; | ||
3855 | $new_type = "unsigned $new_type" if ($type =~ /\bunsigned\b/); | ||
3856 | $new_type = "const $new_type" if ($type =~ /^const\b/); | ||
3857 | $new_type =~ s/\s+/ /g; | ||
3858 | $new_type = trim($new_type); | ||
3859 | if (WARN("UNNECESSARY_INT", | ||
3860 | "Prefer '$new_type' over '$type' as the int is unnecessary\n" . $herecurr) && | ||
3861 | $fix) { | ||
3862 | $fixed[$fixlinenr] =~ s/\b\Q$type\E\b/$new_type/; | ||
3863 | } | ||
3864 | } | ||
3865 | |||
3790 | # check for static const char * arrays. | 3866 | # check for static const char * arrays. |
3791 | if ($line =~ /\bstatic\s+const\s+char\s*\*\s*(\w+)\s*\[\s*\]\s*=\s*/) { | 3867 | if ($line =~ /\bstatic\s+const\s+char\s*\*\s*(\w+)\s*\[\s*\]\s*=\s*/) { |
3792 | WARN("STATIC_CONST_CHAR_ARRAY", | 3868 | WARN("STATIC_CONST_CHAR_ARRAY", |
@@ -3973,7 +4049,7 @@ sub process { | |||
3973 | 4049 | ||
3974 | # function brace can't be on same line, except for #defines of do while, | 4050 | # function brace can't be on same line, except for #defines of do while, |
3975 | # or if closed on same line | 4051 | # or if closed on same line |
3976 | if ($^V && $^V ge 5.10.0 && | 4052 | if ($perl_version_ok && |
3977 | $sline =~ /$Type\s*$Ident\s*$balanced_parens\s*\{/ && | 4053 | $sline =~ /$Type\s*$Ident\s*$balanced_parens\s*\{/ && |
3978 | $sline !~ /\#\s*define\b.*do\s*\{/ && | 4054 | $sline !~ /\#\s*define\b.*do\s*\{/ && |
3979 | $sline !~ /}/) { | 4055 | $sline !~ /}/) { |
@@ -4489,11 +4565,11 @@ sub process { | |||
4489 | 4565 | ||
4490 | #need space before brace following if, while, etc | 4566 | #need space before brace following if, while, etc |
4491 | if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) || | 4567 | if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) || |
4492 | $line =~ /do\{/) { | 4568 | $line =~ /\b(?:else|do)\{/) { |
4493 | if (ERROR("SPACING", | 4569 | if (ERROR("SPACING", |
4494 | "space required before the open brace '{'\n" . $herecurr) && | 4570 | "space required before the open brace '{'\n" . $herecurr) && |
4495 | $fix) { | 4571 | $fix) { |
4496 | $fixed[$fixlinenr] =~ s/^(\+.*(?:do|\)))\{/$1 {/; | 4572 | $fixed[$fixlinenr] =~ s/^(\+.*(?:do|else|\)))\{/$1 {/; |
4497 | } | 4573 | } |
4498 | } | 4574 | } |
4499 | 4575 | ||
@@ -4584,7 +4660,7 @@ sub process { | |||
4584 | # check for unnecessary parentheses around comparisons in if uses | 4660 | # check for unnecessary parentheses around comparisons in if uses |
4585 | # when !drivers/staging or command-line uses --strict | 4661 | # when !drivers/staging or command-line uses --strict |
4586 | if (($realfile !~ m@^(?:drivers/staging/)@ || $check_orig) && | 4662 | if (($realfile !~ m@^(?:drivers/staging/)@ || $check_orig) && |
4587 | $^V && $^V ge 5.10.0 && defined($stat) && | 4663 | $perl_version_ok && defined($stat) && |
4588 | $stat =~ /(^.\s*if\s*($balanced_parens))/) { | 4664 | $stat =~ /(^.\s*if\s*($balanced_parens))/) { |
4589 | my $if_stat = $1; | 4665 | my $if_stat = $1; |
4590 | my $test = substr($2, 1, -1); | 4666 | my $test = substr($2, 1, -1); |
@@ -4621,7 +4697,7 @@ sub process { | |||
4621 | # return is not a function | 4697 | # return is not a function |
4622 | if (defined($stat) && $stat =~ /^.\s*return(\s*)\(/s) { | 4698 | if (defined($stat) && $stat =~ /^.\s*return(\s*)\(/s) { |
4623 | my $spacing = $1; | 4699 | my $spacing = $1; |
4624 | if ($^V && $^V ge 5.10.0 && | 4700 | if ($perl_version_ok && |
4625 | $stat =~ /^.\s*return\s*($balanced_parens)\s*;\s*$/) { | 4701 | $stat =~ /^.\s*return\s*($balanced_parens)\s*;\s*$/) { |
4626 | my $value = $1; | 4702 | my $value = $1; |
4627 | $value = deparenthesize($value); | 4703 | $value = deparenthesize($value); |
@@ -4648,7 +4724,7 @@ sub process { | |||
4648 | } | 4724 | } |
4649 | 4725 | ||
4650 | # if statements using unnecessary parentheses - ie: if ((foo == bar)) | 4726 | # if statements using unnecessary parentheses - ie: if ((foo == bar)) |
4651 | if ($^V && $^V ge 5.10.0 && | 4727 | if ($perl_version_ok && |
4652 | $line =~ /\bif\s*((?:\(\s*){2,})/) { | 4728 | $line =~ /\bif\s*((?:\(\s*){2,})/) { |
4653 | my $openparens = $1; | 4729 | my $openparens = $1; |
4654 | my $count = $openparens =~ tr@\(@\(@; | 4730 | my $count = $openparens =~ tr@\(@\(@; |
@@ -4665,7 +4741,7 @@ sub process { | |||
4665 | # avoid cases like "foo + BAR < baz" | 4741 | # avoid cases like "foo + BAR < baz" |
4666 | # only fix matches surrounded by parentheses to avoid incorrect | 4742 | # only fix matches surrounded by parentheses to avoid incorrect |
4667 | # conversions like "FOO < baz() + 5" being "misfixed" to "baz() > FOO + 5" | 4743 | # conversions like "FOO < baz() + 5" being "misfixed" to "baz() > FOO + 5" |
4668 | if ($^V && $^V ge 5.10.0 && | 4744 | if ($perl_version_ok && |
4669 | $line =~ /^\+(.*)\b($Constant|[A-Z_][A-Z0-9_]*)\s*($Compare)\s*($LvalOrFunc)/) { | 4745 | $line =~ /^\+(.*)\b($Constant|[A-Z_][A-Z0-9_]*)\s*($Compare)\s*($LvalOrFunc)/) { |
4670 | my $lead = $1; | 4746 | my $lead = $1; |
4671 | my $const = $2; | 4747 | my $const = $2; |
@@ -4955,6 +5031,7 @@ sub process { | |||
4955 | if (defined $define_args && $define_args ne "") { | 5031 | if (defined $define_args && $define_args ne "") { |
4956 | $define_args = substr($define_args, 1, length($define_args) - 2); | 5032 | $define_args = substr($define_args, 1, length($define_args) - 2); |
4957 | $define_args =~ s/\s*//g; | 5033 | $define_args =~ s/\s*//g; |
5034 | $define_args =~ s/\\\+?//g; | ||
4958 | @def_args = split(",", $define_args); | 5035 | @def_args = split(",", $define_args); |
4959 | } | 5036 | } |
4960 | 5037 | ||
@@ -5090,7 +5167,7 @@ sub process { | |||
5090 | # do {} while (0) macro tests: | 5167 | # do {} while (0) macro tests: |
5091 | # single-statement macros do not need to be enclosed in do while (0) loop, | 5168 | # single-statement macros do not need to be enclosed in do while (0) loop, |
5092 | # macro should not end with a semicolon | 5169 | # macro should not end with a semicolon |
5093 | if ($^V && $^V ge 5.10.0 && | 5170 | if ($perl_version_ok && |
5094 | $realfile !~ m@/vmlinux.lds.h$@ && | 5171 | $realfile !~ m@/vmlinux.lds.h$@ && |
5095 | $line =~ /^.\s*\#\s*define\s+$Ident(\()?/) { | 5172 | $line =~ /^.\s*\#\s*define\s+$Ident(\()?/) { |
5096 | my $ln = $linenr; | 5173 | my $ln = $linenr; |
@@ -5336,15 +5413,28 @@ sub process { | |||
5336 | } | 5413 | } |
5337 | 5414 | ||
5338 | # concatenated string without spaces between elements | 5415 | # concatenated string without spaces between elements |
5339 | if ($line =~ /$String[A-Z_]/ || $line =~ /[A-Za-z0-9_]$String/) { | 5416 | if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /[A-Za-z0-9_]$String/) { |
5340 | CHK("CONCATENATED_STRING", | 5417 | if (CHK("CONCATENATED_STRING", |
5341 | "Concatenated strings should use spaces between elements\n" . $herecurr); | 5418 | "Concatenated strings should use spaces between elements\n" . $herecurr) && |
5419 | $fix) { | ||
5420 | while ($line =~ /($String)/g) { | ||
5421 | my $extracted_string = substr($rawline, $-[0], $+[0] - $-[0]); | ||
5422 | $fixed[$fixlinenr] =~ s/\Q$extracted_string\E([A-Za-z0-9_])/$extracted_string $1/; | ||
5423 | $fixed[$fixlinenr] =~ s/([A-Za-z0-9_])\Q$extracted_string\E/$1 $extracted_string/; | ||
5424 | } | ||
5425 | } | ||
5342 | } | 5426 | } |
5343 | 5427 | ||
5344 | # uncoalesced string fragments | 5428 | # uncoalesced string fragments |
5345 | if ($line =~ /$String\s*"/) { | 5429 | if ($line =~ /$String\s*"/) { |
5346 | WARN("STRING_FRAGMENTS", | 5430 | if (WARN("STRING_FRAGMENTS", |
5347 | "Consecutive strings are generally better as a single string\n" . $herecurr); | 5431 | "Consecutive strings are generally better as a single string\n" . $herecurr) && |
5432 | $fix) { | ||
5433 | while ($line =~ /($String)(?=\s*")/g) { | ||
5434 | my $extracted_string = substr($rawline, $-[0], $+[0] - $-[0]); | ||
5435 | $fixed[$fixlinenr] =~ s/\Q$extracted_string\E\s*"/substr($extracted_string, 0, -1)/e; | ||
5436 | } | ||
5437 | } | ||
5348 | } | 5438 | } |
5349 | 5439 | ||
5350 | # check for non-standard and hex prefixed decimal printf formats | 5440 | # check for non-standard and hex prefixed decimal printf formats |
@@ -5380,9 +5470,14 @@ sub process { | |||
5380 | 5470 | ||
5381 | # warn about #if 0 | 5471 | # warn about #if 0 |
5382 | if ($line =~ /^.\s*\#\s*if\s+0\b/) { | 5472 | if ($line =~ /^.\s*\#\s*if\s+0\b/) { |
5383 | CHK("REDUNDANT_CODE", | 5473 | WARN("IF_0", |
5384 | "if this code is redundant consider removing it\n" . | 5474 | "Consider removing the code enclosed by this #if 0 and its #endif\n" . $herecurr); |
5385 | $herecurr); | 5475 | } |
5476 | |||
5477 | # warn about #if 1 | ||
5478 | if ($line =~ /^.\s*\#\s*if\s+1\b/) { | ||
5479 | WARN("IF_1", | ||
5480 | "Consider removing the #if 1 and its #endif\n" . $herecurr); | ||
5386 | } | 5481 | } |
5387 | 5482 | ||
5388 | # check for needless "if (<foo>) fn(<foo>)" uses | 5483 | # check for needless "if (<foo>) fn(<foo>)" uses |
@@ -5453,7 +5548,7 @@ sub process { | |||
5453 | } | 5548 | } |
5454 | 5549 | ||
5455 | # check for mask then right shift without a parentheses | 5550 | # check for mask then right shift without a parentheses |
5456 | if ($^V && $^V ge 5.10.0 && | 5551 | if ($perl_version_ok && |
5457 | $line =~ /$LvalOrFunc\s*\&\s*($LvalOrFunc)\s*>>/ && | 5552 | $line =~ /$LvalOrFunc\s*\&\s*($LvalOrFunc)\s*>>/ && |
5458 | $4 !~ /^\&/) { # $LvalOrFunc may be &foo, ignore if so | 5553 | $4 !~ /^\&/) { # $LvalOrFunc may be &foo, ignore if so |
5459 | WARN("MASK_THEN_SHIFT", | 5554 | WARN("MASK_THEN_SHIFT", |
@@ -5461,7 +5556,7 @@ sub process { | |||
5461 | } | 5556 | } |
5462 | 5557 | ||
5463 | # check for pointer comparisons to NULL | 5558 | # check for pointer comparisons to NULL |
5464 | if ($^V && $^V ge 5.10.0) { | 5559 | if ($perl_version_ok) { |
5465 | while ($line =~ /\b$LvalOrFunc\s*(==|\!=)\s*NULL\b/g) { | 5560 | while ($line =~ /\b$LvalOrFunc\s*(==|\!=)\s*NULL\b/g) { |
5466 | my $val = $1; | 5561 | my $val = $1; |
5467 | my $equal = "!"; | 5562 | my $equal = "!"; |
@@ -5733,7 +5828,7 @@ sub process { | |||
5733 | } | 5828 | } |
5734 | 5829 | ||
5735 | # Check for __attribute__ weak, or __weak declarations (may have link issues) | 5830 | # Check for __attribute__ weak, or __weak declarations (may have link issues) |
5736 | if ($^V && $^V ge 5.10.0 && | 5831 | if ($perl_version_ok && |
5737 | $line =~ /(?:$Declare|$DeclareMisordered)\s*$Ident\s*$balanced_parens\s*(?:$Attribute)?\s*;/ && | 5832 | $line =~ /(?:$Declare|$DeclareMisordered)\s*$Ident\s*$balanced_parens\s*(?:$Attribute)?\s*;/ && |
5738 | ($line =~ /\b__attribute__\s*\(\s*\(.*\bweak\b/ || | 5833 | ($line =~ /\b__attribute__\s*\(\s*\(.*\bweak\b/ || |
5739 | $line =~ /\b__weak\b/)) { | 5834 | $line =~ /\b__weak\b/)) { |
@@ -5815,18 +5910,18 @@ sub process { | |||
5815 | } | 5910 | } |
5816 | 5911 | ||
5817 | # check for vsprintf extension %p<foo> misuses | 5912 | # check for vsprintf extension %p<foo> misuses |
5818 | if ($^V && $^V ge 5.10.0 && | 5913 | if ($perl_version_ok && |
5819 | defined $stat && | 5914 | defined $stat && |
5820 | $stat =~ /^\+(?![^\{]*\{\s*).*\b(\w+)\s*\(.*$String\s*,/s && | 5915 | $stat =~ /^\+(?![^\{]*\{\s*).*\b(\w+)\s*\(.*$String\s*,/s && |
5821 | $1 !~ /^_*volatile_*$/) { | 5916 | $1 !~ /^_*volatile_*$/) { |
5822 | my $specifier; | ||
5823 | my $extension; | ||
5824 | my $bad_specifier = ""; | ||
5825 | my $stat_real; | 5917 | my $stat_real; |
5826 | 5918 | ||
5827 | my $lc = $stat =~ tr@\n@@; | 5919 | my $lc = $stat =~ tr@\n@@; |
5828 | $lc = $lc + $linenr; | 5920 | $lc = $lc + $linenr; |
5829 | for (my $count = $linenr; $count <= $lc; $count++) { | 5921 | for (my $count = $linenr; $count <= $lc; $count++) { |
5922 | my $specifier; | ||
5923 | my $extension; | ||
5924 | my $bad_specifier = ""; | ||
5830 | my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0)); | 5925 | my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0)); |
5831 | $fmt =~ s/%%//g; | 5926 | $fmt =~ s/%%//g; |
5832 | 5927 | ||
@@ -5862,7 +5957,7 @@ sub process { | |||
5862 | } | 5957 | } |
5863 | 5958 | ||
5864 | # Check for misused memsets | 5959 | # Check for misused memsets |
5865 | if ($^V && $^V ge 5.10.0 && | 5960 | if ($perl_version_ok && |
5866 | defined $stat && | 5961 | defined $stat && |
5867 | $stat =~ /^\+(?:.*?)\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*$FuncArg\s*\)/) { | 5962 | $stat =~ /^\+(?:.*?)\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*$FuncArg\s*\)/) { |
5868 | 5963 | ||
@@ -5880,7 +5975,7 @@ sub process { | |||
5880 | } | 5975 | } |
5881 | 5976 | ||
5882 | # Check for memcpy(foo, bar, ETH_ALEN) that could be ether_addr_copy(foo, bar) | 5977 | # Check for memcpy(foo, bar, ETH_ALEN) that could be ether_addr_copy(foo, bar) |
5883 | # if ($^V && $^V ge 5.10.0 && | 5978 | # if ($perl_version_ok && |
5884 | # defined $stat && | 5979 | # defined $stat && |
5885 | # $stat =~ /^\+(?:.*?)\bmemcpy\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) { | 5980 | # $stat =~ /^\+(?:.*?)\bmemcpy\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) { |
5886 | # if (WARN("PREFER_ETHER_ADDR_COPY", | 5981 | # if (WARN("PREFER_ETHER_ADDR_COPY", |
@@ -5891,7 +5986,7 @@ sub process { | |||
5891 | # } | 5986 | # } |
5892 | 5987 | ||
5893 | # Check for memcmp(foo, bar, ETH_ALEN) that could be ether_addr_equal*(foo, bar) | 5988 | # Check for memcmp(foo, bar, ETH_ALEN) that could be ether_addr_equal*(foo, bar) |
5894 | # if ($^V && $^V ge 5.10.0 && | 5989 | # if ($perl_version_ok && |
5895 | # defined $stat && | 5990 | # defined $stat && |
5896 | # $stat =~ /^\+(?:.*?)\bmemcmp\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) { | 5991 | # $stat =~ /^\+(?:.*?)\bmemcmp\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) { |
5897 | # WARN("PREFER_ETHER_ADDR_EQUAL", | 5992 | # WARN("PREFER_ETHER_ADDR_EQUAL", |
@@ -5900,7 +5995,7 @@ sub process { | |||
5900 | 5995 | ||
5901 | # check for memset(foo, 0x0, ETH_ALEN) that could be eth_zero_addr | 5996 | # check for memset(foo, 0x0, ETH_ALEN) that could be eth_zero_addr |
5902 | # check for memset(foo, 0xFF, ETH_ALEN) that could be eth_broadcast_addr | 5997 | # check for memset(foo, 0xFF, ETH_ALEN) that could be eth_broadcast_addr |
5903 | # if ($^V && $^V ge 5.10.0 && | 5998 | # if ($perl_version_ok && |
5904 | # defined $stat && | 5999 | # defined $stat && |
5905 | # $stat =~ /^\+(?:.*?)\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) { | 6000 | # $stat =~ /^\+(?:.*?)\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) { |
5906 | # | 6001 | # |
@@ -5922,7 +6017,7 @@ sub process { | |||
5922 | # } | 6017 | # } |
5923 | 6018 | ||
5924 | # typecasts on min/max could be min_t/max_t | 6019 | # typecasts on min/max could be min_t/max_t |
5925 | if ($^V && $^V ge 5.10.0 && | 6020 | if ($perl_version_ok && |
5926 | defined $stat && | 6021 | defined $stat && |
5927 | $stat =~ /^\+(?:.*?)\b(min|max)\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\)/) { | 6022 | $stat =~ /^\+(?:.*?)\b(min|max)\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\)/) { |
5928 | if (defined $2 || defined $7) { | 6023 | if (defined $2 || defined $7) { |
@@ -5946,7 +6041,7 @@ sub process { | |||
5946 | } | 6041 | } |
5947 | 6042 | ||
5948 | # check usleep_range arguments | 6043 | # check usleep_range arguments |
5949 | if ($^V && $^V ge 5.10.0 && | 6044 | if ($perl_version_ok && |
5950 | defined $stat && | 6045 | defined $stat && |
5951 | $stat =~ /^\+(?:.*?)\busleep_range\s*\(\s*($FuncArg)\s*,\s*($FuncArg)\s*\)/) { | 6046 | $stat =~ /^\+(?:.*?)\busleep_range\s*\(\s*($FuncArg)\s*,\s*($FuncArg)\s*\)/) { |
5952 | my $min = $1; | 6047 | my $min = $1; |
@@ -5962,7 +6057,7 @@ sub process { | |||
5962 | } | 6057 | } |
5963 | 6058 | ||
5964 | # check for naked sscanf | 6059 | # check for naked sscanf |
5965 | if ($^V && $^V ge 5.10.0 && | 6060 | if ($perl_version_ok && |
5966 | defined $stat && | 6061 | defined $stat && |
5967 | $line =~ /\bsscanf\b/ && | 6062 | $line =~ /\bsscanf\b/ && |
5968 | ($stat !~ /$Ident\s*=\s*sscanf\s*$balanced_parens/ && | 6063 | ($stat !~ /$Ident\s*=\s*sscanf\s*$balanced_parens/ && |
@@ -5976,7 +6071,7 @@ sub process { | |||
5976 | } | 6071 | } |
5977 | 6072 | ||
5978 | # check for simple sscanf that should be kstrto<foo> | 6073 | # check for simple sscanf that should be kstrto<foo> |
5979 | if ($^V && $^V ge 5.10.0 && | 6074 | if ($perl_version_ok && |
5980 | defined $stat && | 6075 | defined $stat && |
5981 | $line =~ /\bsscanf\b/) { | 6076 | $line =~ /\bsscanf\b/) { |
5982 | my $lc = $stat =~ tr@\n@@; | 6077 | my $lc = $stat =~ tr@\n@@; |
@@ -6048,7 +6143,7 @@ sub process { | |||
6048 | } | 6143 | } |
6049 | 6144 | ||
6050 | # check for function definitions | 6145 | # check for function definitions |
6051 | if ($^V && $^V ge 5.10.0 && | 6146 | if ($perl_version_ok && |
6052 | defined $stat && | 6147 | defined $stat && |
6053 | $stat =~ /^.\s*(?:$Storage\s+)?$Type\s*($Ident)\s*$balanced_parens\s*{/s) { | 6148 | $stat =~ /^.\s*(?:$Storage\s+)?$Type\s*($Ident)\s*$balanced_parens\s*{/s) { |
6054 | $context_function = $1; | 6149 | $context_function = $1; |
@@ -6088,14 +6183,14 @@ sub process { | |||
6088 | 6183 | ||
6089 | # alloc style | 6184 | # alloc style |
6090 | # p = alloc(sizeof(struct foo), ...) should be p = alloc(sizeof(*p), ...) | 6185 | # p = alloc(sizeof(struct foo), ...) should be p = alloc(sizeof(*p), ...) |
6091 | if ($^V && $^V ge 5.10.0 && | 6186 | if ($perl_version_ok && |
6092 | $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*([kv][mz]alloc(?:_node)?)\s*\(\s*(sizeof\s*\(\s*struct\s+$Lval\s*\))/) { | 6187 | $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*([kv][mz]alloc(?:_node)?)\s*\(\s*(sizeof\s*\(\s*struct\s+$Lval\s*\))/) { |
6093 | CHK("ALLOC_SIZEOF_STRUCT", | 6188 | CHK("ALLOC_SIZEOF_STRUCT", |
6094 | "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr); | 6189 | "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr); |
6095 | } | 6190 | } |
6096 | 6191 | ||
6097 | # check for k[mz]alloc with multiplies that could be kmalloc_array/kcalloc | 6192 | # check for k[mz]alloc with multiplies that could be kmalloc_array/kcalloc |
6098 | if ($^V && $^V ge 5.10.0 && | 6193 | if ($perl_version_ok && |
6099 | defined $stat && | 6194 | defined $stat && |
6100 | $stat =~ /^\+\s*($Lval)\s*\=\s*(?:$balanced_parens)?\s*(k[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)\s*,/) { | 6195 | $stat =~ /^\+\s*($Lval)\s*\=\s*(?:$balanced_parens)?\s*(k[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)\s*,/) { |
6101 | my $oldfunc = $3; | 6196 | my $oldfunc = $3; |
@@ -6124,8 +6219,9 @@ sub process { | |||
6124 | } | 6219 | } |
6125 | 6220 | ||
6126 | # check for krealloc arg reuse | 6221 | # check for krealloc arg reuse |
6127 | if ($^V && $^V ge 5.10.0 && | 6222 | if ($perl_version_ok && |
6128 | $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*krealloc\s*\(\s*\1\s*,/) { | 6223 | $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*krealloc\s*\(\s*($Lval)\s*,/ && |
6224 | $1 eq $3) { | ||
6129 | WARN("KREALLOC_ARG_REUSE", | 6225 | WARN("KREALLOC_ARG_REUSE", |
6130 | "Reusing the krealloc arg is almost always a bug\n" . $herecurr); | 6226 | "Reusing the krealloc arg is almost always a bug\n" . $herecurr); |
6131 | } | 6227 | } |
@@ -6193,7 +6289,7 @@ sub process { | |||
6193 | } | 6289 | } |
6194 | 6290 | ||
6195 | # check for switch/default statements without a break; | 6291 | # check for switch/default statements without a break; |
6196 | if ($^V && $^V ge 5.10.0 && | 6292 | if ($perl_version_ok && |
6197 | defined $stat && | 6293 | defined $stat && |
6198 | $stat =~ /^\+[$;\s]*(?:case[$;\s]+\w+[$;\s]*:[$;\s]*|)*[$;\s]*\bdefault[$;\s]*:[$;\s]*;/g) { | 6294 | $stat =~ /^\+[$;\s]*(?:case[$;\s]+\w+[$;\s]*:[$;\s]*|)*[$;\s]*\bdefault[$;\s]*:[$;\s]*;/g) { |
6199 | my $cnt = statement_rawlines($stat); | 6295 | my $cnt = statement_rawlines($stat); |
@@ -6257,6 +6353,13 @@ sub process { | |||
6257 | "Avoid using bool as bitfield. Prefer bool bitfields as unsigned int or u<8|16|32>\n" . $herecurr); | 6353 | "Avoid using bool as bitfield. Prefer bool bitfields as unsigned int or u<8|16|32>\n" . $herecurr); |
6258 | } | 6354 | } |
6259 | 6355 | ||
6356 | # check for bool use in .h files | ||
6357 | if ($realfile =~ /\.h$/ && | ||
6358 | $sline =~ /^.\s+bool\s*$Ident\s*(?::\s*d+\s*)?;/) { | ||
6359 | CHK("BOOL_MEMBER", | ||
6360 | "Avoid using bool structure members because of possible alignment issues - see: https://lkml.org/lkml/2017/11/21/384\n" . $herecurr); | ||
6361 | } | ||
6362 | |||
6260 | # check for semaphores initialized locked | 6363 | # check for semaphores initialized locked |
6261 | if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) { | 6364 | if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) { |
6262 | WARN("CONSIDER_COMPLETION", | 6365 | WARN("CONSIDER_COMPLETION", |
@@ -6303,7 +6406,7 @@ sub process { | |||
6303 | } | 6406 | } |
6304 | 6407 | ||
6305 | # likely/unlikely comparisons similar to "(likely(foo) > 0)" | 6408 | # likely/unlikely comparisons similar to "(likely(foo) > 0)" |
6306 | if ($^V && $^V ge 5.10.0 && | 6409 | if ($perl_version_ok && |
6307 | $line =~ /\b((?:un)?likely)\s*\(\s*$FuncArg\s*\)\s*$Compare/) { | 6410 | $line =~ /\b((?:un)?likely)\s*\(\s*$FuncArg\s*\)\s*$Compare/) { |
6308 | WARN("LIKELY_MISUSE", | 6411 | WARN("LIKELY_MISUSE", |
6309 | "Using $1 should generally have parentheses around the comparison\n" . $herecurr); | 6412 | "Using $1 should generally have parentheses around the comparison\n" . $herecurr); |
@@ -6346,7 +6449,7 @@ sub process { | |||
6346 | # check for DEVICE_ATTR uses that could be DEVICE_ATTR_<FOO> | 6449 | # check for DEVICE_ATTR uses that could be DEVICE_ATTR_<FOO> |
6347 | # and whether or not function naming is typical and if | 6450 | # and whether or not function naming is typical and if |
6348 | # DEVICE_ATTR permissions uses are unusual too | 6451 | # DEVICE_ATTR permissions uses are unusual too |
6349 | if ($^V && $^V ge 5.10.0 && | 6452 | if ($perl_version_ok && |
6350 | defined $stat && | 6453 | defined $stat && |
6351 | $stat =~ /\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?\s*(\s*(?:${multi_mode_perms_string_search}|0[0-7]{3,3})\s*)\s*\)?\s*,\s*(\w+)\s*,\s*(\w+)\s*\)/) { | 6454 | $stat =~ /\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?\s*(\s*(?:${multi_mode_perms_string_search}|0[0-7]{3,3})\s*)\s*\)?\s*,\s*(\w+)\s*,\s*(\w+)\s*\)/) { |
6352 | my $var = $1; | 6455 | my $var = $1; |
@@ -6406,7 +6509,7 @@ sub process { | |||
6406 | # specific definition of not visible in sysfs. | 6509 | # specific definition of not visible in sysfs. |
6407 | # o Ignore proc_create*(...) uses with a decimal 0 permission as that means | 6510 | # o Ignore proc_create*(...) uses with a decimal 0 permission as that means |
6408 | # use the default permissions | 6511 | # use the default permissions |
6409 | if ($^V && $^V ge 5.10.0 && | 6512 | if ($perl_version_ok && |
6410 | defined $stat && | 6513 | defined $stat && |
6411 | $line =~ /$mode_perms_search/) { | 6514 | $line =~ /$mode_perms_search/) { |
6412 | foreach my $entry (@mode_permission_funcs) { | 6515 | foreach my $entry (@mode_permission_funcs) { |
@@ -6492,9 +6595,14 @@ sub process { | |||
6492 | ERROR("NOT_UNIFIED_DIFF", | 6595 | ERROR("NOT_UNIFIED_DIFF", |
6493 | "Does not appear to be a unified-diff format patch\n"); | 6596 | "Does not appear to be a unified-diff format patch\n"); |
6494 | } | 6597 | } |
6495 | if ($is_patch && $has_commit_log && $chk_signoff && $signoff == 0) { | 6598 | if ($is_patch && $has_commit_log && $chk_signoff) { |
6496 | ERROR("MISSING_SIGN_OFF", | 6599 | if ($signoff == 0) { |
6497 | "Missing Signed-off-by: line(s)\n"); | 6600 | ERROR("MISSING_SIGN_OFF", |
6601 | "Missing Signed-off-by: line(s)\n"); | ||
6602 | } elsif (!$authorsignoff) { | ||
6603 | WARN("NO_AUTHOR_SIGN_OFF", | ||
6604 | "Missing Signed-off-by: line by nominal patch author '$author'\n"); | ||
6605 | } | ||
6498 | } | 6606 | } |
6499 | 6607 | ||
6500 | print report_dump(); | 6608 | print report_dump(); |
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl index cbdf0dfd4c22..8081b6cf67d2 100755 --- a/scripts/checkstack.pl +++ b/scripts/checkstack.pl | |||
@@ -15,6 +15,7 @@ | |||
15 | # M68k port by Geert Uytterhoeven and Andreas Schwab | 15 | # M68k port by Geert Uytterhoeven and Andreas Schwab |
16 | # AArch64, PARISC ports by Kyle McMartin | 16 | # AArch64, PARISC ports by Kyle McMartin |
17 | # sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk> | 17 | # sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk> |
18 | # ppc64le port by Breno Leitao <leitao@debian.org> | ||
18 | # | 19 | # |
19 | # Usage: | 20 | # Usage: |
20 | # objdump -d vmlinux | scripts/checkstack.pl [arch] | 21 | # objdump -d vmlinux | scripts/checkstack.pl [arch] |
@@ -78,13 +79,9 @@ my (@stack, $re, $dre, $x, $xs, $funcre); | |||
78 | $re = qr/.*l\.addi.*r1,r1,-(([0-9]{2}|[3-9])[0-9]{2})/o; | 79 | $re = qr/.*l\.addi.*r1,r1,-(([0-9]{2}|[3-9])[0-9]{2})/o; |
79 | } elsif ($arch eq 'parisc' || $arch eq 'parisc64') { | 80 | } elsif ($arch eq 'parisc' || $arch eq 'parisc64') { |
80 | $re = qr/.*ldo ($x{1,8})\(sp\),sp/o; | 81 | $re = qr/.*ldo ($x{1,8})\(sp\),sp/o; |
81 | } elsif ($arch eq 'ppc') { | 82 | } elsif ($arch eq 'powerpc' || $arch =~ /^ppc(64)?(le)?$/ ) { |
82 | #c00029f4: 94 21 ff 30 stwu r1,-208(r1) | 83 | # powerpc : 94 21 ff 30 stwu r1,-208(r1) |
83 | $re = qr/.*stwu.*r1,-($x{1,8})\(r1\)/o; | 84 | # ppc64(le) : 81 ff 21 f8 stdu r1,-128(r1) |
84 | } elsif ($arch eq 'ppc64') { | ||
85 | #XXX | ||
86 | $re = qr/.*stdu.*r1,-($x{1,8})\(r1\)/o; | ||
87 | } elsif ($arch eq 'powerpc') { | ||
88 | $re = qr/.*st[dw]u.*r1,-($x{1,8})\(r1\)/o; | 85 | $re = qr/.*st[dw]u.*r1,-($x{1,8})\(r1\)/o; |
89 | } elsif ($arch =~ /^s390x?$/) { | 86 | } elsif ($arch =~ /^s390x?$/) { |
90 | # 11160: a7 fb ff 60 aghi %r15,-160 | 87 | # 11160: a7 fb ff 60 aghi %r15,-160 |
diff --git a/scripts/clang-version.sh b/scripts/clang-version.sh index dbf0a31eb111..e65fbc3079d4 100755 --- a/scripts/clang-version.sh +++ b/scripts/clang-version.sh | |||
@@ -12,7 +12,7 @@ | |||
12 | 12 | ||
13 | compiler="$*" | 13 | compiler="$*" |
14 | 14 | ||
15 | if !( $compiler --version | grep -q clang) ; then | 15 | if ! ( $compiler --version | grep -q clang) ; then |
16 | echo 0 | 16 | echo 0 |
17 | exit 1 | 17 | exit 1 |
18 | fi | 18 | fi |
diff --git a/scripts/coccicheck b/scripts/coccicheck index 9fedca611b7f..e04d328210ac 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck | |||
@@ -128,9 +128,10 @@ run_cmd_parmap() { | |||
128 | fi | 128 | fi |
129 | echo $@ >>$DEBUG_FILE | 129 | echo $@ >>$DEBUG_FILE |
130 | $@ 2>>$DEBUG_FILE | 130 | $@ 2>>$DEBUG_FILE |
131 | if [[ $? -ne 0 ]]; then | 131 | err=$? |
132 | if [[ $err -ne 0 ]]; then | ||
132 | echo "coccicheck failed" | 133 | echo "coccicheck failed" |
133 | exit $? | 134 | exit $err |
134 | fi | 135 | fi |
135 | } | 136 | } |
136 | 137 | ||
diff --git a/scripts/coccinelle/api/alloc/zalloc-simple.cocci b/scripts/coccinelle/api/alloc/zalloc-simple.cocci index 92b20913055f..d819275b7fde 100644 --- a/scripts/coccinelle/api/alloc/zalloc-simple.cocci +++ b/scripts/coccinelle/api/alloc/zalloc-simple.cocci | |||
@@ -35,8 +35,7 @@ statement S; | |||
35 | 35 | ||
36 | * x = (T)\(kmalloc(E1, ...)\|vmalloc(E1)\|dma_alloc_coherent(...,E1,...)\| | 36 | * x = (T)\(kmalloc(E1, ...)\|vmalloc(E1)\|dma_alloc_coherent(...,E1,...)\| |
37 | kmalloc_node(E1, ...)\|kmem_cache_alloc(...)\|kmem_alloc(E1, ...)\| | 37 | kmalloc_node(E1, ...)\|kmem_cache_alloc(...)\|kmem_alloc(E1, ...)\| |
38 | devm_kmalloc(...,E1,...)\|kvmalloc(E1, ...)\|pci_alloc_consistent(...,E1,...)\| | 38 | devm_kmalloc(...,E1,...)\|kvmalloc(E1, ...)\|kvmalloc_node(E1,...)\); |
39 | kvmalloc_node(E1,...)\); | ||
40 | if ((x==NULL) || ...) S | 39 | if ((x==NULL) || ...) S |
41 | * memset((T2)x,0,E1); | 40 | * memset((T2)x,0,E1); |
42 | 41 | ||
@@ -124,15 +123,6 @@ statement S; | |||
124 | - x = (T)kvmalloc(E1,E2); | 123 | - x = (T)kvmalloc(E1,E2); |
125 | + x = (T)kvzalloc(E1,E2); | 124 | + x = (T)kvzalloc(E1,E2); |
126 | | | 125 | | |
127 | - x = pci_alloc_consistent(E2,E1,E3); | ||
128 | + x = pci_zalloc_consistent(E2,E1,E3); | ||
129 | | | ||
130 | - x = (T *)pci_alloc_consistent(E2,E1,E3); | ||
131 | + x = pci_zalloc_consistent(E2,E1,E3); | ||
132 | | | ||
133 | - x = (T)pci_alloc_consistent(E2,E1,E3); | ||
134 | + x = (T)pci_zalloc_consistent(E2,E1,E3); | ||
135 | | | ||
136 | - x = kvmalloc_node(E1,E2,E3); | 126 | - x = kvmalloc_node(E1,E2,E3); |
137 | + x = kvzalloc_node(E1,E2,E3); | 127 | + x = kvzalloc_node(E1,E2,E3); |
138 | | | 128 | | |
@@ -389,35 +379,6 @@ msg="WARNING: kvzalloc should be used for %s, instead of kvmalloc/memset" % (x) | |||
389 | coccilib.report.print_report(p[0], msg) | 379 | coccilib.report.print_report(p[0], msg) |
390 | 380 | ||
391 | //----------------------------------------------------------------- | 381 | //----------------------------------------------------------------- |
392 | @r8 depends on org || report@ | ||
393 | type T, T2; | ||
394 | expression x; | ||
395 | expression E1,E2,E3; | ||
396 | statement S; | ||
397 | position p; | ||
398 | @@ | ||
399 | |||
400 | x = (T)pci_alloc_consistent@p(E2,E1,E3); | ||
401 | if ((x==NULL) || ...) S | ||
402 | memset((T2)x,0,E1); | ||
403 | |||
404 | @script:python depends on org@ | ||
405 | p << r8.p; | ||
406 | x << r8.x; | ||
407 | @@ | ||
408 | |||
409 | msg="%s" % (x) | ||
410 | msg_safe=msg.replace("[","@(").replace("]",")") | ||
411 | coccilib.org.print_todo(p[0], msg_safe) | ||
412 | |||
413 | @script:python depends on report@ | ||
414 | p << r8.p; | ||
415 | x << r8.x; | ||
416 | @@ | ||
417 | |||
418 | msg="WARNING: pci_zalloc_consistent should be used for %s, instead of pci_alloc_consistent/memset" % (x) | ||
419 | coccilib.report.print_report(p[0], msg) | ||
420 | //----------------------------------------------------------------- | ||
421 | @r9 depends on org || report@ | 382 | @r9 depends on org || report@ |
422 | type T, T2; | 383 | type T, T2; |
423 | expression x; | 384 | expression x; |
diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci new file mode 100644 index 000000000000..988120e0fd67 --- /dev/null +++ b/scripts/coccinelle/api/atomic_as_refcounter.cocci | |||
@@ -0,0 +1,129 @@ | |||
1 | // Check if refcount_t type and API should be used | ||
2 | // instead of atomic_t type when dealing with refcounters | ||
3 | // | ||
4 | // Copyright (c) 2016-2017, Elena Reshetova, Intel Corporation | ||
5 | // | ||
6 | // Confidence: Moderate | ||
7 | // URL: http://coccinelle.lip6.fr/ | ||
8 | // Options: --include-headers --very-quiet | ||
9 | |||
10 | virtual report | ||
11 | |||
12 | @r1 exists@ | ||
13 | identifier a, x; | ||
14 | position p1, p2; | ||
15 | identifier fname =~ ".*free.*"; | ||
16 | identifier fname2 =~ ".*destroy.*"; | ||
17 | identifier fname3 =~ ".*del.*"; | ||
18 | identifier fname4 =~ ".*queue_work.*"; | ||
19 | identifier fname5 =~ ".*schedule_work.*"; | ||
20 | identifier fname6 =~ ".*call_rcu.*"; | ||
21 | |||
22 | @@ | ||
23 | |||
24 | ( | ||
25 | atomic_dec_and_test@p1(&(a)->x) | ||
26 | | | ||
27 | atomic_dec_and_lock@p1(&(a)->x, ...) | ||
28 | | | ||
29 | atomic_long_dec_and_lock@p1(&(a)->x, ...) | ||
30 | | | ||
31 | atomic_long_dec_and_test@p1(&(a)->x) | ||
32 | | | ||
33 | atomic64_dec_and_test@p1(&(a)->x) | ||
34 | | | ||
35 | local_dec_and_test@p1(&(a)->x) | ||
36 | ) | ||
37 | ... | ||
38 | ( | ||
39 | fname@p2(a, ...); | ||
40 | | | ||
41 | fname2@p2(...); | ||
42 | | | ||
43 | fname3@p2(...); | ||
44 | | | ||
45 | fname4@p2(...); | ||
46 | | | ||
47 | fname5@p2(...); | ||
48 | | | ||
49 | fname6@p2(...); | ||
50 | ) | ||
51 | |||
52 | |||
53 | @script:python depends on report@ | ||
54 | p1 << r1.p1; | ||
55 | p2 << r1.p2; | ||
56 | @@ | ||
57 | msg = "atomic_dec_and_test variation before object free at line %s." | ||
58 | coccilib.report.print_report(p1[0], msg % (p2[0].line)) | ||
59 | |||
60 | @r4 exists@ | ||
61 | identifier a, x, y; | ||
62 | position p1, p2; | ||
63 | identifier fname =~ ".*free.*"; | ||
64 | |||
65 | @@ | ||
66 | |||
67 | ( | ||
68 | atomic_dec_and_test@p1(&(a)->x) | ||
69 | | | ||
70 | atomic_dec_and_lock@p1(&(a)->x, ...) | ||
71 | | | ||
72 | atomic_long_dec_and_lock@p1(&(a)->x, ...) | ||
73 | | | ||
74 | atomic_long_dec_and_test@p1(&(a)->x) | ||
75 | | | ||
76 | atomic64_dec_and_test@p1(&(a)->x) | ||
77 | | | ||
78 | local_dec_and_test@p1(&(a)->x) | ||
79 | ) | ||
80 | ... | ||
81 | y=a | ||
82 | ... | ||
83 | fname@p2(y, ...); | ||
84 | |||
85 | |||
86 | @script:python depends on report@ | ||
87 | p1 << r4.p1; | ||
88 | p2 << r4.p2; | ||
89 | @@ | ||
90 | msg = "atomic_dec_and_test variation before object free at line %s." | ||
91 | coccilib.report.print_report(p1[0], msg % (p2[0].line)) | ||
92 | |||
93 | @r2 exists@ | ||
94 | identifier a, x; | ||
95 | position p1; | ||
96 | @@ | ||
97 | |||
98 | ( | ||
99 | atomic_add_unless(&(a)->x,-1,1)@p1 | ||
100 | | | ||
101 | atomic_long_add_unless(&(a)->x,-1,1)@p1 | ||
102 | | | ||
103 | atomic64_add_unless(&(a)->x,-1,1)@p1 | ||
104 | ) | ||
105 | |||
106 | @script:python depends on report@ | ||
107 | p1 << r2.p1; | ||
108 | @@ | ||
109 | msg = "atomic_add_unless" | ||
110 | coccilib.report.print_report(p1[0], msg) | ||
111 | |||
112 | @r3 exists@ | ||
113 | identifier x; | ||
114 | position p1; | ||
115 | @@ | ||
116 | |||
117 | ( | ||
118 | x = atomic_add_return@p1(-1, ...); | ||
119 | | | ||
120 | x = atomic_long_add_return@p1(-1, ...); | ||
121 | | | ||
122 | x = atomic64_add_return@p1(-1, ...); | ||
123 | ) | ||
124 | |||
125 | @script:python depends on report@ | ||
126 | p1 << r3.p1; | ||
127 | @@ | ||
128 | msg = "x = atomic_add_return(-1, ...)" | ||
129 | coccilib.report.print_report(p1[0], msg) | ||
diff --git a/scripts/coccinelle/tests/doubletest.cocci b/scripts/coccinelle/tests/doubletest.cocci index 78d74c22ca12..7af2ce7eb9bf 100644 --- a/scripts/coccinelle/tests/doubletest.cocci +++ b/scripts/coccinelle/tests/doubletest.cocci | |||
@@ -1,6 +1,7 @@ | |||
1 | /// Find &&/|| operations that include the same argument more than once | 1 | /// Find &&/|| operations that include the same argument more than once |
2 | //# A common source of false positives is when the argument performs a side | 2 | //# A common source of false positives is when the expression, or |
3 | //# effect. | 3 | //# another expresssion in the same && or || operation, performs a |
4 | //# side effect. | ||
4 | /// | 5 | /// |
5 | // Confidence: Moderate | 6 | // Confidence: Moderate |
6 | // Copyright: (C) 2010 Nicolas Palix, DIKU. GPLv2. | 7 | // Copyright: (C) 2010 Nicolas Palix, DIKU. GPLv2. |
@@ -20,20 +21,37 @@ position p; | |||
20 | @@ | 21 | @@ |
21 | 22 | ||
22 | ( | 23 | ( |
23 | * E@p | 24 | E@p || ... || E |
24 | || ... || E | ||
25 | | | 25 | | |
26 | * E@p | 26 | E@p && ... && E |
27 | && ... && E | ||
28 | ) | 27 | ) |
29 | 28 | ||
30 | @script:python depends on org@ | 29 | @bad@ |
30 | expression r.E,e1,e2,fn; | ||
31 | position r.p; | ||
32 | assignment operator op; | ||
33 | @@ | ||
34 | |||
35 | ( | ||
36 | E@p | ||
37 | & | ||
38 | <+... \(fn(...)\|e1 op e2\|e1++\|e1--\|++e1\|--e1\) ...+> | ||
39 | ) | ||
40 | |||
41 | @depends on context && !bad@ | ||
42 | expression r.E; | ||
43 | position r.p; | ||
44 | @@ | ||
45 | |||
46 | *E@p | ||
47 | |||
48 | @script:python depends on org && !bad@ | ||
31 | p << r.p; | 49 | p << r.p; |
32 | @@ | 50 | @@ |
33 | 51 | ||
34 | cocci.print_main("duplicated argument to && or ||",p) | 52 | cocci.print_main("duplicated argument to && or ||",p) |
35 | 53 | ||
36 | @script:python depends on report@ | 54 | @script:python depends on report && !bad@ |
37 | p << r.p; | 55 | p << r.p; |
38 | @@ | 56 | @@ |
39 | 57 | ||
diff --git a/scripts/depmod.sh b/scripts/depmod.sh index 1a6f85e0e6e1..999d585eaa73 100755 --- a/scripts/depmod.sh +++ b/scripts/depmod.sh | |||
@@ -10,10 +10,16 @@ fi | |||
10 | DEPMOD=$1 | 10 | DEPMOD=$1 |
11 | KERNELRELEASE=$2 | 11 | KERNELRELEASE=$2 |
12 | 12 | ||
13 | if ! test -r System.map -a -x "$DEPMOD"; then | 13 | if ! test -r System.map ; then |
14 | exit 0 | 14 | exit 0 |
15 | fi | 15 | fi |
16 | 16 | ||
17 | if [ -z $(command -v $DEPMOD) ]; then | ||
18 | echo "'make modules_install' requires $DEPMOD. Please install it." >&2 | ||
19 | echo "This is probably in the kmod package." >&2 | ||
20 | exit 1 | ||
21 | fi | ||
22 | |||
17 | # older versions of depmod require the version string to start with three | 23 | # older versions of depmod require the version string to start with three |
18 | # numbers, so we cheat with a symlink here | 24 | # numbers, so we cheat with a symlink here |
19 | depmod_hack_needed=true | 25 | depmod_hack_needed=true |
diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check index 078999a3fdff..ad9db6821824 100755 --- a/scripts/documentation-file-ref-check +++ b/scripts/documentation-file-ref-check | |||
@@ -75,6 +75,12 @@ while (<IN>) { | |||
75 | # Remove URL false-positives | 75 | # Remove URL false-positives |
76 | next if ($fulref =~ m/^http/); | 76 | next if ($fulref =~ m/^http/); |
77 | 77 | ||
78 | # Remove sched-pelt false-positive | ||
79 | next if ($fulref =~ m,^Documentation/scheduler/sched-pelt$,); | ||
80 | |||
81 | # Discard some build examples from Documentation/target/tcm_mod_builder.txt | ||
82 | next if ($fulref =~ m,mnt/sdb/lio-core-2.6.git/Documentation/target,); | ||
83 | |||
78 | # Check if exists, evaluating wildcards | 84 | # Check if exists, evaluating wildcards |
79 | next if (grep -e, glob("$ref $fulref")); | 85 | next if (grep -e, glob("$ref $fulref")); |
80 | 86 | ||
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile index 9cac65b7419c..1c943e03eaf2 100644 --- a/scripts/dtc/Makefile +++ b/scripts/dtc/Makefile | |||
@@ -9,21 +9,11 @@ dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ | |||
9 | dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o | 9 | dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o |
10 | 10 | ||
11 | # Source files need to get at the userspace version of libfdt_env.h to compile | 11 | # Source files need to get at the userspace version of libfdt_env.h to compile |
12 | HOST_EXTRACFLAGS := -I$(src)/libfdt | ||
12 | 13 | ||
13 | HOSTCFLAGS_DTC := -I$(src) -I$(src)/libfdt | 14 | # Generated files need one more search path to include headers in source tree |
14 | 15 | HOSTCFLAGS_dtc-lexer.lex.o := -I$(src) | |
15 | HOSTCFLAGS_checks.o := $(HOSTCFLAGS_DTC) | 16 | HOSTCFLAGS_dtc-parser.tab.o := -I$(src) |
16 | HOSTCFLAGS_data.o := $(HOSTCFLAGS_DTC) | ||
17 | HOSTCFLAGS_dtc.o := $(HOSTCFLAGS_DTC) | ||
18 | HOSTCFLAGS_flattree.o := $(HOSTCFLAGS_DTC) | ||
19 | HOSTCFLAGS_fstree.o := $(HOSTCFLAGS_DTC) | ||
20 | HOSTCFLAGS_livetree.o := $(HOSTCFLAGS_DTC) | ||
21 | HOSTCFLAGS_srcpos.o := $(HOSTCFLAGS_DTC) | ||
22 | HOSTCFLAGS_treesource.o := $(HOSTCFLAGS_DTC) | ||
23 | HOSTCFLAGS_util.o := $(HOSTCFLAGS_DTC) | ||
24 | |||
25 | HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC) | ||
26 | HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC) | ||
27 | 17 | ||
28 | # dependencies on generated files need to be listed explicitly | 18 | # dependencies on generated files need to be listed explicitly |
29 | $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h | 19 | $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h |
diff --git a/scripts/extract-vmlinux b/scripts/extract-vmlinux index 5061abcc2540..e6239f39abad 100755 --- a/scripts/extract-vmlinux +++ b/scripts/extract-vmlinux | |||
@@ -57,6 +57,8 @@ try_decompress '\3757zXZ\000' abcde unxz | |||
57 | try_decompress 'BZh' xy bunzip2 | 57 | try_decompress 'BZh' xy bunzip2 |
58 | try_decompress '\135\0\0\0' xxx unlzma | 58 | try_decompress '\135\0\0\0' xxx unlzma |
59 | try_decompress '\211\114\132' xy 'lzop -d' | 59 | try_decompress '\211\114\132' xy 'lzop -d' |
60 | try_decompress '\002!L\030' xxx 'lz4 -d' | ||
61 | try_decompress '(\265/\375' xxx unzstd | ||
60 | 62 | ||
61 | # Bail out: | 63 | # Bail out: |
62 | echo "$me: Cannot find vmlinux." >&2 | 64 | echo "$me: Cannot find vmlinux." >&2 |
diff --git a/scripts/gcc-plugins/Kconfig b/scripts/gcc-plugins/Kconfig new file mode 100644 index 000000000000..cb0c889e13aa --- /dev/null +++ b/scripts/gcc-plugins/Kconfig | |||
@@ -0,0 +1,142 @@ | |||
1 | preferred-plugin-hostcc := $(if-success,[ $(gcc-version) -ge 40800 ],$(HOSTCXX),$(HOSTCC)) | ||
2 | |||
3 | config PLUGIN_HOSTCC | ||
4 | string | ||
5 | default "$(shell,$(srctree)/scripts/gcc-plugin.sh "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")" if CC_IS_GCC | ||
6 | help | ||
7 | Host compiler used to build GCC plugins. This can be $(HOSTCXX), | ||
8 | $(HOSTCC), or a null string if GCC plugin is unsupported. | ||
9 | |||
10 | config HAVE_GCC_PLUGINS | ||
11 | bool | ||
12 | help | ||
13 | An arch should select this symbol if it supports building with | ||
14 | GCC plugins. | ||
15 | |||
16 | menuconfig GCC_PLUGINS | ||
17 | bool "GCC plugins" | ||
18 | depends on HAVE_GCC_PLUGINS | ||
19 | depends on PLUGIN_HOSTCC != "" | ||
20 | help | ||
21 | GCC plugins are loadable modules that provide extra features to the | ||
22 | compiler. They are useful for runtime instrumentation and static analysis. | ||
23 | |||
24 | See Documentation/gcc-plugins.txt for details. | ||
25 | |||
26 | if GCC_PLUGINS | ||
27 | |||
28 | config GCC_PLUGIN_CYC_COMPLEXITY | ||
29 | bool "Compute the cyclomatic complexity of a function" if EXPERT | ||
30 | depends on !COMPILE_TEST # too noisy | ||
31 | help | ||
32 | The complexity M of a function's control flow graph is defined as: | ||
33 | M = E - N + 2P | ||
34 | where | ||
35 | |||
36 | E = the number of edges | ||
37 | N = the number of nodes | ||
38 | P = the number of connected components (exit nodes). | ||
39 | |||
40 | Enabling this plugin reports the complexity to stderr during the | ||
41 | build. It mainly serves as a simple example of how to create a | ||
42 | gcc plugin for the kernel. | ||
43 | |||
44 | config GCC_PLUGIN_SANCOV | ||
45 | bool | ||
46 | help | ||
47 | This plugin inserts a __sanitizer_cov_trace_pc() call at the start of | ||
48 | basic blocks. It supports all gcc versions with plugin support (from | ||
49 | gcc-4.5 on). It is based on the commit "Add fuzzing coverage support" | ||
50 | by Dmitry Vyukov <dvyukov@google.com>. | ||
51 | |||
52 | config GCC_PLUGIN_LATENT_ENTROPY | ||
53 | bool "Generate some entropy during boot and runtime" | ||
54 | help | ||
55 | By saying Y here the kernel will instrument some kernel code to | ||
56 | extract some entropy from both original and artificially created | ||
57 | program state. This will help especially embedded systems where | ||
58 | there is little 'natural' source of entropy normally. The cost | ||
59 | is some slowdown of the boot process (about 0.5%) and fork and | ||
60 | irq processing. | ||
61 | |||
62 | Note that entropy extracted this way is not cryptographically | ||
63 | secure! | ||
64 | |||
65 | This plugin was ported from grsecurity/PaX. More information at: | ||
66 | * https://grsecurity.net/ | ||
67 | * https://pax.grsecurity.net/ | ||
68 | |||
69 | config GCC_PLUGIN_STRUCTLEAK | ||
70 | bool "Force initialization of variables containing userspace addresses" | ||
71 | # Currently STRUCTLEAK inserts initialization out of live scope of | ||
72 | # variables from KASAN point of view. This leads to KASAN false | ||
73 | # positive reports. Prohibit this combination for now. | ||
74 | depends on !KASAN_EXTRA | ||
75 | help | ||
76 | This plugin zero-initializes any structures containing a | ||
77 | __user attribute. This can prevent some classes of information | ||
78 | exposures. | ||
79 | |||
80 | This plugin was ported from grsecurity/PaX. More information at: | ||
81 | * https://grsecurity.net/ | ||
82 | * https://pax.grsecurity.net/ | ||
83 | |||
84 | config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL | ||
85 | bool "Force initialize all struct type variables passed by reference" | ||
86 | depends on GCC_PLUGIN_STRUCTLEAK | ||
87 | depends on !COMPILE_TEST | ||
88 | help | ||
89 | Zero initialize any struct type local variable that may be passed by | ||
90 | reference without having been initialized. | ||
91 | |||
92 | config GCC_PLUGIN_STRUCTLEAK_VERBOSE | ||
93 | bool "Report forcefully initialized variables" | ||
94 | depends on GCC_PLUGIN_STRUCTLEAK | ||
95 | depends on !COMPILE_TEST # too noisy | ||
96 | help | ||
97 | This option will cause a warning to be printed each time the | ||
98 | structleak plugin finds a variable it thinks needs to be | ||
99 | initialized. Since not all existing initializers are detected | ||
100 | by the plugin, this can produce false positive warnings. | ||
101 | |||
102 | config GCC_PLUGIN_RANDSTRUCT | ||
103 | bool "Randomize layout of sensitive kernel structures" | ||
104 | select MODVERSIONS if MODULES | ||
105 | help | ||
106 | If you say Y here, the layouts of structures that are entirely | ||
107 | function pointers (and have not been manually annotated with | ||
108 | __no_randomize_layout), or structures that have been explicitly | ||
109 | marked with __randomize_layout, will be randomized at compile-time. | ||
110 | This can introduce the requirement of an additional information | ||
111 | exposure vulnerability for exploits targeting these structure | ||
112 | types. | ||
113 | |||
114 | Enabling this feature will introduce some performance impact, | ||
115 | slightly increase memory usage, and prevent the use of forensic | ||
116 | tools like Volatility against the system (unless the kernel | ||
117 | source tree isn't cleaned after kernel installation). | ||
118 | |||
119 | The seed used for compilation is located at | ||
120 | scripts/gcc-plgins/randomize_layout_seed.h. It remains after | ||
121 | a make clean to allow for external modules to be compiled with | ||
122 | the existing seed and will be removed by a make mrproper or | ||
123 | make distclean. | ||
124 | |||
125 | Note that the implementation requires gcc 4.7 or newer. | ||
126 | |||
127 | This plugin was ported from grsecurity/PaX. More information at: | ||
128 | * https://grsecurity.net/ | ||
129 | * https://pax.grsecurity.net/ | ||
130 | |||
131 | config GCC_PLUGIN_RANDSTRUCT_PERFORMANCE | ||
132 | bool "Use cacheline-aware structure randomization" | ||
133 | depends on GCC_PLUGIN_RANDSTRUCT | ||
134 | depends on !COMPILE_TEST # do not reduce test coverage | ||
135 | help | ||
136 | If you say Y here, the RANDSTRUCT randomization will make a | ||
137 | best effort at restricting randomization to cacheline-sized | ||
138 | groups of elements. It will further not randomize bitfields | ||
139 | in structures. This reduces the performance hit of RANDSTRUCT | ||
140 | at the cost of weakened randomization. | ||
141 | |||
142 | endif | ||
diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile index 326254653bd0..aa0d0ec6936d 100644 --- a/scripts/gcc-plugins/Makefile +++ b/scripts/gcc-plugins/Makefile | |||
@@ -14,8 +14,6 @@ else | |||
14 | export HOST_EXTRACXXFLAGS | 14 | export HOST_EXTRACXXFLAGS |
15 | endif | 15 | endif |
16 | 16 | ||
17 | export HOSTLIBS | ||
18 | |||
19 | $(obj)/randomize_layout_plugin.o: $(objtree)/$(obj)/randomize_layout_seed.h | 17 | $(obj)/randomize_layout_plugin.o: $(objtree)/$(obj)/randomize_layout_seed.h |
20 | quiet_cmd_create_randomize_layout_seed = GENSEED $@ | 18 | quiet_cmd_create_randomize_layout_seed = GENSEED $@ |
21 | cmd_create_randomize_layout_seed = \ | 19 | cmd_create_randomize_layout_seed = \ |
@@ -29,7 +27,4 @@ always := $($(HOSTLIBS)-y) | |||
29 | 27 | ||
30 | $(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o)) | 28 | $(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o)) |
31 | 29 | ||
32 | subdir-y := $(GCC_PLUGIN_SUBDIR) | ||
33 | subdir- += $(GCC_PLUGIN_SUBDIR) | ||
34 | |||
35 | clean-files += *.so | 30 | clean-files += *.so |
diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h index f46750053377..552d5efd7cb7 100644 --- a/scripts/gcc-plugins/gcc-common.h +++ b/scripts/gcc-plugins/gcc-common.h | |||
@@ -392,13 +392,6 @@ static inline struct cgraph_node *cgraph_alias_target(struct cgraph_node *n) | |||
392 | } | 392 | } |
393 | #endif | 393 | #endif |
394 | 394 | ||
395 | #if BUILDING_GCC_VERSION >= 4007 && BUILDING_GCC_VERSION <= 4009 | ||
396 | #define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \ | ||
397 | cgraph_create_edge((caller), (callee), (call_stmt), (count), (freq)) | ||
398 | #define cgraph_create_edge_including_clones(caller, callee, old_call_stmt, call_stmt, count, freq, nest, reason) \ | ||
399 | cgraph_create_edge_including_clones((caller), (callee), (old_call_stmt), (call_stmt), (count), (freq), (reason)) | ||
400 | #endif | ||
401 | |||
402 | #if BUILDING_GCC_VERSION <= 4008 | 395 | #if BUILDING_GCC_VERSION <= 4008 |
403 | #define ENTRY_BLOCK_PTR_FOR_FN(FN) ENTRY_BLOCK_PTR_FOR_FUNCTION(FN) | 396 | #define ENTRY_BLOCK_PTR_FOR_FN(FN) ENTRY_BLOCK_PTR_FOR_FUNCTION(FN) |
404 | #define EXIT_BLOCK_PTR_FOR_FN(FN) EXIT_BLOCK_PTR_FOR_FUNCTION(FN) | 397 | #define EXIT_BLOCK_PTR_FOR_FN(FN) EXIT_BLOCK_PTR_FOR_FUNCTION(FN) |
@@ -723,10 +716,23 @@ static inline const char *get_decl_section_name(const_tree decl) | |||
723 | #define varpool_get_node(decl) varpool_node::get(decl) | 716 | #define varpool_get_node(decl) varpool_node::get(decl) |
724 | #define dump_varpool_node(file, node) (node)->dump(file) | 717 | #define dump_varpool_node(file, node) (node)->dump(file) |
725 | 718 | ||
726 | #define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \ | 719 | #if BUILDING_GCC_VERSION >= 8000 |
720 | #define cgraph_create_edge(caller, callee, call_stmt, count, freq) \ | ||
721 | (caller)->create_edge((callee), (call_stmt), (count)) | ||
722 | |||
723 | #define cgraph_create_edge_including_clones(caller, callee, \ | ||
724 | old_call_stmt, call_stmt, count, freq, reason) \ | ||
725 | (caller)->create_edge_including_clones((callee), \ | ||
726 | (old_call_stmt), (call_stmt), (count), (reason)) | ||
727 | #else | ||
728 | #define cgraph_create_edge(caller, callee, call_stmt, count, freq) \ | ||
727 | (caller)->create_edge((callee), (call_stmt), (count), (freq)) | 729 | (caller)->create_edge((callee), (call_stmt), (count), (freq)) |
728 | #define cgraph_create_edge_including_clones(caller, callee, old_call_stmt, call_stmt, count, freq, nest, reason) \ | 730 | |
729 | (caller)->create_edge_including_clones((callee), (old_call_stmt), (call_stmt), (count), (freq), (reason)) | 731 | #define cgraph_create_edge_including_clones(caller, callee, \ |
732 | old_call_stmt, call_stmt, count, freq, reason) \ | ||
733 | (caller)->create_edge_including_clones((callee), \ | ||
734 | (old_call_stmt), (call_stmt), (count), (freq), (reason)) | ||
735 | #endif | ||
730 | 736 | ||
731 | typedef struct cgraph_node *cgraph_node_ptr; | 737 | typedef struct cgraph_node *cgraph_node_ptr; |
732 | typedef struct cgraph_edge *cgraph_edge_p; | 738 | typedef struct cgraph_edge *cgraph_edge_p; |
diff --git a/scripts/gcc-x86_64-has-stack-protector.sh b/scripts/gcc-x86_64-has-stack-protector.sh index 3755af0cd9f7..75e4e22b986a 100755 --- a/scripts/gcc-x86_64-has-stack-protector.sh +++ b/scripts/gcc-x86_64-has-stack-protector.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # SPDX-License-Identifier: GPL-2.0 | 2 | # SPDX-License-Identifier: GPL-2.0 |
3 | 3 | ||
4 | echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs" | 4 | echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -m64 -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs" |
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh deleted file mode 100755 index 10e528b3a08f..000000000000 --- a/scripts/gen_initramfs_list.sh +++ /dev/null | |||
@@ -1,328 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # Copyright (C) Martin Schlemmer <azarah@nosferatu.za.org> | ||
3 | # Copyright (C) 2006 Sam Ravnborg <sam@ravnborg.org> | ||
4 | # | ||
5 | # Released under the terms of the GNU GPL | ||
6 | # | ||
7 | # Generate a cpio packed initramfs. It uses gen_init_cpio to generate | ||
8 | # the cpio archive, and then compresses it. | ||
9 | # The script may also be used to generate the inputfile used for gen_init_cpio | ||
10 | # This script assumes that gen_init_cpio is located in usr/ directory | ||
11 | |||
12 | # error out on errors | ||
13 | set -e | ||
14 | |||
15 | usage() { | ||
16 | cat << EOF | ||
17 | Usage: | ||
18 | $0 [-o <file>] [-u <uid>] [-g <gid>] {-d | <cpio_source>} ... | ||
19 | -o <file> Create compressed initramfs file named <file> using | ||
20 | gen_init_cpio and compressor depending on the extension | ||
21 | -u <uid> User ID to map to user ID 0 (root). | ||
22 | <uid> is only meaningful if <cpio_source> is a | ||
23 | directory. "squash" forces all files to uid 0. | ||
24 | -g <gid> Group ID to map to group ID 0 (root). | ||
25 | <gid> is only meaningful if <cpio_source> is a | ||
26 | directory. "squash" forces all files to gid 0. | ||
27 | <cpio_source> File list or directory for cpio archive. | ||
28 | If <cpio_source> is a .cpio file it will be used | ||
29 | as direct input to initramfs. | ||
30 | -d Output the default cpio list. | ||
31 | |||
32 | All options except -o and -l may be repeated and are interpreted | ||
33 | sequentially and immediately. -u and -g states are preserved across | ||
34 | <cpio_source> options so an explicit "-u 0 -g 0" is required | ||
35 | to reset the root/group mapping. | ||
36 | EOF | ||
37 | } | ||
38 | |||
39 | # awk style field access | ||
40 | # $1 - field number; rest is argument string | ||
41 | field() { | ||
42 | shift $1 ; echo $1 | ||
43 | } | ||
44 | |||
45 | list_default_initramfs() { | ||
46 | # echo usr/kinit/kinit | ||
47 | : | ||
48 | } | ||
49 | |||
50 | default_initramfs() { | ||
51 | cat <<-EOF >> ${output} | ||
52 | # This is a very simple, default initramfs | ||
53 | |||
54 | dir /dev 0755 0 0 | ||
55 | nod /dev/console 0600 0 0 c 5 1 | ||
56 | dir /root 0700 0 0 | ||
57 | # file /kinit usr/kinit/kinit 0755 0 0 | ||
58 | # slink /init kinit 0755 0 0 | ||
59 | EOF | ||
60 | } | ||
61 | |||
62 | filetype() { | ||
63 | local argv1="$1" | ||
64 | |||
65 | # symlink test must come before file test | ||
66 | if [ -L "${argv1}" ]; then | ||
67 | echo "slink" | ||
68 | elif [ -f "${argv1}" ]; then | ||
69 | echo "file" | ||
70 | elif [ -d "${argv1}" ]; then | ||
71 | echo "dir" | ||
72 | elif [ -b "${argv1}" -o -c "${argv1}" ]; then | ||
73 | echo "nod" | ||
74 | elif [ -p "${argv1}" ]; then | ||
75 | echo "pipe" | ||
76 | elif [ -S "${argv1}" ]; then | ||
77 | echo "sock" | ||
78 | else | ||
79 | echo "invalid" | ||
80 | fi | ||
81 | return 0 | ||
82 | } | ||
83 | |||
84 | list_print_mtime() { | ||
85 | : | ||
86 | } | ||
87 | |||
88 | print_mtime() { | ||
89 | local my_mtime="0" | ||
90 | |||
91 | if [ -e "$1" ]; then | ||
92 | my_mtime=$(find "$1" -printf "%T@\n" | sort -r | head -n 1) | ||
93 | fi | ||
94 | |||
95 | echo "# Last modified: ${my_mtime}" >> ${output} | ||
96 | echo "" >> ${output} | ||
97 | } | ||
98 | |||
99 | list_parse() { | ||
100 | if [ -L "$1" ]; then | ||
101 | return | ||
102 | fi | ||
103 | echo "$1" | sed 's/:/\\:/g; s/$/ \\/' | ||
104 | } | ||
105 | |||
106 | # for each file print a line in following format | ||
107 | # <filetype> <name> <path to file> <octal mode> <uid> <gid> | ||
108 | # for links, devices etc the format differs. See gen_init_cpio for details | ||
109 | parse() { | ||
110 | local location="$1" | ||
111 | local name="/${location#${srcdir}}" | ||
112 | # change '//' into '/' | ||
113 | name=$(echo "$name" | sed -e 's://*:/:g') | ||
114 | local mode="$2" | ||
115 | local uid="$3" | ||
116 | local gid="$4" | ||
117 | local ftype=$(filetype "${location}") | ||
118 | # remap uid/gid to 0 if necessary | ||
119 | [ "$root_uid" = "squash" ] && uid=0 || [ "$uid" -eq "$root_uid" ] && uid=0 | ||
120 | [ "$root_gid" = "squash" ] && gid=0 || [ "$gid" -eq "$root_gid" ] && gid=0 | ||
121 | local str="${mode} ${uid} ${gid}" | ||
122 | |||
123 | [ "${ftype}" = "invalid" ] && return 0 | ||
124 | [ "${location}" = "${srcdir}" ] && return 0 | ||
125 | |||
126 | case "${ftype}" in | ||
127 | "file") | ||
128 | str="${ftype} ${name} ${location} ${str}" | ||
129 | ;; | ||
130 | "nod") | ||
131 | local dev=`LC_ALL=C ls -l "${location}"` | ||
132 | local maj=`field 5 ${dev}` | ||
133 | local min=`field 6 ${dev}` | ||
134 | maj=${maj%,} | ||
135 | |||
136 | [ -b "${location}" ] && dev="b" || dev="c" | ||
137 | |||
138 | str="${ftype} ${name} ${str} ${dev} ${maj} ${min}" | ||
139 | ;; | ||
140 | "slink") | ||
141 | local target=`readlink "${location}"` | ||
142 | str="${ftype} ${name} ${target} ${str}" | ||
143 | ;; | ||
144 | *) | ||
145 | str="${ftype} ${name} ${str}" | ||
146 | ;; | ||
147 | esac | ||
148 | |||
149 | echo "${str}" >> ${output} | ||
150 | |||
151 | return 0 | ||
152 | } | ||
153 | |||
154 | unknown_option() { | ||
155 | printf "ERROR: unknown option \"$arg\"\n" >&2 | ||
156 | printf "If the filename validly begins with '-', " >&2 | ||
157 | printf "then it must be prefixed\n" >&2 | ||
158 | printf "by './' so that it won't be interpreted as an option." >&2 | ||
159 | printf "\n" >&2 | ||
160 | usage >&2 | ||
161 | exit 1 | ||
162 | } | ||
163 | |||
164 | list_header() { | ||
165 | : | ||
166 | } | ||
167 | |||
168 | header() { | ||
169 | printf "\n#####################\n# $1\n" >> ${output} | ||
170 | } | ||
171 | |||
172 | # process one directory (incl sub-directories) | ||
173 | dir_filelist() { | ||
174 | ${dep_list}header "$1" | ||
175 | |||
176 | srcdir=$(echo "$1" | sed -e 's://*:/:g') | ||
177 | dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" | sort) | ||
178 | |||
179 | # If $dirlist is only one line, then the directory is empty | ||
180 | if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then | ||
181 | ${dep_list}print_mtime "$1" | ||
182 | |||
183 | echo "${dirlist}" | \ | ||
184 | while read x; do | ||
185 | ${dep_list}parse ${x} | ||
186 | done | ||
187 | fi | ||
188 | } | ||
189 | |||
190 | # if only one file is specified and it is .cpio file then use it direct as fs | ||
191 | # if a directory is specified then add all files in given direcotry to fs | ||
192 | # if a regular file is specified assume it is in gen_initramfs format | ||
193 | input_file() { | ||
194 | source="$1" | ||
195 | if [ -f "$1" ]; then | ||
196 | ${dep_list}header "$1" | ||
197 | is_cpio="$(echo "$1" | sed 's/^.*\.cpio\(\..*\)\{0,1\}/cpio/')" | ||
198 | if [ $2 -eq 0 -a ${is_cpio} = "cpio" ]; then | ||
199 | cpio_file=$1 | ||
200 | echo "$1" | grep -q '^.*\.cpio\..*' && is_cpio_compressed="compressed" | ||
201 | [ ! -z ${dep_list} ] && echo "$1" | ||
202 | return 0 | ||
203 | fi | ||
204 | if [ -z ${dep_list} ]; then | ||
205 | print_mtime "$1" >> ${output} | ||
206 | cat "$1" >> ${output} | ||
207 | else | ||
208 | echo "$1 \\" | ||
209 | cat "$1" | while read type dir file perm ; do | ||
210 | if [ "$type" = "file" ]; then | ||
211 | echo "$file \\"; | ||
212 | fi | ||
213 | done | ||
214 | fi | ||
215 | elif [ -d "$1" ]; then | ||
216 | dir_filelist "$1" | ||
217 | else | ||
218 | echo " ${prog}: Cannot open '$1'" >&2 | ||
219 | exit 1 | ||
220 | fi | ||
221 | } | ||
222 | |||
223 | prog=$0 | ||
224 | root_uid=0 | ||
225 | root_gid=0 | ||
226 | dep_list= | ||
227 | cpio_file= | ||
228 | cpio_list= | ||
229 | output="/dev/stdout" | ||
230 | output_file="" | ||
231 | is_cpio_compressed= | ||
232 | compr="gzip -n -9 -f" | ||
233 | |||
234 | arg="$1" | ||
235 | case "$arg" in | ||
236 | "-l") # files included in initramfs - used by kbuild | ||
237 | dep_list="list_" | ||
238 | echo "deps_initramfs := $0 \\" | ||
239 | shift | ||
240 | ;; | ||
241 | "-o") # generate compressed cpio image named $1 | ||
242 | shift | ||
243 | output_file="$1" | ||
244 | cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)" | ||
245 | output=${cpio_list} | ||
246 | echo "$output_file" | grep -q "\.gz$" \ | ||
247 | && [ -x "`which gzip 2> /dev/null`" ] \ | ||
248 | && compr="gzip -n -9 -f" | ||
249 | echo "$output_file" | grep -q "\.bz2$" \ | ||
250 | && [ -x "`which bzip2 2> /dev/null`" ] \ | ||
251 | && compr="bzip2 -9 -f" | ||
252 | echo "$output_file" | grep -q "\.lzma$" \ | ||
253 | && [ -x "`which lzma 2> /dev/null`" ] \ | ||
254 | && compr="lzma -9 -f" | ||
255 | echo "$output_file" | grep -q "\.xz$" \ | ||
256 | && [ -x "`which xz 2> /dev/null`" ] \ | ||
257 | && compr="xz --check=crc32 --lzma2=dict=1MiB" | ||
258 | echo "$output_file" | grep -q "\.lzo$" \ | ||
259 | && [ -x "`which lzop 2> /dev/null`" ] \ | ||
260 | && compr="lzop -9 -f" | ||
261 | echo "$output_file" | grep -q "\.lz4$" \ | ||
262 | && [ -x "`which lz4 2> /dev/null`" ] \ | ||
263 | && compr="lz4 -l -9 -f" | ||
264 | echo "$output_file" | grep -q "\.cpio$" && compr="cat" | ||
265 | shift | ||
266 | ;; | ||
267 | esac | ||
268 | while [ $# -gt 0 ]; do | ||
269 | arg="$1" | ||
270 | shift | ||
271 | case "$arg" in | ||
272 | "-u") # map $1 to uid=0 (root) | ||
273 | root_uid="$1" | ||
274 | [ "$root_uid" = "-1" ] && root_uid=$(id -u || echo 0) | ||
275 | shift | ||
276 | ;; | ||
277 | "-g") # map $1 to gid=0 (root) | ||
278 | root_gid="$1" | ||
279 | [ "$root_gid" = "-1" ] && root_gid=$(id -g || echo 0) | ||
280 | shift | ||
281 | ;; | ||
282 | "-d") # display default initramfs list | ||
283 | default_list="$arg" | ||
284 | ${dep_list}default_initramfs | ||
285 | ;; | ||
286 | "-h") | ||
287 | usage | ||
288 | exit 0 | ||
289 | ;; | ||
290 | *) | ||
291 | case "$arg" in | ||
292 | "-"*) | ||
293 | unknown_option | ||
294 | ;; | ||
295 | *) # input file/dir - process it | ||
296 | input_file "$arg" "$#" | ||
297 | ;; | ||
298 | esac | ||
299 | ;; | ||
300 | esac | ||
301 | done | ||
302 | |||
303 | # If output_file is set we will generate cpio archive and compress it | ||
304 | # we are careful to delete tmp files | ||
305 | if [ ! -z ${output_file} ]; then | ||
306 | if [ -z ${cpio_file} ]; then | ||
307 | timestamp= | ||
308 | if test -n "$KBUILD_BUILD_TIMESTAMP"; then | ||
309 | timestamp="$(date -d"$KBUILD_BUILD_TIMESTAMP" +%s || :)" | ||
310 | if test -n "$timestamp"; then | ||
311 | timestamp="-t $timestamp" | ||
312 | fi | ||
313 | fi | ||
314 | cpio_tfile="$(mktemp ${TMPDIR:-/tmp}/cpiofile.XXXXXX)" | ||
315 | usr/gen_init_cpio $timestamp ${cpio_list} > ${cpio_tfile} | ||
316 | else | ||
317 | cpio_tfile=${cpio_file} | ||
318 | fi | ||
319 | rm ${cpio_list} | ||
320 | if [ "${is_cpio_compressed}" = "compressed" ]; then | ||
321 | cat ${cpio_tfile} > ${output_file} | ||
322 | else | ||
323 | (cat ${cpio_tfile} | ${compr} - > ${output_file}) \ | ||
324 | || (rm -f ${output_file} ; false) | ||
325 | fi | ||
326 | [ -z ${cpio_file} ] && rm ${cpio_tfile} | ||
327 | fi | ||
328 | exit 0 | ||
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index c87fa734e3e1..c1c088ef1420 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
@@ -48,6 +48,7 @@ my $output_roles = 0; | |||
48 | my $output_rolestats = 1; | 48 | my $output_rolestats = 1; |
49 | my $output_section_maxlen = 50; | 49 | my $output_section_maxlen = 50; |
50 | my $scm = 0; | 50 | my $scm = 0; |
51 | my $tree = 1; | ||
51 | my $web = 0; | 52 | my $web = 0; |
52 | my $subsystem = 0; | 53 | my $subsystem = 0; |
53 | my $status = 0; | 54 | my $status = 0; |
@@ -61,7 +62,7 @@ my $self_test = undef; | |||
61 | my $version = 0; | 62 | my $version = 0; |
62 | my $help = 0; | 63 | my $help = 0; |
63 | my $find_maintainer_files = 0; | 64 | my $find_maintainer_files = 0; |
64 | 65 | my $maintainer_path; | |
65 | my $vcs_used = 0; | 66 | my $vcs_used = 0; |
66 | 67 | ||
67 | my $exit = 0; | 68 | my $exit = 0; |
@@ -255,6 +256,7 @@ if (!GetOptions( | |||
255 | 'subsystem!' => \$subsystem, | 256 | 'subsystem!' => \$subsystem, |
256 | 'status!' => \$status, | 257 | 'status!' => \$status, |
257 | 'scm!' => \$scm, | 258 | 'scm!' => \$scm, |
259 | 'tree!' => \$tree, | ||
258 | 'web!' => \$web, | 260 | 'web!' => \$web, |
259 | 'letters=s' => \$letters, | 261 | 'letters=s' => \$letters, |
260 | 'pattern-depth=i' => \$pattern_depth, | 262 | 'pattern-depth=i' => \$pattern_depth, |
@@ -263,6 +265,7 @@ if (!GetOptions( | |||
263 | 'fe|file-emails!' => \$file_emails, | 265 | 'fe|file-emails!' => \$file_emails, |
264 | 'f|file' => \$from_filename, | 266 | 'f|file' => \$from_filename, |
265 | 'find-maintainer-files' => \$find_maintainer_files, | 267 | 'find-maintainer-files' => \$find_maintainer_files, |
268 | 'mpath|maintainer-path=s' => \$maintainer_path, | ||
266 | 'self-test:s' => \$self_test, | 269 | 'self-test:s' => \$self_test, |
267 | 'v|version' => \$version, | 270 | 'v|version' => \$version, |
268 | 'h|help|usage' => \$help, | 271 | 'h|help|usage' => \$help, |
@@ -319,7 +322,7 @@ if ($email && | |||
319 | die "$P: Please select at least 1 email option\n"; | 322 | die "$P: Please select at least 1 email option\n"; |
320 | } | 323 | } |
321 | 324 | ||
322 | if (!top_of_kernel_tree($lk_path)) { | 325 | if ($tree && !top_of_kernel_tree($lk_path)) { |
323 | die "$P: The current directory does not appear to be " | 326 | die "$P: The current directory does not appear to be " |
324 | . "a linux kernel source tree.\n"; | 327 | . "a linux kernel source tree.\n"; |
325 | } | 328 | } |
@@ -384,26 +387,36 @@ sub find_ignore_git { | |||
384 | read_all_maintainer_files(); | 387 | read_all_maintainer_files(); |
385 | 388 | ||
386 | sub read_all_maintainer_files { | 389 | sub read_all_maintainer_files { |
387 | if (-d "${lk_path}MAINTAINERS") { | 390 | my $path = "${lk_path}MAINTAINERS"; |
388 | opendir(DIR, "${lk_path}MAINTAINERS") or die $!; | 391 | if (defined $maintainer_path) { |
389 | my @files = readdir(DIR); | 392 | $path = $maintainer_path; |
390 | closedir(DIR); | 393 | # Perl Cookbook tilde expansion if necessary |
391 | foreach my $file (@files) { | 394 | $path =~ s@^~([^/]*)@ $1 ? (getpwnam($1))[7] : ( $ENV{HOME} || $ENV{LOGDIR} || (getpwuid($<))[7])@ex; |
392 | push(@mfiles, "${lk_path}MAINTAINERS/$file") if ($file !~ /^\./); | 395 | } |
393 | } | 396 | |
394 | } | 397 | if (-d $path) { |
395 | 398 | $path .= '/' if ($path !~ m@/$@); | |
396 | if ($find_maintainer_files) { | 399 | if ($find_maintainer_files) { |
397 | find( { wanted => \&find_is_maintainer_file, | 400 | find( { wanted => \&find_is_maintainer_file, |
398 | preprocess => \&find_ignore_git, | 401 | preprocess => \&find_ignore_git, |
399 | no_chdir => 1, | 402 | no_chdir => 1, |
400 | }, "${lk_path}"); | 403 | }, "$path"); |
404 | } else { | ||
405 | opendir(DIR, "$path") or die $!; | ||
406 | my @files = readdir(DIR); | ||
407 | closedir(DIR); | ||
408 | foreach my $file (@files) { | ||
409 | push(@mfiles, "$path$file") if ($file !~ /^\./); | ||
410 | } | ||
411 | } | ||
412 | } elsif (-f "$path") { | ||
413 | push(@mfiles, "$path"); | ||
401 | } else { | 414 | } else { |
402 | push(@mfiles, "${lk_path}MAINTAINERS") if -f "${lk_path}MAINTAINERS"; | 415 | die "$P: MAINTAINER file not found '$path'\n"; |
403 | } | 416 | } |
404 | 417 | die "$P: No MAINTAINER files found in '$path'\n" if (scalar(@mfiles) == 0); | |
405 | foreach my $file (@mfiles) { | 418 | foreach my $file (@mfiles) { |
406 | read_maintainer_file("$file"); | 419 | read_maintainer_file("$file"); |
407 | } | 420 | } |
408 | } | 421 | } |
409 | 422 | ||
@@ -1031,13 +1044,14 @@ Other options: | |||
1031 | --sections => print all of the subsystem sections with pattern matches | 1044 | --sections => print all of the subsystem sections with pattern matches |
1032 | --letters => print all matching 'letter' types from all matching sections | 1045 | --letters => print all matching 'letter' types from all matching sections |
1033 | --mailmap => use .mailmap file (default: $email_use_mailmap) | 1046 | --mailmap => use .mailmap file (default: $email_use_mailmap) |
1047 | --no-tree => run without a kernel tree | ||
1034 | --self-test => show potential issues with MAINTAINERS file content | 1048 | --self-test => show potential issues with MAINTAINERS file content |
1035 | --version => show version | 1049 | --version => show version |
1036 | --help => show this help information | 1050 | --help => show this help information |
1037 | 1051 | ||
1038 | Default options: | 1052 | Default options: |
1039 | [--email --nogit --git-fallback --m --r --n --l --multiline --pattern-depth=0 | 1053 | [--email --tree --nogit --git-fallback --m --r --n --l --multiline |
1040 | --remove-duplicates --rolestats] | 1054 | --pattern-depth=0 --remove-duplicates --rolestats] |
1041 | 1055 | ||
1042 | Notes: | 1056 | Notes: |
1043 | Using "-f directory" may give unexpected results: | 1057 | Using "-f directory" may give unexpected results: |
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index a3ac2c91331c..4a7bd2192073 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -3,8 +3,8 @@ | |||
3 | # Kernel configuration targets | 3 | # Kernel configuration targets |
4 | # These targets are used from top-level makefile | 4 | # These targets are used from top-level makefile |
5 | 5 | ||
6 | PHONY += xconfig gconfig menuconfig config syncconfig \ | 6 | PHONY += xconfig gconfig menuconfig config localmodconfig localyesconfig \ |
7 | localmodconfig localyesconfig | 7 | build_menuconfig build_nconfig build_gconfig build_xconfig |
8 | 8 | ||
9 | ifdef KBUILD_KCONFIG | 9 | ifdef KBUILD_KCONFIG |
10 | Kconfig := $(KBUILD_KCONFIG) | 10 | Kconfig := $(KBUILD_KCONFIG) |
@@ -34,14 +34,15 @@ config: $(obj)/conf | |||
34 | nconfig: $(obj)/nconf | 34 | nconfig: $(obj)/nconf |
35 | $< $(silent) $(Kconfig) | 35 | $< $(silent) $(Kconfig) |
36 | 36 | ||
37 | # This has become an internal implementation detail and is now deprecated | 37 | build_menuconfig: $(obj)/mconf |
38 | # for external use. | 38 | |
39 | syncconfig: $(obj)/conf | 39 | build_nconfig: $(obj)/nconf |
40 | $(Q)mkdir -p include/config include/generated | 40 | |
41 | $< $(silent) --$@ $(Kconfig) | 41 | build_gconfig: $(obj)/gconf |
42 | |||
43 | build_xconfig: $(obj)/qconf | ||
42 | 44 | ||
43 | localyesconfig localmodconfig: $(obj)/conf | 45 | localyesconfig localmodconfig: $(obj)/conf |
44 | $(Q)mkdir -p include/config include/generated | ||
45 | $(Q)perl $(srctree)/$(src)/streamline_config.pl --$@ $(srctree) $(Kconfig) > .tmp.config | 46 | $(Q)perl $(srctree)/$(src)/streamline_config.pl --$@ $(srctree) $(Kconfig) > .tmp.config |
46 | $(Q)if [ -f .config ]; then \ | 47 | $(Q)if [ -f .config ]; then \ |
47 | cmp -s .tmp.config .config || \ | 48 | cmp -s .tmp.config .config || \ |
@@ -56,8 +57,12 @@ localyesconfig localmodconfig: $(obj)/conf | |||
56 | $(Q)rm -f .tmp.config | 57 | $(Q)rm -f .tmp.config |
57 | 58 | ||
58 | # These targets map 1:1 to the commandline options of 'conf' | 59 | # These targets map 1:1 to the commandline options of 'conf' |
60 | # | ||
61 | # Note: | ||
62 | # syncconfig has become an internal implementation detail and is now | ||
63 | # deprecated for external use | ||
59 | simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \ | 64 | simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \ |
60 | alldefconfig randconfig listnewconfig olddefconfig | 65 | alldefconfig randconfig listnewconfig olddefconfig syncconfig |
61 | PHONY += $(simple-targets) | 66 | PHONY += $(simple-targets) |
62 | 67 | ||
63 | $(simple-targets): $(obj)/conf | 68 | $(simple-targets): $(obj)/conf |
@@ -169,29 +174,30 @@ HOSTCFLAGS_zconf.tab.o := -I$(src) | |||
169 | hostprogs-y += nconf | 174 | hostprogs-y += nconf |
170 | nconf-objs := nconf.o zconf.tab.o nconf.gui.o | 175 | nconf-objs := nconf.o zconf.tab.o nconf.gui.o |
171 | 176 | ||
172 | HOSTLOADLIBES_nconf = $(shell . $(obj)/.nconf-cfg && echo $$libs) | 177 | HOSTLDLIBS_nconf = $(shell . $(obj)/.nconf-cfg && echo $$libs) |
173 | HOSTCFLAGS_nconf.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags) | 178 | HOSTCFLAGS_nconf.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags) |
174 | HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags) | 179 | HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags) |
175 | 180 | ||
176 | $(obj)/nconf.o: $(obj)/.nconf-cfg | 181 | $(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/.nconf-cfg |
177 | 182 | ||
178 | # mconf: Used for the menuconfig target based on lxdialog | 183 | # mconf: Used for the menuconfig target based on lxdialog |
179 | hostprogs-y += mconf | 184 | hostprogs-y += mconf |
180 | lxdialog := checklist.o inputbox.o menubox.o textbox.o util.o yesno.o | 185 | lxdialog := checklist.o inputbox.o menubox.o textbox.o util.o yesno.o |
181 | mconf-objs := mconf.o zconf.tab.o $(addprefix lxdialog/, $(lxdialog)) | 186 | mconf-objs := mconf.o zconf.tab.o $(addprefix lxdialog/, $(lxdialog)) |
182 | 187 | ||
183 | HOSTLOADLIBES_mconf = $(shell . $(obj)/.mconf-cfg && echo $$libs) | 188 | HOSTLDLIBS_mconf = $(shell . $(obj)/.mconf-cfg && echo $$libs) |
184 | $(foreach f, mconf.o $(lxdialog), \ | 189 | $(foreach f, mconf.o $(lxdialog), \ |
185 | $(eval HOSTCFLAGS_$f = $$(shell . $(obj)/.mconf-cfg && echo $$$$cflags))) | 190 | $(eval HOSTCFLAGS_$f = $$(shell . $(obj)/.mconf-cfg && echo $$$$cflags))) |
186 | 191 | ||
187 | $(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/.mconf-cfg | 192 | $(obj)/mconf.o: $(obj)/.mconf-cfg |
193 | $(addprefix $(obj)/lxdialog/, $(lxdialog)): $(obj)/.mconf-cfg | ||
188 | 194 | ||
189 | # qconf: Used for the xconfig target based on Qt | 195 | # qconf: Used for the xconfig target based on Qt |
190 | hostprogs-y += qconf | 196 | hostprogs-y += qconf |
191 | qconf-cxxobjs := qconf.o | 197 | qconf-cxxobjs := qconf.o |
192 | qconf-objs := zconf.tab.o | 198 | qconf-objs := zconf.tab.o |
193 | 199 | ||
194 | HOSTLOADLIBES_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs) | 200 | HOSTLDLIBS_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs) |
195 | HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/.qconf-cfg && echo $$cflags) | 201 | HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/.qconf-cfg && echo $$cflags) |
196 | 202 | ||
197 | $(obj)/qconf.o: $(obj)/.qconf-cfg $(obj)/qconf.moc | 203 | $(obj)/qconf.o: $(obj)/.qconf-cfg $(obj)/qconf.moc |
@@ -206,7 +212,7 @@ $(obj)/%.moc: $(src)/%.h $(obj)/.qconf-cfg | |||
206 | hostprogs-y += gconf | 212 | hostprogs-y += gconf |
207 | gconf-objs := gconf.o zconf.tab.o | 213 | gconf-objs := gconf.o zconf.tab.o |
208 | 214 | ||
209 | HOSTLOADLIBES_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs) | 215 | HOSTLDLIBS_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs) |
210 | HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags) | 216 | HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags) |
211 | 217 | ||
212 | $(obj)/gconf.o: $(obj)/.gconf-cfg | 218 | $(obj)/gconf.o: $(obj)/.gconf-cfg |
@@ -215,6 +221,7 @@ $(obj)/zconf.tab.o: $(obj)/zconf.lex.c | |||
215 | 221 | ||
216 | # check if necessary packages are available, and configure build flags | 222 | # check if necessary packages are available, and configure build flags |
217 | define filechk_conf_cfg | 223 | define filechk_conf_cfg |
224 | $(CONFIG_SHELL) $(srctree)/scripts/kconfig/check-pkgconfig.sh; \ | ||
218 | $(CONFIG_SHELL) $< | 225 | $(CONFIG_SHELL) $< |
219 | endef | 226 | endef |
220 | 227 | ||
diff --git a/scripts/kconfig/check-pkgconfig.sh b/scripts/kconfig/check-pkgconfig.sh new file mode 100644 index 000000000000..7a1c40bfb58c --- /dev/null +++ b/scripts/kconfig/check-pkgconfig.sh | |||
@@ -0,0 +1,8 @@ | |||
1 | #!/bin/sh | ||
2 | # SPDX-License-Identifier: GPL-2.0 | ||
3 | # Check for pkg-config presence | ||
4 | |||
5 | if [ -z $(command -v pkg-config) ]; then | ||
6 | echo "'make *config' requires 'pkg-config'. Please install it." 1>&2 | ||
7 | exit 1 | ||
8 | fi | ||
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 671ff5364497..7b2b37260669 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -496,6 +496,7 @@ int main(int ac, char **av) | |||
496 | int opt; | 496 | int opt; |
497 | const char *name, *defconfig_file = NULL /* gcc uninit */; | 497 | const char *name, *defconfig_file = NULL /* gcc uninit */; |
498 | struct stat tmpstat; | 498 | struct stat tmpstat; |
499 | int no_conf_write = 0; | ||
499 | 500 | ||
500 | tty_stdio = isatty(0) && isatty(1); | 501 | tty_stdio = isatty(0) && isatty(1); |
501 | 502 | ||
@@ -507,6 +508,11 @@ int main(int ac, char **av) | |||
507 | input_mode = (enum input_mode)opt; | 508 | input_mode = (enum input_mode)opt; |
508 | switch (opt) { | 509 | switch (opt) { |
509 | case syncconfig: | 510 | case syncconfig: |
511 | /* | ||
512 | * syncconfig is invoked during the build stage. | ||
513 | * Suppress distracting "configuration written to ..." | ||
514 | */ | ||
515 | conf_set_message_callback(NULL); | ||
510 | sync_kconfig = 1; | 516 | sync_kconfig = 1; |
511 | break; | 517 | break; |
512 | case defconfig: | 518 | case defconfig: |
@@ -633,13 +639,14 @@ int main(int ac, char **av) | |||
633 | } | 639 | } |
634 | 640 | ||
635 | if (sync_kconfig) { | 641 | if (sync_kconfig) { |
636 | if (conf_get_changed()) { | 642 | name = getenv("KCONFIG_NOSILENTUPDATE"); |
637 | name = getenv("KCONFIG_NOSILENTUPDATE"); | 643 | if (name && *name) { |
638 | if (name && *name) { | 644 | if (conf_get_changed()) { |
639 | fprintf(stderr, | 645 | fprintf(stderr, |
640 | "\n*** The configuration requires explicit update.\n\n"); | 646 | "\n*** The configuration requires explicit update.\n\n"); |
641 | return 1; | 647 | return 1; |
642 | } | 648 | } |
649 | no_conf_write = 1; | ||
643 | } | 650 | } |
644 | } | 651 | } |
645 | 652 | ||
@@ -684,29 +691,32 @@ int main(int ac, char **av) | |||
684 | break; | 691 | break; |
685 | } | 692 | } |
686 | 693 | ||
687 | if (sync_kconfig) { | 694 | if (input_mode == savedefconfig) { |
688 | /* syncconfig is used during the build so we shall update autoconf. | ||
689 | * All other commands are only used to generate a config. | ||
690 | */ | ||
691 | if (conf_get_changed() && conf_write(NULL)) { | ||
692 | fprintf(stderr, "\n*** Error during writing of the configuration.\n\n"); | ||
693 | exit(1); | ||
694 | } | ||
695 | if (conf_write_autoconf()) { | ||
696 | fprintf(stderr, "\n*** Error during update of the configuration.\n\n"); | ||
697 | return 1; | ||
698 | } | ||
699 | } else if (input_mode == savedefconfig) { | ||
700 | if (conf_write_defconfig(defconfig_file)) { | 695 | if (conf_write_defconfig(defconfig_file)) { |
701 | fprintf(stderr, "n*** Error while saving defconfig to: %s\n\n", | 696 | fprintf(stderr, "n*** Error while saving defconfig to: %s\n\n", |
702 | defconfig_file); | 697 | defconfig_file); |
703 | return 1; | 698 | return 1; |
704 | } | 699 | } |
705 | } else if (input_mode != listnewconfig) { | 700 | } else if (input_mode != listnewconfig) { |
706 | if (conf_write(NULL)) { | 701 | if (!no_conf_write && conf_write(NULL)) { |
707 | fprintf(stderr, "\n*** Error during writing of the configuration.\n\n"); | 702 | fprintf(stderr, "\n*** Error during writing of the configuration.\n\n"); |
708 | exit(1); | 703 | exit(1); |
709 | } | 704 | } |
705 | |||
706 | /* | ||
707 | * Create auto.conf if it does not exist. | ||
708 | * This prevents GNU Make 4.1 or older from emitting | ||
709 | * "include/config/auto.conf: No such file or directory" | ||
710 | * in the top-level Makefile | ||
711 | * | ||
712 | * syncconfig always creates or updates auto.conf because it is | ||
713 | * used during the build. | ||
714 | */ | ||
715 | if (conf_write_autoconf(sync_kconfig) && sync_kconfig) { | ||
716 | fprintf(stderr, | ||
717 | "\n*** Error during sync of the configuration.\n\n"); | ||
718 | return 1; | ||
719 | } | ||
710 | } | 720 | } |
711 | return 0; | 721 | return 0; |
712 | } | 722 | } |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 39e20974f4a3..91d0a5c014ac 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -16,6 +16,64 @@ | |||
16 | 16 | ||
17 | #include "lkc.h" | 17 | #include "lkc.h" |
18 | 18 | ||
19 | /* return true if 'path' exists, false otherwise */ | ||
20 | static bool is_present(const char *path) | ||
21 | { | ||
22 | struct stat st; | ||
23 | |||
24 | return !stat(path, &st); | ||
25 | } | ||
26 | |||
27 | /* return true if 'path' exists and it is a directory, false otherwise */ | ||
28 | static bool is_dir(const char *path) | ||
29 | { | ||
30 | struct stat st; | ||
31 | |||
32 | if (stat(path, &st)) | ||
33 | return 0; | ||
34 | |||
35 | return S_ISDIR(st.st_mode); | ||
36 | } | ||
37 | |||
38 | /* | ||
39 | * Create the parent directory of the given path. | ||
40 | * | ||
41 | * For example, if 'include/config/auto.conf' is given, create 'include/config'. | ||
42 | */ | ||
43 | static int make_parent_dir(const char *path) | ||
44 | { | ||
45 | char tmp[PATH_MAX + 1]; | ||
46 | char *p; | ||
47 | |||
48 | strncpy(tmp, path, sizeof(tmp)); | ||
49 | tmp[sizeof(tmp) - 1] = 0; | ||
50 | |||
51 | /* Remove the base name. Just return if nothing is left */ | ||
52 | p = strrchr(tmp, '/'); | ||
53 | if (!p) | ||
54 | return 0; | ||
55 | *(p + 1) = 0; | ||
56 | |||
57 | /* Just in case it is an absolute path */ | ||
58 | p = tmp; | ||
59 | while (*p == '/') | ||
60 | p++; | ||
61 | |||
62 | while ((p = strchr(p, '/'))) { | ||
63 | *p = 0; | ||
64 | |||
65 | /* skip if the directory exists */ | ||
66 | if (!is_dir(tmp) && mkdir(tmp, 0755)) | ||
67 | return -1; | ||
68 | |||
69 | *p = '/'; | ||
70 | while (*p == '/') | ||
71 | p++; | ||
72 | } | ||
73 | |||
74 | return 0; | ||
75 | } | ||
76 | |||
19 | struct conf_printer { | 77 | struct conf_printer { |
20 | void (*print_symbol)(FILE *, struct symbol *, const char *, void *); | 78 | void (*print_symbol)(FILE *, struct symbol *, const char *, void *); |
21 | void (*print_comment)(FILE *, const char *, void *); | 79 | void (*print_comment)(FILE *, const char *, void *); |
@@ -43,16 +101,16 @@ static void conf_warning(const char *fmt, ...) | |||
43 | conf_warnings++; | 101 | conf_warnings++; |
44 | } | 102 | } |
45 | 103 | ||
46 | static void conf_default_message_callback(const char *fmt, va_list ap) | 104 | static void conf_default_message_callback(const char *s) |
47 | { | 105 | { |
48 | printf("#\n# "); | 106 | printf("#\n# "); |
49 | vprintf(fmt, ap); | 107 | printf("%s", s); |
50 | printf("\n#\n"); | 108 | printf("\n#\n"); |
51 | } | 109 | } |
52 | 110 | ||
53 | static void (*conf_message_callback) (const char *fmt, va_list ap) = | 111 | static void (*conf_message_callback)(const char *s) = |
54 | conf_default_message_callback; | 112 | conf_default_message_callback; |
55 | void conf_set_message_callback(void (*fn) (const char *fmt, va_list ap)) | 113 | void conf_set_message_callback(void (*fn)(const char *s)) |
56 | { | 114 | { |
57 | conf_message_callback = fn; | 115 | conf_message_callback = fn; |
58 | } | 116 | } |
@@ -60,10 +118,15 @@ void conf_set_message_callback(void (*fn) (const char *fmt, va_list ap)) | |||
60 | static void conf_message(const char *fmt, ...) | 118 | static void conf_message(const char *fmt, ...) |
61 | { | 119 | { |
62 | va_list ap; | 120 | va_list ap; |
121 | char buf[4096]; | ||
122 | |||
123 | if (!conf_message_callback) | ||
124 | return; | ||
63 | 125 | ||
64 | va_start(ap, fmt); | 126 | va_start(ap, fmt); |
65 | if (conf_message_callback) | 127 | |
66 | conf_message_callback(fmt, ap); | 128 | vsnprintf(buf, sizeof(buf), fmt, ap); |
129 | conf_message_callback(buf); | ||
67 | va_end(ap); | 130 | va_end(ap); |
68 | } | 131 | } |
69 | 132 | ||
@@ -83,7 +146,6 @@ const char *conf_get_autoconfig_name(void) | |||
83 | 146 | ||
84 | char *conf_get_default_confname(void) | 147 | char *conf_get_default_confname(void) |
85 | { | 148 | { |
86 | struct stat buf; | ||
87 | static char fullname[PATH_MAX+1]; | 149 | static char fullname[PATH_MAX+1]; |
88 | char *env, *name; | 150 | char *env, *name; |
89 | 151 | ||
@@ -91,7 +153,7 @@ char *conf_get_default_confname(void) | |||
91 | env = getenv(SRCTREE); | 153 | env = getenv(SRCTREE); |
92 | if (env) { | 154 | if (env) { |
93 | sprintf(fullname, "%s/%s", env, name); | 155 | sprintf(fullname, "%s/%s", env, name); |
94 | if (!stat(fullname, &buf)) | 156 | if (is_present(fullname)) |
95 | return fullname; | 157 | return fullname; |
96 | } | 158 | } |
97 | return name; | 159 | return name; |
@@ -397,7 +459,7 @@ int conf_read(const char *name) | |||
397 | 459 | ||
398 | for_all_symbols(i, sym) { | 460 | for_all_symbols(i, sym) { |
399 | sym_calc_value(sym); | 461 | sym_calc_value(sym); |
400 | if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO)) | 462 | if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE)) |
401 | continue; | 463 | continue; |
402 | if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { | 464 | if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { |
403 | /* check that calculated value agrees with saved value */ | 465 | /* check that calculated value agrees with saved value */ |
@@ -725,10 +787,9 @@ int conf_write(const char *name) | |||
725 | 787 | ||
726 | dirname[0] = 0; | 788 | dirname[0] = 0; |
727 | if (name && name[0]) { | 789 | if (name && name[0]) { |
728 | struct stat st; | ||
729 | char *slash; | 790 | char *slash; |
730 | 791 | ||
731 | if (!stat(name, &st) && S_ISDIR(st.st_mode)) { | 792 | if (is_dir(name)) { |
732 | strcpy(dirname, name); | 793 | strcpy(dirname, name); |
733 | strcat(dirname, "/"); | 794 | strcat(dirname, "/"); |
734 | basename = conf_get_configname(); | 795 | basename = conf_get_configname(); |
@@ -813,26 +874,59 @@ next: | |||
813 | return 0; | 874 | return 0; |
814 | } | 875 | } |
815 | 876 | ||
877 | /* write a dependency file as used by kbuild to track dependencies */ | ||
878 | static int conf_write_dep(const char *name) | ||
879 | { | ||
880 | struct file *file; | ||
881 | FILE *out; | ||
882 | |||
883 | if (!name) | ||
884 | name = ".kconfig.d"; | ||
885 | out = fopen("..config.tmp", "w"); | ||
886 | if (!out) | ||
887 | return 1; | ||
888 | fprintf(out, "deps_config := \\\n"); | ||
889 | for (file = file_list; file; file = file->next) { | ||
890 | if (file->next) | ||
891 | fprintf(out, "\t%s \\\n", file->name); | ||
892 | else | ||
893 | fprintf(out, "\t%s\n", file->name); | ||
894 | } | ||
895 | fprintf(out, "\n%s: \\\n" | ||
896 | "\t$(deps_config)\n\n", conf_get_autoconfig_name()); | ||
897 | |||
898 | env_write_dep(out, conf_get_autoconfig_name()); | ||
899 | |||
900 | fprintf(out, "\n$(deps_config): ;\n"); | ||
901 | fclose(out); | ||
902 | |||
903 | if (make_parent_dir(name)) | ||
904 | return 1; | ||
905 | rename("..config.tmp", name); | ||
906 | return 0; | ||
907 | } | ||
908 | |||
816 | static int conf_split_config(void) | 909 | static int conf_split_config(void) |
817 | { | 910 | { |
818 | const char *name; | 911 | const char *name; |
819 | char path[PATH_MAX+1]; | 912 | char path[PATH_MAX+1]; |
820 | char *s, *d, c; | 913 | char *s, *d, c; |
821 | struct symbol *sym; | 914 | struct symbol *sym; |
822 | struct stat sb; | ||
823 | int res, i, fd; | 915 | int res, i, fd; |
824 | 916 | ||
825 | name = conf_get_autoconfig_name(); | 917 | name = conf_get_autoconfig_name(); |
826 | conf_read_simple(name, S_DEF_AUTO); | 918 | conf_read_simple(name, S_DEF_AUTO); |
827 | sym_calc_value(modules_sym); | 919 | sym_calc_value(modules_sym); |
828 | 920 | ||
921 | if (make_parent_dir("include/config/foo.h")) | ||
922 | return 1; | ||
829 | if (chdir("include/config")) | 923 | if (chdir("include/config")) |
830 | return 1; | 924 | return 1; |
831 | 925 | ||
832 | res = 0; | 926 | res = 0; |
833 | for_all_symbols(i, sym) { | 927 | for_all_symbols(i, sym) { |
834 | sym_calc_value(sym); | 928 | sym_calc_value(sym); |
835 | if ((sym->flags & SYMBOL_AUTO) || !sym->name) | 929 | if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name) |
836 | continue; | 930 | continue; |
837 | if (sym->flags & SYMBOL_WRITE) { | 931 | if (sym->flags & SYMBOL_WRITE) { |
838 | if (sym->flags & SYMBOL_DEF_AUTO) { | 932 | if (sym->flags & SYMBOL_DEF_AUTO) { |
@@ -897,19 +991,12 @@ static int conf_split_config(void) | |||
897 | res = 1; | 991 | res = 1; |
898 | break; | 992 | break; |
899 | } | 993 | } |
900 | /* | 994 | |
901 | * Create directory components, | 995 | if (make_parent_dir(path)) { |
902 | * unless they exist already. | 996 | res = 1; |
903 | */ | 997 | goto out; |
904 | d = path; | ||
905 | while ((d = strchr(d, '/'))) { | ||
906 | *d = 0; | ||
907 | if (stat(path, &sb) && mkdir(path, 0755)) { | ||
908 | res = 1; | ||
909 | goto out; | ||
910 | } | ||
911 | *d++ = '/'; | ||
912 | } | 998 | } |
999 | |||
913 | /* Try it again. */ | 1000 | /* Try it again. */ |
914 | fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); | 1001 | fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); |
915 | if (fd == -1) { | 1002 | if (fd == -1) { |
@@ -926,16 +1013,20 @@ out: | |||
926 | return res; | 1013 | return res; |
927 | } | 1014 | } |
928 | 1015 | ||
929 | int conf_write_autoconf(void) | 1016 | int conf_write_autoconf(int overwrite) |
930 | { | 1017 | { |
931 | struct symbol *sym; | 1018 | struct symbol *sym; |
932 | const char *name; | 1019 | const char *name; |
1020 | const char *autoconf_name = conf_get_autoconfig_name(); | ||
933 | FILE *out, *tristate, *out_h; | 1021 | FILE *out, *tristate, *out_h; |
934 | int i; | 1022 | int i; |
935 | 1023 | ||
1024 | if (!overwrite && is_present(autoconf_name)) | ||
1025 | return 0; | ||
1026 | |||
936 | sym_clear_all_valid(); | 1027 | sym_clear_all_valid(); |
937 | 1028 | ||
938 | file_write_dep("include/config/auto.conf.cmd"); | 1029 | conf_write_dep("include/config/auto.conf.cmd"); |
939 | 1030 | ||
940 | if (conf_split_config()) | 1031 | if (conf_split_config()) |
941 | return 1; | 1032 | return 1; |
@@ -982,19 +1073,26 @@ int conf_write_autoconf(void) | |||
982 | name = getenv("KCONFIG_AUTOHEADER"); | 1073 | name = getenv("KCONFIG_AUTOHEADER"); |
983 | if (!name) | 1074 | if (!name) |
984 | name = "include/generated/autoconf.h"; | 1075 | name = "include/generated/autoconf.h"; |
1076 | if (make_parent_dir(name)) | ||
1077 | return 1; | ||
985 | if (rename(".tmpconfig.h", name)) | 1078 | if (rename(".tmpconfig.h", name)) |
986 | return 1; | 1079 | return 1; |
1080 | |||
987 | name = getenv("KCONFIG_TRISTATE"); | 1081 | name = getenv("KCONFIG_TRISTATE"); |
988 | if (!name) | 1082 | if (!name) |
989 | name = "include/config/tristate.conf"; | 1083 | name = "include/config/tristate.conf"; |
1084 | if (make_parent_dir(name)) | ||
1085 | return 1; | ||
990 | if (rename(".tmpconfig_tristate", name)) | 1086 | if (rename(".tmpconfig_tristate", name)) |
991 | return 1; | 1087 | return 1; |
992 | name = conf_get_autoconfig_name(); | 1088 | |
1089 | if (make_parent_dir(autoconf_name)) | ||
1090 | return 1; | ||
993 | /* | 1091 | /* |
994 | * This must be the last step, kbuild has a dependency on auto.conf | 1092 | * This must be the last step, kbuild has a dependency on auto.conf |
995 | * and this marks the successful completion of the previous steps. | 1093 | * and this marks the successful completion of the previous steps. |
996 | */ | 1094 | */ |
997 | if (rename(".tmpconfig", name)) | 1095 | if (rename(".tmpconfig", autoconf_name)) |
998 | return 1; | 1096 | return 1; |
999 | 1097 | ||
1000 | return 0; | 1098 | return 0; |
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 94a383b21df6..7c329e179007 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h | |||
@@ -141,7 +141,7 @@ struct symbol { | |||
141 | #define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */ | 141 | #define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */ |
142 | #define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */ | 142 | #define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */ |
143 | #define SYMBOL_CHANGED 0x0400 /* ? */ | 143 | #define SYMBOL_CHANGED 0x0400 /* ? */ |
144 | #define SYMBOL_AUTO 0x1000 /* value from environment variable */ | 144 | #define SYMBOL_NO_WRITE 0x1000 /* Symbol for internal use only; it will not be written */ |
145 | #define SYMBOL_CHECKED 0x2000 /* used during dependency checking */ | 145 | #define SYMBOL_CHECKED 0x2000 /* used during dependency checking */ |
146 | #define SYMBOL_WARNED 0x8000 /* warning has been issued */ | 146 | #define SYMBOL_WARNED 0x8000 /* warning has been issued */ |
147 | 147 | ||
@@ -171,6 +171,9 @@ struct symbol { | |||
171 | * config BAZ | 171 | * config BAZ |
172 | * int "BAZ Value" | 172 | * int "BAZ Value" |
173 | * range 1..255 | 173 | * range 1..255 |
174 | * | ||
175 | * Please, also check zconf.y:print_symbol() when modifying the | ||
176 | * list of property types! | ||
174 | */ | 177 | */ |
175 | enum prop_type { | 178 | enum prop_type { |
176 | P_UNKNOWN, | 179 | P_UNKNOWN, |
@@ -182,7 +185,6 @@ enum prop_type { | |||
182 | P_SELECT, /* select BAR */ | 185 | P_SELECT, /* select BAR */ |
183 | P_IMPLY, /* imply BAR */ | 186 | P_IMPLY, /* imply BAR */ |
184 | P_RANGE, /* range 7..100 (for a symbol) */ | 187 | P_RANGE, /* range 7..100 (for a symbol) */ |
185 | P_ENV, /* value from environment variable */ | ||
186 | P_SYMBOL, /* where a symbol is defined */ | 188 | P_SYMBOL, /* where a symbol is defined */ |
187 | }; | 189 | }; |
188 | 190 | ||
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 610c4ab54d76..36f578415c4a 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c | |||
@@ -101,8 +101,8 @@ const char *dbg_sym_flags(int val) | |||
101 | strcat(buf, "write/"); | 101 | strcat(buf, "write/"); |
102 | if (val & SYMBOL_CHANGED) | 102 | if (val & SYMBOL_CHANGED) |
103 | strcat(buf, "changed/"); | 103 | strcat(buf, "changed/"); |
104 | if (val & SYMBOL_AUTO) | 104 | if (val & SYMBOL_NO_WRITE) |
105 | strcat(buf, "auto/"); | 105 | strcat(buf, "no_write/"); |
106 | 106 | ||
107 | buf[strlen(buf) - 1] = '\0'; | 107 | buf[strlen(buf) - 1] = '\0'; |
108 | 108 | ||
@@ -525,6 +525,7 @@ void on_save_activate(GtkMenuItem * menuitem, gpointer user_data) | |||
525 | { | 525 | { |
526 | if (conf_write(NULL)) | 526 | if (conf_write(NULL)) |
527 | text_insert_msg("Error", "Unable to save configuration !"); | 527 | text_insert_msg("Error", "Unable to save configuration !"); |
528 | conf_write_autoconf(0); | ||
528 | } | 529 | } |
529 | 530 | ||
530 | 531 | ||
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index ed3ff88e60ba..9eb7c837cd8f 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h | |||
@@ -97,7 +97,6 @@ void menu_set_type(int type); | |||
97 | 97 | ||
98 | /* util.c */ | 98 | /* util.c */ |
99 | struct file *file_lookup(const char *name); | 99 | struct file *file_lookup(const char *name); |
100 | int file_write_dep(const char *name); | ||
101 | void *xmalloc(size_t size); | 100 | void *xmalloc(size_t size); |
102 | void *xcalloc(size_t nmemb, size_t size); | 101 | void *xcalloc(size_t nmemb, size_t size); |
103 | void *xrealloc(void *p, size_t size); | 102 | void *xrealloc(void *p, size_t size); |
@@ -126,7 +125,6 @@ const char *sym_get_string_default(struct symbol *sym); | |||
126 | struct symbol *sym_check_deps(struct symbol *sym); | 125 | struct symbol *sym_check_deps(struct symbol *sym); |
127 | struct property *prop_alloc(enum prop_type type, struct symbol *sym); | 126 | struct property *prop_alloc(enum prop_type type, struct symbol *sym); |
128 | struct symbol *prop_get_symbol(struct property *prop); | 127 | struct symbol *prop_get_symbol(struct property *prop); |
129 | struct property *sym_get_env_prop(struct symbol *sym); | ||
130 | 128 | ||
131 | static inline tristate sym_get_tristate_value(struct symbol *sym) | 129 | static inline tristate sym_get_tristate_value(struct symbol *sym) |
132 | { | 130 | { |
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index a8b7a330587e..86c267540ccc 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h | |||
@@ -7,10 +7,10 @@ int conf_read(const char *name); | |||
7 | int conf_read_simple(const char *name, int); | 7 | int conf_read_simple(const char *name, int); |
8 | int conf_write_defconfig(const char *name); | 8 | int conf_write_defconfig(const char *name); |
9 | int conf_write(const char *name); | 9 | int conf_write(const char *name); |
10 | int conf_write_autoconf(void); | 10 | int conf_write_autoconf(int overwrite); |
11 | bool conf_get_changed(void); | 11 | bool conf_get_changed(void); |
12 | void conf_set_changed_callback(void (*fn)(void)); | 12 | void conf_set_changed_callback(void (*fn)(void)); |
13 | void conf_set_message_callback(void (*fn)(const char *fmt, va_list ap)); | 13 | void conf_set_message_callback(void (*fn)(const char *s)); |
14 | 14 | ||
15 | /* menu.c */ | 15 | /* menu.c */ |
16 | extern struct menu rootmenu; | 16 | extern struct menu rootmenu; |
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 5294ed159b98..83b5836615fb 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
@@ -772,16 +772,13 @@ static void show_helptext(const char *title, const char *text) | |||
772 | show_textbox(title, text, 0, 0); | 772 | show_textbox(title, text, 0, 0); |
773 | } | 773 | } |
774 | 774 | ||
775 | static void conf_message_callback(const char *fmt, va_list ap) | 775 | static void conf_message_callback(const char *s) |
776 | { | 776 | { |
777 | char buf[PATH_MAX+1]; | ||
778 | |||
779 | vsnprintf(buf, sizeof(buf), fmt, ap); | ||
780 | if (save_and_exit) { | 777 | if (save_and_exit) { |
781 | if (!silent) | 778 | if (!silent) |
782 | printf("%s", buf); | 779 | printf("%s", s); |
783 | } else { | 780 | } else { |
784 | show_textbox(NULL, buf, 6, 60); | 781 | show_textbox(NULL, s, 6, 60); |
785 | } | 782 | } |
786 | } | 783 | } |
787 | 784 | ||
@@ -977,6 +974,7 @@ static int handle_exit(void) | |||
977 | "\n\n"); | 974 | "\n\n"); |
978 | return 1; | 975 | return 1; |
979 | } | 976 | } |
977 | conf_write_autoconf(0); | ||
980 | /* fall through */ | 978 | /* fall through */ |
981 | case -1: | 979 | case -1: |
982 | if (!silent) | 980 | if (!silent) |
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 379a119dcd1e..4cf15d449c05 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c | |||
@@ -212,7 +212,7 @@ void menu_add_option(int token, char *arg) | |||
212 | sym_defconfig_list = current_entry->sym; | 212 | sym_defconfig_list = current_entry->sym; |
213 | else if (sym_defconfig_list != current_entry->sym) | 213 | else if (sym_defconfig_list != current_entry->sym) |
214 | zconf_error("trying to redefine defconfig symbol"); | 214 | zconf_error("trying to redefine defconfig symbol"); |
215 | sym_defconfig_list->flags |= SYMBOL_AUTO; | 215 | sym_defconfig_list->flags |= SYMBOL_NO_WRITE; |
216 | break; | 216 | break; |
217 | case T_OPT_ALLNOCONFIG_Y: | 217 | case T_OPT_ALLNOCONFIG_Y: |
218 | current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y; | 218 | current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y; |
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 97b78445584b..1ef232ae5ab9 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c | |||
@@ -674,6 +674,7 @@ static int do_exit(void) | |||
674 | "Your configuration changes were NOT saved.", | 674 | "Your configuration changes were NOT saved.", |
675 | 1, | 675 | 1, |
676 | "<OK>"); | 676 | "<OK>"); |
677 | conf_write_autoconf(0); | ||
677 | break; | 678 | break; |
678 | default: | 679 | default: |
679 | btn_dialog( | 680 | btn_dialog( |
@@ -1210,12 +1211,9 @@ static void conf(struct menu *menu) | |||
1210 | } | 1211 | } |
1211 | } | 1212 | } |
1212 | 1213 | ||
1213 | static void conf_message_callback(const char *fmt, va_list ap) | 1214 | static void conf_message_callback(const char *s) |
1214 | { | 1215 | { |
1215 | char buf[1024]; | 1216 | btn_dialog(main_window, s, 1, "<OK>"); |
1216 | |||
1217 | vsnprintf(buf, sizeof(buf), fmt, ap); | ||
1218 | btn_dialog(main_window, buf, 1, "<OK>"); | ||
1219 | } | 1217 | } |
1220 | 1218 | ||
1221 | static void show_help(struct menu *menu) | 1219 | static void show_help(struct menu *menu) |
diff --git a/scripts/kconfig/preprocess.c b/scripts/kconfig/preprocess.c index 65da87fce907..5ca2df790d3c 100644 --- a/scripts/kconfig/preprocess.c +++ b/scripts/kconfig/preprocess.c | |||
@@ -156,7 +156,7 @@ static char *do_shell(int argc, char *argv[]) | |||
156 | nread--; | 156 | nread--; |
157 | 157 | ||
158 | /* remove trailing new lines */ | 158 | /* remove trailing new lines */ |
159 | while (buf[nread - 1] == '\n') | 159 | while (nread > 0 && buf[nread - 1] == '\n') |
160 | nread--; | 160 | nread--; |
161 | 161 | ||
162 | buf[nread] = 0; | 162 | buf[nread] = 0; |
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index ad9c22dd04f5..ef4310f2558b 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc | |||
@@ -1149,7 +1149,6 @@ QString ConfigInfoView::debug_info(struct symbol *sym) | |||
1149 | case P_DEFAULT: | 1149 | case P_DEFAULT: |
1150 | case P_SELECT: | 1150 | case P_SELECT: |
1151 | case P_RANGE: | 1151 | case P_RANGE: |
1152 | case P_ENV: | ||
1153 | debug += prop_get_type_name(prop->type); | 1152 | debug += prop_get_type_name(prop->type); |
1154 | debug += ": "; | 1153 | debug += ": "; |
1155 | expr_print(prop->expr, expr_print_help, &debug, E_NONE); | 1154 | expr_print(prop->expr, expr_print_help, &debug, E_NONE); |
@@ -1535,6 +1534,8 @@ bool ConfigMainWindow::saveConfig(void) | |||
1535 | QMessageBox::information(this, "qconf", "Unable to save configuration!"); | 1534 | QMessageBox::information(this, "qconf", "Unable to save configuration!"); |
1536 | return false; | 1535 | return false; |
1537 | } | 1536 | } |
1537 | conf_write_autoconf(0); | ||
1538 | |||
1538 | return true; | 1539 | return true; |
1539 | } | 1540 | } |
1540 | 1541 | ||
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 7c9a88e91cfa..703b9b899ee9 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
@@ -76,15 +76,6 @@ struct property *sym_get_choice_prop(struct symbol *sym) | |||
76 | return NULL; | 76 | return NULL; |
77 | } | 77 | } |
78 | 78 | ||
79 | struct property *sym_get_env_prop(struct symbol *sym) | ||
80 | { | ||
81 | struct property *prop; | ||
82 | |||
83 | for_all_properties(sym, prop, P_ENV) | ||
84 | return prop; | ||
85 | return NULL; | ||
86 | } | ||
87 | |||
88 | static struct property *sym_get_default_prop(struct symbol *sym) | 79 | static struct property *sym_get_default_prop(struct symbol *sym) |
89 | { | 80 | { |
90 | struct property *prop; | 81 | struct property *prop; |
@@ -463,7 +454,7 @@ void sym_calc_value(struct symbol *sym) | |||
463 | } | 454 | } |
464 | } | 455 | } |
465 | 456 | ||
466 | if (sym->flags & SYMBOL_AUTO) | 457 | if (sym->flags & SYMBOL_NO_WRITE) |
467 | sym->flags &= ~SYMBOL_WRITE; | 458 | sym->flags &= ~SYMBOL_WRITE; |
468 | 459 | ||
469 | if (sym->flags & SYMBOL_NEED_SET_CHOICE_VALUES) | 460 | if (sym->flags & SYMBOL_NEED_SET_CHOICE_VALUES) |
@@ -1020,7 +1011,7 @@ static struct dep_stack { | |||
1020 | struct dep_stack *prev, *next; | 1011 | struct dep_stack *prev, *next; |
1021 | struct symbol *sym; | 1012 | struct symbol *sym; |
1022 | struct property *prop; | 1013 | struct property *prop; |
1023 | struct expr *expr; | 1014 | struct expr **expr; |
1024 | } *check_top; | 1015 | } *check_top; |
1025 | 1016 | ||
1026 | static void dep_stack_insert(struct dep_stack *stack, struct symbol *sym) | 1017 | static void dep_stack_insert(struct dep_stack *stack, struct symbol *sym) |
@@ -1085,31 +1076,42 @@ static void sym_check_print_recursive(struct symbol *last_sym) | |||
1085 | fprintf(stderr, "%s:%d:error: recursive dependency detected!\n", | 1076 | fprintf(stderr, "%s:%d:error: recursive dependency detected!\n", |
1086 | prop->file->name, prop->lineno); | 1077 | prop->file->name, prop->lineno); |
1087 | 1078 | ||
1088 | if (stack->expr) { | 1079 | if (sym_is_choice(sym)) { |
1089 | fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n", | 1080 | fprintf(stderr, "%s:%d:\tchoice %s contains symbol %s\n", |
1090 | prop->file->name, prop->lineno, | 1081 | menu->file->name, menu->lineno, |
1082 | sym->name ? sym->name : "<choice>", | ||
1083 | next_sym->name ? next_sym->name : "<choice>"); | ||
1084 | } else if (sym_is_choice_value(sym)) { | ||
1085 | fprintf(stderr, "%s:%d:\tsymbol %s is part of choice %s\n", | ||
1086 | menu->file->name, menu->lineno, | ||
1091 | sym->name ? sym->name : "<choice>", | 1087 | sym->name ? sym->name : "<choice>", |
1092 | prop_get_type_name(prop->type), | ||
1093 | next_sym->name ? next_sym->name : "<choice>"); | 1088 | next_sym->name ? next_sym->name : "<choice>"); |
1094 | } else if (stack->prop) { | 1089 | } else if (stack->expr == &sym->dir_dep.expr) { |
1095 | fprintf(stderr, "%s:%d:\tsymbol %s depends on %s\n", | 1090 | fprintf(stderr, "%s:%d:\tsymbol %s depends on %s\n", |
1096 | prop->file->name, prop->lineno, | 1091 | prop->file->name, prop->lineno, |
1097 | sym->name ? sym->name : "<choice>", | 1092 | sym->name ? sym->name : "<choice>", |
1098 | next_sym->name ? next_sym->name : "<choice>"); | 1093 | next_sym->name ? next_sym->name : "<choice>"); |
1099 | } else if (sym_is_choice(sym)) { | 1094 | } else if (stack->expr == &sym->rev_dep.expr) { |
1100 | fprintf(stderr, "%s:%d:\tchoice %s contains symbol %s\n", | 1095 | fprintf(stderr, "%s:%d:\tsymbol %s is selected by %s\n", |
1101 | menu->file->name, menu->lineno, | 1096 | prop->file->name, prop->lineno, |
1102 | sym->name ? sym->name : "<choice>", | 1097 | sym->name ? sym->name : "<choice>", |
1103 | next_sym->name ? next_sym->name : "<choice>"); | 1098 | next_sym->name ? next_sym->name : "<choice>"); |
1104 | } else if (sym_is_choice_value(sym)) { | 1099 | } else if (stack->expr == &sym->implied.expr) { |
1105 | fprintf(stderr, "%s:%d:\tsymbol %s is part of choice %s\n", | 1100 | fprintf(stderr, "%s:%d:\tsymbol %s is implied by %s\n", |
1106 | menu->file->name, menu->lineno, | 1101 | prop->file->name, prop->lineno, |
1107 | sym->name ? sym->name : "<choice>", | 1102 | sym->name ? sym->name : "<choice>", |
1108 | next_sym->name ? next_sym->name : "<choice>"); | 1103 | next_sym->name ? next_sym->name : "<choice>"); |
1104 | } else if (stack->expr) { | ||
1105 | fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n", | ||
1106 | prop->file->name, prop->lineno, | ||
1107 | sym->name ? sym->name : "<choice>", | ||
1108 | prop_get_type_name(prop->type), | ||
1109 | next_sym->name ? next_sym->name : "<choice>"); | ||
1109 | } else { | 1110 | } else { |
1110 | fprintf(stderr, "%s:%d:\tsymbol %s is selected by %s\n", | 1111 | fprintf(stderr, "%s:%d:\tsymbol %s %s is visible depending on %s\n", |
1111 | prop->file->name, prop->lineno, | 1112 | prop->file->name, prop->lineno, |
1112 | sym->name ? sym->name : "<choice>", | 1113 | sym->name ? sym->name : "<choice>", |
1114 | prop_get_type_name(prop->type), | ||
1113 | next_sym->name ? next_sym->name : "<choice>"); | 1115 | next_sym->name ? next_sym->name : "<choice>"); |
1114 | } | 1116 | } |
1115 | } | 1117 | } |
@@ -1166,12 +1168,26 @@ static struct symbol *sym_check_sym_deps(struct symbol *sym) | |||
1166 | 1168 | ||
1167 | dep_stack_insert(&stack, sym); | 1169 | dep_stack_insert(&stack, sym); |
1168 | 1170 | ||
1171 | stack.expr = &sym->dir_dep.expr; | ||
1172 | sym2 = sym_check_expr_deps(sym->dir_dep.expr); | ||
1173 | if (sym2) | ||
1174 | goto out; | ||
1175 | |||
1176 | stack.expr = &sym->rev_dep.expr; | ||
1169 | sym2 = sym_check_expr_deps(sym->rev_dep.expr); | 1177 | sym2 = sym_check_expr_deps(sym->rev_dep.expr); |
1170 | if (sym2) | 1178 | if (sym2) |
1171 | goto out; | 1179 | goto out; |
1172 | 1180 | ||
1181 | stack.expr = &sym->implied.expr; | ||
1182 | sym2 = sym_check_expr_deps(sym->implied.expr); | ||
1183 | if (sym2) | ||
1184 | goto out; | ||
1185 | |||
1186 | stack.expr = NULL; | ||
1187 | |||
1173 | for (prop = sym->prop; prop; prop = prop->next) { | 1188 | for (prop = sym->prop; prop; prop = prop->next) { |
1174 | if (prop->type == P_CHOICE || prop->type == P_SELECT) | 1189 | if (prop->type == P_CHOICE || prop->type == P_SELECT || |
1190 | prop->type == P_IMPLY) | ||
1175 | continue; | 1191 | continue; |
1176 | stack.prop = prop; | 1192 | stack.prop = prop; |
1177 | sym2 = sym_check_expr_deps(prop->visible.expr); | 1193 | sym2 = sym_check_expr_deps(prop->visible.expr); |
@@ -1179,7 +1195,7 @@ static struct symbol *sym_check_sym_deps(struct symbol *sym) | |||
1179 | break; | 1195 | break; |
1180 | if (prop->type != P_DEFAULT || sym_is_choice(sym)) | 1196 | if (prop->type != P_DEFAULT || sym_is_choice(sym)) |
1181 | continue; | 1197 | continue; |
1182 | stack.expr = prop->expr; | 1198 | stack.expr = &prop->expr; |
1183 | sym2 = sym_check_expr_deps(prop->expr); | 1199 | sym2 = sym_check_expr_deps(prop->expr); |
1184 | if (sym2) | 1200 | if (sym2) |
1185 | break; | 1201 | break; |
@@ -1257,9 +1273,6 @@ struct symbol *sym_check_deps(struct symbol *sym) | |||
1257 | sym->flags &= ~SYMBOL_CHECK; | 1273 | sym->flags &= ~SYMBOL_CHECK; |
1258 | } | 1274 | } |
1259 | 1275 | ||
1260 | if (sym2 && sym2 == sym) | ||
1261 | sym2 = NULL; | ||
1262 | |||
1263 | return sym2; | 1276 | return sym2; |
1264 | } | 1277 | } |
1265 | 1278 | ||
@@ -1298,8 +1311,6 @@ const char *prop_get_type_name(enum prop_type type) | |||
1298 | switch (type) { | 1311 | switch (type) { |
1299 | case P_PROMPT: | 1312 | case P_PROMPT: |
1300 | return "prompt"; | 1313 | return "prompt"; |
1301 | case P_ENV: | ||
1302 | return "env"; | ||
1303 | case P_COMMENT: | 1314 | case P_COMMENT: |
1304 | return "comment"; | 1315 | return "comment"; |
1305 | case P_MENU: | 1316 | case P_MENU: |
diff --git a/scripts/kconfig/tests/warn_recursive_dep/Kconfig b/scripts/kconfig/tests/err_recursive_dep/Kconfig index a65bfcb7137e..ebdb3ffd8717 100644 --- a/scripts/kconfig/tests/warn_recursive_dep/Kconfig +++ b/scripts/kconfig/tests/err_recursive_dep/Kconfig | |||
@@ -1,3 +1,5 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
1 | # depends on itself | 3 | # depends on itself |
2 | 4 | ||
3 | config A | 5 | config A |
@@ -31,7 +33,6 @@ config D2 | |||
31 | bool | 33 | bool |
32 | 34 | ||
33 | # depends on and imply | 35 | # depends on and imply |
34 | # This is not recursive dependency | ||
35 | 36 | ||
36 | config E1 | 37 | config E1 |
37 | bool "E1" | 38 | bool "E1" |
diff --git a/scripts/kconfig/tests/err_recursive_dep/__init__.py b/scripts/kconfig/tests/err_recursive_dep/__init__.py new file mode 100644 index 000000000000..5f3821b43ce6 --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_dep/__init__.py | |||
@@ -0,0 +1,10 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | """ | ||
3 | Detect recursive dependency error. | ||
4 | |||
5 | Recursive dependency should be treated as an error. | ||
6 | """ | ||
7 | |||
8 | def test(conf): | ||
9 | assert conf.oldaskconfig() == 1 | ||
10 | assert conf.stderr_contains('expected_stderr') | ||
diff --git a/scripts/kconfig/tests/err_recursive_dep/expected_stderr b/scripts/kconfig/tests/err_recursive_dep/expected_stderr new file mode 100644 index 000000000000..84679b104655 --- /dev/null +++ b/scripts/kconfig/tests/err_recursive_dep/expected_stderr | |||
@@ -0,0 +1,38 @@ | |||
1 | Kconfig:11:error: recursive dependency detected! | ||
2 | Kconfig:11: symbol B is selected by B | ||
3 | For a resolution refer to Documentation/kbuild/kconfig-language.txt | ||
4 | subsection "Kconfig recursive dependency limitations" | ||
5 | |||
6 | Kconfig:5:error: recursive dependency detected! | ||
7 | Kconfig:5: symbol A depends on A | ||
8 | For a resolution refer to Documentation/kbuild/kconfig-language.txt | ||
9 | subsection "Kconfig recursive dependency limitations" | ||
10 | |||
11 | Kconfig:17:error: recursive dependency detected! | ||
12 | Kconfig:17: symbol C1 depends on C2 | ||
13 | Kconfig:21: symbol C2 depends on C1 | ||
14 | For a resolution refer to Documentation/kbuild/kconfig-language.txt | ||
15 | subsection "Kconfig recursive dependency limitations" | ||
16 | |||
17 | Kconfig:32:error: recursive dependency detected! | ||
18 | Kconfig:32: symbol D2 is selected by D1 | ||
19 | Kconfig:27: symbol D1 depends on D2 | ||
20 | For a resolution refer to Documentation/kbuild/kconfig-language.txt | ||
21 | subsection "Kconfig recursive dependency limitations" | ||
22 | |||
23 | Kconfig:37:error: recursive dependency detected! | ||
24 | Kconfig:37: symbol E1 depends on E2 | ||
25 | Kconfig:42: symbol E2 is implied by E1 | ||
26 | For a resolution refer to Documentation/kbuild/kconfig-language.txt | ||
27 | subsection "Kconfig recursive dependency limitations" | ||
28 | |||
29 | Kconfig:60:error: recursive dependency detected! | ||
30 | Kconfig:60: symbol G depends on G | ||
31 | For a resolution refer to Documentation/kbuild/kconfig-language.txt | ||
32 | subsection "Kconfig recursive dependency limitations" | ||
33 | |||
34 | Kconfig:51:error: recursive dependency detected! | ||
35 | Kconfig:51: symbol F2 depends on F1 | ||
36 | Kconfig:49: symbol F1 default value contains F2 | ||
37 | For a resolution refer to Documentation/kbuild/kconfig-language.txt | ||
38 | subsection "Kconfig recursive dependency limitations" | ||
diff --git a/scripts/kconfig/tests/warn_recursive_dep/__init__.py b/scripts/kconfig/tests/warn_recursive_dep/__init__.py deleted file mode 100644 index adb21951ba41..000000000000 --- a/scripts/kconfig/tests/warn_recursive_dep/__init__.py +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | """ | ||
2 | Warn recursive inclusion. | ||
3 | |||
4 | Recursive dependency should be warned. | ||
5 | """ | ||
6 | |||
7 | def test(conf): | ||
8 | assert conf.oldaskconfig() == 0 | ||
9 | assert conf.stderr_contains('expected_stderr') | ||
diff --git a/scripts/kconfig/tests/warn_recursive_dep/expected_stderr b/scripts/kconfig/tests/warn_recursive_dep/expected_stderr deleted file mode 100644 index 3de807dd9cb2..000000000000 --- a/scripts/kconfig/tests/warn_recursive_dep/expected_stderr +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | Kconfig:9:error: recursive dependency detected! | ||
2 | Kconfig:9: symbol B is selected by B | ||
3 | For a resolution refer to Documentation/kbuild/kconfig-language.txt | ||
4 | subsection "Kconfig recursive dependency limitations" | ||
5 | |||
6 | Kconfig:3:error: recursive dependency detected! | ||
7 | Kconfig:3: symbol A depends on A | ||
8 | For a resolution refer to Documentation/kbuild/kconfig-language.txt | ||
9 | subsection "Kconfig recursive dependency limitations" | ||
10 | |||
11 | Kconfig:15:error: recursive dependency detected! | ||
12 | Kconfig:15: symbol C1 depends on C2 | ||
13 | Kconfig:19: symbol C2 depends on C1 | ||
14 | For a resolution refer to Documentation/kbuild/kconfig-language.txt | ||
15 | subsection "Kconfig recursive dependency limitations" | ||
16 | |||
17 | Kconfig:30:error: recursive dependency detected! | ||
18 | Kconfig:30: symbol D2 is selected by D1 | ||
19 | Kconfig:25: symbol D1 depends on D2 | ||
20 | For a resolution refer to Documentation/kbuild/kconfig-language.txt | ||
21 | subsection "Kconfig recursive dependency limitations" | ||
22 | |||
23 | Kconfig:59:error: recursive dependency detected! | ||
24 | Kconfig:59: symbol G depends on G | ||
25 | For a resolution refer to Documentation/kbuild/kconfig-language.txt | ||
26 | subsection "Kconfig recursive dependency limitations" | ||
27 | |||
28 | Kconfig:50:error: recursive dependency detected! | ||
29 | Kconfig:50: symbol F2 depends on F1 | ||
30 | Kconfig:48: symbol F1 default value contains F2 | ||
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index a365594770d9..d999683bb2a7 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c | |||
@@ -29,36 +29,6 @@ struct file *file_lookup(const char *name) | |||
29 | return file; | 29 | return file; |
30 | } | 30 | } |
31 | 31 | ||
32 | /* write a dependency file as used by kbuild to track dependencies */ | ||
33 | int file_write_dep(const char *name) | ||
34 | { | ||
35 | struct file *file; | ||
36 | FILE *out; | ||
37 | |||
38 | if (!name) | ||
39 | name = ".kconfig.d"; | ||
40 | out = fopen("..config.tmp", "w"); | ||
41 | if (!out) | ||
42 | return 1; | ||
43 | fprintf(out, "deps_config := \\\n"); | ||
44 | for (file = file_list; file; file = file->next) { | ||
45 | if (file->next) | ||
46 | fprintf(out, "\t%s \\\n", file->name); | ||
47 | else | ||
48 | fprintf(out, "\t%s\n", file->name); | ||
49 | } | ||
50 | fprintf(out, "\n%s: \\\n" | ||
51 | "\t$(deps_config)\n\n", conf_get_autoconfig_name()); | ||
52 | |||
53 | env_write_dep(out, conf_get_autoconfig_name()); | ||
54 | |||
55 | fprintf(out, "\n$(deps_config): ;\n"); | ||
56 | fclose(out); | ||
57 | rename("..config.tmp", name); | ||
58 | return 0; | ||
59 | } | ||
60 | |||
61 | |||
62 | /* Allocate initial growable string */ | 32 | /* Allocate initial growable string */ |
63 | struct gstr str_new(void) | 33 | struct gstr str_new(void) |
64 | { | 34 | { |
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 6f9b0aa32a82..22fceb264cf5 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y | |||
@@ -31,7 +31,7 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE]; | |||
31 | static struct menu *current_menu, *current_entry; | 31 | static struct menu *current_menu, *current_entry; |
32 | 32 | ||
33 | %} | 33 | %} |
34 | %expect 32 | 34 | %expect 30 |
35 | 35 | ||
36 | %union | 36 | %union |
37 | { | 37 | { |
@@ -117,7 +117,7 @@ start: mainmenu_stmt stmt_list | stmt_list; | |||
117 | 117 | ||
118 | /* mainmenu entry */ | 118 | /* mainmenu entry */ |
119 | 119 | ||
120 | mainmenu_stmt: T_MAINMENU prompt nl | 120 | mainmenu_stmt: T_MAINMENU prompt T_EOL |
121 | { | 121 | { |
122 | menu_add_prompt(P_MENU, $2, NULL); | 122 | menu_add_prompt(P_MENU, $2, NULL); |
123 | }; | 123 | }; |
@@ -265,7 +265,7 @@ symbol_option_arg: | |||
265 | choice: T_CHOICE word_opt T_EOL | 265 | choice: T_CHOICE word_opt T_EOL |
266 | { | 266 | { |
267 | struct symbol *sym = sym_lookup($2, SYMBOL_CHOICE); | 267 | struct symbol *sym = sym_lookup($2, SYMBOL_CHOICE); |
268 | sym->flags |= SYMBOL_AUTO; | 268 | sym->flags |= SYMBOL_NO_WRITE; |
269 | menu_add_entry(sym); | 269 | menu_add_entry(sym); |
270 | menu_add_expr(P_CHOICE, NULL, NULL); | 270 | menu_add_expr(P_CHOICE, NULL, NULL); |
271 | free($2); | 271 | free($2); |
@@ -337,7 +337,7 @@ choice_block: | |||
337 | 337 | ||
338 | /* if entry */ | 338 | /* if entry */ |
339 | 339 | ||
340 | if_entry: T_IF expr nl | 340 | if_entry: T_IF expr T_EOL |
341 | { | 341 | { |
342 | printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); | 342 | printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); |
343 | menu_add_entry(NULL); | 343 | menu_add_entry(NULL); |
@@ -717,6 +717,10 @@ static void print_symbol(FILE *out, struct menu *menu) | |||
717 | print_quoted_string(out, prop->text); | 717 | print_quoted_string(out, prop->text); |
718 | fputc('\n', out); | 718 | fputc('\n', out); |
719 | break; | 719 | break; |
720 | case P_SYMBOL: | ||
721 | fputs( " symbol ", out); | ||
722 | fprintf(out, "%s\n", prop->sym->name); | ||
723 | break; | ||
720 | default: | 724 | default: |
721 | fprintf(out, " unknown prop %d!\n", prop->type); | 725 | fprintf(out, " unknown prop %d!\n", prop->type); |
722 | break; | 726 | break; |
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 0057d8eafcc1..8f0f508a78e9 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -1062,7 +1062,7 @@ sub dump_struct($$) { | |||
1062 | my $x = shift; | 1062 | my $x = shift; |
1063 | my $file = shift; | 1063 | my $file = shift; |
1064 | 1064 | ||
1065 | if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) { | 1065 | if ($x =~ /(struct|union)\s+(\w+)\s*\{(.*)\}/) { |
1066 | my $decl_type = $1; | 1066 | my $decl_type = $1; |
1067 | $declaration_name = $2; | 1067 | $declaration_name = $2; |
1068 | my $members = $3; | 1068 | my $members = $3; |
@@ -1148,20 +1148,20 @@ sub dump_struct($$) { | |||
1148 | } | 1148 | } |
1149 | } | 1149 | } |
1150 | } | 1150 | } |
1151 | $members =~ s/(struct|union)([^\{\};]+)\{([^\{\}]*)}([^\{\}\;]*)\;/$newmember/; | 1151 | $members =~ s/(struct|union)([^\{\};]+)\{([^\{\}]*)\}([^\{\}\;]*)\;/$newmember/; |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | # Ignore other nested elements, like enums | 1154 | # Ignore other nested elements, like enums |
1155 | $members =~ s/({[^\{\}]*})//g; | 1155 | $members =~ s/(\{[^\{\}]*\})//g; |
1156 | 1156 | ||
1157 | create_parameterlist($members, ';', $file, $declaration_name); | 1157 | create_parameterlist($members, ';', $file, $declaration_name); |
1158 | check_sections($file, $declaration_name, $decl_type, $sectcheck, $struct_actual); | 1158 | check_sections($file, $declaration_name, $decl_type, $sectcheck, $struct_actual); |
1159 | 1159 | ||
1160 | # Adjust declaration for better display | 1160 | # Adjust declaration for better display |
1161 | $declaration =~ s/([{;])/$1\n/g; | 1161 | $declaration =~ s/([\{;])/$1\n/g; |
1162 | $declaration =~ s/}\s+;/};/g; | 1162 | $declaration =~ s/\}\s+;/};/g; |
1163 | # Better handle inlined enums | 1163 | # Better handle inlined enums |
1164 | do {} while ($declaration =~ s/(enum\s+{[^}]+),([^\n])/$1,\n$2/); | 1164 | do {} while ($declaration =~ s/(enum\s+\{[^\}]+),([^\n])/$1,\n$2/); |
1165 | 1165 | ||
1166 | my @def_args = split /\n/, $declaration; | 1166 | my @def_args = split /\n/, $declaration; |
1167 | my $level = 1; | 1167 | my $level = 1; |
@@ -1171,12 +1171,12 @@ sub dump_struct($$) { | |||
1171 | $clause =~ s/\s+$//; | 1171 | $clause =~ s/\s+$//; |
1172 | $clause =~ s/\s+/ /; | 1172 | $clause =~ s/\s+/ /; |
1173 | next if (!$clause); | 1173 | next if (!$clause); |
1174 | $level-- if ($clause =~ m/(})/ && $level > 1); | 1174 | $level-- if ($clause =~ m/(\})/ && $level > 1); |
1175 | if (!($clause =~ m/^\s*#/)) { | 1175 | if (!($clause =~ m/^\s*#/)) { |
1176 | $declaration .= "\t" x $level; | 1176 | $declaration .= "\t" x $level; |
1177 | } | 1177 | } |
1178 | $declaration .= "\t" . $clause . "\n"; | 1178 | $declaration .= "\t" . $clause . "\n"; |
1179 | $level++ if ($clause =~ m/({)/ && !($clause =~m/}/)); | 1179 | $level++ if ($clause =~ m/(\{)/ && !($clause =~m/\}/)); |
1180 | } | 1180 | } |
1181 | output_declaration($declaration_name, | 1181 | output_declaration($declaration_name, |
1182 | 'struct', | 1182 | 'struct', |
@@ -1244,7 +1244,7 @@ sub dump_enum($$) { | |||
1244 | # strip #define macros inside enums | 1244 | # strip #define macros inside enums |
1245 | $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos; | 1245 | $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos; |
1246 | 1246 | ||
1247 | if ($x =~ /enum\s+(\w+)\s*{(.*)}/) { | 1247 | if ($x =~ /enum\s+(\w+)\s*\{(.*)\}/) { |
1248 | $declaration_name = $1; | 1248 | $declaration_name = $1; |
1249 | my $members = $2; | 1249 | my $members = $2; |
1250 | my %_members; | 1250 | my %_members; |
@@ -1785,7 +1785,7 @@ sub process_proto_type($$) { | |||
1785 | } | 1785 | } |
1786 | 1786 | ||
1787 | while (1) { | 1787 | while (1) { |
1788 | if ( $x =~ /([^{};]*)([{};])(.*)/ ) { | 1788 | if ( $x =~ /([^\{\};]*)([\{\};])(.*)/ ) { |
1789 | if( length $prototype ) { | 1789 | if( length $prototype ) { |
1790 | $prototype .= " " | 1790 | $prototype .= " " |
1791 | } | 1791 | } |
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 4bf811c09f59..c8cf45362bd6 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh | |||
@@ -75,7 +75,7 @@ modpost_link() | |||
75 | ${KBUILD_VMLINUX_LIBS} \ | 75 | ${KBUILD_VMLINUX_LIBS} \ |
76 | --end-group" | 76 | --end-group" |
77 | 77 | ||
78 | ${LD} ${LDFLAGS} -r -o ${1} ${objects} | 78 | ${LD} ${KBUILD_LDFLAGS} -r -o ${1} ${objects} |
79 | } | 79 | } |
80 | 80 | ||
81 | # Link of vmlinux | 81 | # Link of vmlinux |
@@ -95,7 +95,7 @@ vmlinux_link() | |||
95 | --end-group \ | 95 | --end-group \ |
96 | ${1}" | 96 | ${1}" |
97 | 97 | ||
98 | ${LD} ${LDFLAGS} ${LDFLAGS_vmlinux} -o ${2} \ | 98 | ${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} -o ${2} \ |
99 | -T ${lds} ${objects} | 99 | -T ${lds} ${objects} |
100 | else | 100 | else |
101 | objects="-Wl,--whole-archive \ | 101 | objects="-Wl,--whole-archive \ |
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c index 6667f7b491d6..293004499b4d 100644 --- a/scripts/mod/devicetable-offsets.c +++ b/scripts/mod/devicetable-offsets.c | |||
@@ -221,5 +221,9 @@ int main(void) | |||
221 | DEVID_FIELD(tb_service_id, protocol_version); | 221 | DEVID_FIELD(tb_service_id, protocol_version); |
222 | DEVID_FIELD(tb_service_id, protocol_revision); | 222 | DEVID_FIELD(tb_service_id, protocol_revision); |
223 | 223 | ||
224 | DEVID(typec_device_id); | ||
225 | DEVID_FIELD(typec_device_id, svid); | ||
226 | DEVID_FIELD(typec_device_id, mode); | ||
227 | |||
224 | return 0; | 228 | return 0; |
225 | } | 229 | } |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 52fd54a8fe39..7be43697ff84 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -1352,6 +1352,19 @@ static int do_tbsvc_entry(const char *filename, void *symval, char *alias) | |||
1352 | } | 1352 | } |
1353 | ADD_TO_DEVTABLE("tbsvc", tb_service_id, do_tbsvc_entry); | 1353 | ADD_TO_DEVTABLE("tbsvc", tb_service_id, do_tbsvc_entry); |
1354 | 1354 | ||
1355 | /* Looks like: typec:idNmN */ | ||
1356 | static int do_typec_entry(const char *filename, void *symval, char *alias) | ||
1357 | { | ||
1358 | DEF_FIELD(symval, typec_device_id, svid); | ||
1359 | DEF_FIELD(symval, typec_device_id, mode); | ||
1360 | |||
1361 | sprintf(alias, "typec:id%04X", svid); | ||
1362 | ADD(alias, "m", mode != TYPEC_ANY_MODE, mode); | ||
1363 | |||
1364 | return 1; | ||
1365 | } | ||
1366 | ADD_TO_DEVTABLE("typec", typec_device_id, do_typec_entry); | ||
1367 | |||
1355 | /* Does namelen bytes of name exactly match the symbol? */ | 1368 | /* Does namelen bytes of name exactly match the symbol? */ |
1356 | static bool sym_is(const char *name, unsigned namelen, const char *symbol) | 1369 | static bool sym_is(const char *name, unsigned namelen, const char *symbol) |
1357 | { | 1370 | { |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 1663fb19343a..0d998c54564d 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -672,7 +672,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info, | |||
672 | if (ELF_ST_TYPE(sym->st_info) == STT_SPARC_REGISTER) | 672 | if (ELF_ST_TYPE(sym->st_info) == STT_SPARC_REGISTER) |
673 | break; | 673 | break; |
674 | if (symname[0] == '.') { | 674 | if (symname[0] == '.') { |
675 | char *munged = strdup(symname); | 675 | char *munged = NOFAIL(strdup(symname)); |
676 | munged[0] = '_'; | 676 | munged[0] = '_'; |
677 | munged[1] = toupper(munged[1]); | 677 | munged[1] = toupper(munged[1]); |
678 | symname = munged; | 678 | symname = munged; |
@@ -1318,7 +1318,7 @@ static Elf_Sym *find_elf_symbol2(struct elf_info *elf, Elf_Addr addr, | |||
1318 | static char *sec2annotation(const char *s) | 1318 | static char *sec2annotation(const char *s) |
1319 | { | 1319 | { |
1320 | if (match(s, init_exit_sections)) { | 1320 | if (match(s, init_exit_sections)) { |
1321 | char *p = malloc(20); | 1321 | char *p = NOFAIL(malloc(20)); |
1322 | char *r = p; | 1322 | char *r = p; |
1323 | 1323 | ||
1324 | *p++ = '_'; | 1324 | *p++ = '_'; |
@@ -1338,7 +1338,7 @@ static char *sec2annotation(const char *s) | |||
1338 | strcat(p, " "); | 1338 | strcat(p, " "); |
1339 | return r; | 1339 | return r; |
1340 | } else { | 1340 | } else { |
1341 | return strdup(""); | 1341 | return NOFAIL(strdup("")); |
1342 | } | 1342 | } |
1343 | } | 1343 | } |
1344 | 1344 | ||
@@ -2036,7 +2036,7 @@ void buf_write(struct buffer *buf, const char *s, int len) | |||
2036 | { | 2036 | { |
2037 | if (buf->size - buf->pos < len) { | 2037 | if (buf->size - buf->pos < len) { |
2038 | buf->size += len + SZ; | 2038 | buf->size += len + SZ; |
2039 | buf->p = realloc(buf->p, buf->size); | 2039 | buf->p = NOFAIL(realloc(buf->p, buf->size)); |
2040 | } | 2040 | } |
2041 | strncpy(buf->p + buf->pos, s, len); | 2041 | strncpy(buf->p + buf->pos, s, len); |
2042 | buf->pos += len; | 2042 | buf->pos += len; |
@@ -2125,10 +2125,13 @@ static int check_modname_len(struct module *mod) | |||
2125 | **/ | 2125 | **/ |
2126 | static void add_header(struct buffer *b, struct module *mod) | 2126 | static void add_header(struct buffer *b, struct module *mod) |
2127 | { | 2127 | { |
2128 | buf_printf(b, "#include <linux/build-salt.h>\n"); | ||
2128 | buf_printf(b, "#include <linux/module.h>\n"); | 2129 | buf_printf(b, "#include <linux/module.h>\n"); |
2129 | buf_printf(b, "#include <linux/vermagic.h>\n"); | 2130 | buf_printf(b, "#include <linux/vermagic.h>\n"); |
2130 | buf_printf(b, "#include <linux/compiler.h>\n"); | 2131 | buf_printf(b, "#include <linux/compiler.h>\n"); |
2131 | buf_printf(b, "\n"); | 2132 | buf_printf(b, "\n"); |
2133 | buf_printf(b, "BUILD_SALT;\n"); | ||
2134 | buf_printf(b, "\n"); | ||
2132 | buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); | 2135 | buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); |
2133 | buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n"); | 2136 | buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n"); |
2134 | buf_printf(b, "\n"); | 2137 | buf_printf(b, "\n"); |
diff --git a/scripts/package/buildtar b/scripts/package/buildtar index e8cc72a51b32..d624a07a4e77 100755 --- a/scripts/package/buildtar +++ b/scripts/package/buildtar | |||
@@ -84,10 +84,6 @@ case "${ARCH}" in | |||
84 | [ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" | 84 | [ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" |
85 | [ -f "${objtree}/lifimage" ] && cp -v -- "${objtree}/lifimage" "${tmpdir}/boot/lifimage-${KERNELRELEASE}" | 85 | [ -f "${objtree}/lifimage" ] && cp -v -- "${objtree}/lifimage" "${tmpdir}/boot/lifimage-${KERNELRELEASE}" |
86 | ;; | 86 | ;; |
87 | vax) | ||
88 | [ -f "${objtree}/vmlinux.SYS" ] && cp -v -- "${objtree}/vmlinux.SYS" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}.SYS" | ||
89 | [ -f "${objtree}/vmlinux.dsk" ] && cp -v -- "${objtree}/vmlinux.dsk" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}.dsk" | ||
90 | ;; | ||
91 | mips) | 87 | mips) |
92 | if [ -f "${objtree}/arch/mips/boot/compressed/vmlinux.bin" ]; then | 88 | if [ -f "${objtree}/arch/mips/boot/compressed/vmlinux.bin" ]; then |
93 | cp -v -- "${objtree}/arch/mips/boot/compressed/vmlinux.bin" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" | 89 | cp -v -- "${objtree}/arch/mips/boot/compressed/vmlinux.bin" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" |
@@ -109,6 +105,14 @@ case "${ARCH}" in | |||
109 | cp -v -- "${objtree}/vmlinux" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" | 105 | cp -v -- "${objtree}/vmlinux" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" |
110 | fi | 106 | fi |
111 | ;; | 107 | ;; |
108 | arm64) | ||
109 | for i in Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo ; do | ||
110 | if [ -f "${objtree}/arch/arm64/boot/${i}" ] ; then | ||
111 | cp -v -- "${objtree}/arch/arm64/boot/${i}" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" | ||
112 | break | ||
113 | fi | ||
114 | done | ||
115 | ;; | ||
112 | *) | 116 | *) |
113 | [ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-kbuild-${KERNELRELEASE}" | 117 | [ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-kbuild-${KERNELRELEASE}" |
114 | echo "" >&2 | 118 | echo "" >&2 |
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian index 985d72d1ab34..663a7f343b42 100755 --- a/scripts/package/mkdebian +++ b/scripts/package/mkdebian | |||
@@ -6,49 +6,81 @@ | |||
6 | 6 | ||
7 | set -e | 7 | set -e |
8 | 8 | ||
9 | is_enabled() { | ||
10 | grep -q "^CONFIG_$1=y" $KCONFIG_CONFIG | ||
11 | } | ||
12 | |||
13 | if_enabled_echo() { | ||
14 | if is_enabled "$1"; then | ||
15 | echo -n "$2" | ||
16 | elif [ $# -ge 3 ]; then | ||
17 | echo -n "$3" | ||
18 | fi | ||
19 | } | ||
20 | |||
9 | set_debarch() { | 21 | set_debarch() { |
22 | if [ -n "$KBUILD_DEBARCH" ] ; then | ||
23 | debarch="$KBUILD_DEBARCH" | ||
24 | return | ||
25 | fi | ||
26 | |||
10 | # Attempt to find the correct Debian architecture | 27 | # Attempt to find the correct Debian architecture |
11 | case "$UTS_MACHINE" in | 28 | case "$UTS_MACHINE" in |
12 | i386|ia64|alpha) | 29 | i386|ia64|alpha|m68k|riscv*) |
13 | debarch="$UTS_MACHINE" ;; | 30 | debarch="$UTS_MACHINE" ;; |
14 | x86_64) | 31 | x86_64) |
15 | debarch=amd64 ;; | 32 | debarch=amd64 ;; |
16 | sparc*) | 33 | sparc*) |
17 | debarch=sparc ;; | 34 | debarch=sparc$(if_enabled_echo 64BIT 64) ;; |
18 | s390*) | 35 | s390*) |
19 | debarch=s390$(grep -q CONFIG_64BIT=y $KCONFIG_CONFIG && echo x || true) ;; | 36 | debarch=s390x ;; |
20 | ppc*) | 37 | ppc*) |
21 | debarch=$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo ppc64el || echo powerpc) ;; | 38 | if is_enabled 64BIT; then |
39 | debarch=ppc64$(if_enabled_echo CPU_LITTLE_ENDIAN el) | ||
40 | else | ||
41 | debarch=powerpc$(if_enabled_echo SPE spe) | ||
42 | fi | ||
43 | ;; | ||
22 | parisc*) | 44 | parisc*) |
23 | debarch=hppa ;; | 45 | debarch=hppa ;; |
24 | mips*) | 46 | mips*) |
25 | debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;; | 47 | if is_enabled CPU_LITTLE_ENDIAN; then |
48 | debarch=mips$(if_enabled_echo 64BIT 64)$(if_enabled_echo CPU_MIPSR6 r6)el | ||
49 | elif is_enabled CPU_MIPSR6; then | ||
50 | debarch=mips$(if_enabled_echo 64BIT 64)r6 | ||
51 | else | ||
52 | debarch=mips | ||
53 | fi | ||
54 | ;; | ||
26 | aarch64|arm64) | 55 | aarch64|arm64) |
27 | debarch=arm64 ;; | 56 | debarch=arm64 ;; |
28 | arm*) | 57 | arm*) |
29 | if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then | 58 | if is_enabled AEABI; then |
30 | if grep -q CONFIG_VFP=y $KCONFIG_CONFIG; then | 59 | debarch=arm$(if_enabled_echo VFP hf el) |
31 | debarch=armhf | ||
32 | else | ||
33 | debarch=armel | ||
34 | fi | ||
35 | else | 60 | else |
36 | debarch=arm | 61 | debarch=arm |
62 | fi | ||
63 | ;; | ||
64 | openrisc) | ||
65 | debarch=or1k ;; | ||
66 | sh) | ||
67 | if is_enabled CPU_SH3; then | ||
68 | debarch=sh3$(if_enabled_echo CPU_BIG_ENDIAN eb) | ||
69 | elif is_enabled CPU_SH4; then | ||
70 | debarch=sh4$(if_enabled_echo CPU_BIG_ENDIAN eb) | ||
37 | fi | 71 | fi |
38 | ;; | 72 | ;; |
39 | *) | 73 | esac |
40 | debarch=$(dpkg --print-architecture) | 74 | if [ -z "$debarch" ]; then |
75 | debarch=$(dpkg-architecture -qDEB_HOST_ARCH) | ||
41 | echo "" >&2 | 76 | echo "" >&2 |
42 | echo "** ** ** WARNING ** ** **" >&2 | 77 | echo "** ** ** WARNING ** ** **" >&2 |
43 | echo "" >&2 | 78 | echo "" >&2 |
44 | echo "Your architecture doesn't have its equivalent" >&2 | 79 | echo "Your architecture doesn't have its equivalent" >&2 |
45 | echo "Debian userspace architecture defined!" >&2 | 80 | echo "Debian userspace architecture defined!" >&2 |
46 | echo "Falling back to using your current userspace instead!" >&2 | 81 | echo "Falling back to the current host architecture ($debarch)." >&2 |
47 | echo "Please add support for $UTS_MACHINE to ${0} ..." >&2 | 82 | echo "Please add support for $UTS_MACHINE to ${0} ..." >&2 |
48 | echo "" >&2 | 83 | echo "" >&2 |
49 | esac | ||
50 | if [ -n "$KBUILD_DEBARCH" ] ; then | ||
51 | debarch="$KBUILD_DEBARCH" | ||
52 | fi | 84 | fi |
53 | } | 85 | } |
54 | 86 | ||
diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py index 7deaef297f52..839e190bbd7a 100755 --- a/scripts/spdxcheck.py +++ b/scripts/spdxcheck.py | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | from argparse import ArgumentParser | 5 | from argparse import ArgumentParser |
6 | from ply import lex, yacc | 6 | from ply import lex, yacc |
7 | import locale | ||
7 | import traceback | 8 | import traceback |
8 | import sys | 9 | import sys |
9 | import git | 10 | import git |
@@ -32,7 +33,7 @@ def read_spdxdata(repo): | |||
32 | 33 | ||
33 | # The subdirectories of LICENSES in the kernel source | 34 | # The subdirectories of LICENSES in the kernel source |
34 | license_dirs = [ "preferred", "other", "exceptions" ] | 35 | license_dirs = [ "preferred", "other", "exceptions" ] |
35 | lictree = repo.heads.master.commit.tree['LICENSES'] | 36 | lictree = repo.head.commit.tree['LICENSES'] |
36 | 37 | ||
37 | spdx = SPDXdata() | 38 | spdx = SPDXdata() |
38 | 39 | ||
@@ -102,7 +103,7 @@ class id_parser(object): | |||
102 | raise ParserException(tok, 'Invalid License ID') | 103 | raise ParserException(tok, 'Invalid License ID') |
103 | self.lastid = id | 104 | self.lastid = id |
104 | elif tok.type == 'EXC': | 105 | elif tok.type == 'EXC': |
105 | if not self.spdx.exceptions.has_key(id): | 106 | if id not in self.spdx.exceptions: |
106 | raise ParserException(tok, 'Invalid Exception ID') | 107 | raise ParserException(tok, 'Invalid Exception ID') |
107 | if self.lastid not in self.spdx.exceptions[id]: | 108 | if self.lastid not in self.spdx.exceptions[id]: |
108 | raise ParserException(tok, 'Exception not valid for license %s' %self.lastid) | 109 | raise ParserException(tok, 'Exception not valid for license %s' %self.lastid) |
@@ -167,6 +168,7 @@ class id_parser(object): | |||
167 | self.curline = 0 | 168 | self.curline = 0 |
168 | try: | 169 | try: |
169 | for line in fd: | 170 | for line in fd: |
171 | line = line.decode(locale.getpreferredencoding(False), errors='ignore') | ||
170 | self.curline += 1 | 172 | self.curline += 1 |
171 | if self.curline > maxlines: | 173 | if self.curline > maxlines: |
172 | break | 174 | break |
@@ -199,11 +201,10 @@ def scan_git_tree(tree): | |||
199 | continue | 201 | continue |
200 | if el.path.find("license-rules.rst") >= 0: | 202 | if el.path.find("license-rules.rst") >= 0: |
201 | continue | 203 | continue |
202 | if el.path == 'scripts/checkpatch.pl': | ||
203 | continue | ||
204 | if not os.path.isfile(el.path): | 204 | if not os.path.isfile(el.path): |
205 | continue | 205 | continue |
206 | parser.parse_lines(open(el.path), args.maxlines, el.path) | 206 | with open(el.path, 'rb') as fd: |
207 | parser.parse_lines(fd, args.maxlines, el.path) | ||
207 | 208 | ||
208 | def scan_git_subtree(tree, path): | 209 | def scan_git_subtree(tree, path): |
209 | for p in path.strip('/').split('/'): | 210 | for p in path.strip('/').split('/'): |
diff --git a/scripts/spelling.txt b/scripts/spelling.txt index 9a058cff49d4..517d0c3f83df 100644 --- a/scripts/spelling.txt +++ b/scripts/spelling.txt | |||
@@ -10,6 +10,8 @@ | |||
10 | abandonning||abandoning | 10 | abandonning||abandoning |
11 | abigious||ambiguous | 11 | abigious||ambiguous |
12 | abitrate||arbitrate | 12 | abitrate||arbitrate |
13 | abord||abort | ||
14 | aboslute||absolute | ||
13 | abov||above | 15 | abov||above |
14 | abreviated||abbreviated | 16 | abreviated||abbreviated |
15 | absense||absence | 17 | absense||absence |
@@ -25,6 +27,7 @@ accessable||accessible | |||
25 | accesss||access | 27 | accesss||access |
26 | accidentaly||accidentally | 28 | accidentaly||accidentally |
27 | accidentually||accidentally | 29 | accidentually||accidentally |
30 | acclerated||accelerated | ||
28 | accoding||according | 31 | accoding||according |
29 | accomodate||accommodate | 32 | accomodate||accommodate |
30 | accomodates||accommodates | 33 | accomodates||accommodates |
@@ -58,12 +61,15 @@ addres||address | |||
58 | adddress||address | 61 | adddress||address |
59 | addreses||addresses | 62 | addreses||addresses |
60 | addresss||address | 63 | addresss||address |
64 | addrress||address | ||
61 | aditional||additional | 65 | aditional||additional |
62 | aditionally||additionally | 66 | aditionally||additionally |
63 | aditionaly||additionally | 67 | aditionaly||additionally |
64 | adminstrative||administrative | 68 | adminstrative||administrative |
65 | adress||address | 69 | adress||address |
66 | adresses||addresses | 70 | adresses||addresses |
71 | adrresses||addresses | ||
72 | advertisment||advertisement | ||
67 | adviced||advised | 73 | adviced||advised |
68 | afecting||affecting | 74 | afecting||affecting |
69 | againt||against | 75 | againt||against |
@@ -100,6 +106,7 @@ alue||value | |||
100 | ambigious||ambiguous | 106 | ambigious||ambiguous |
101 | amoung||among | 107 | amoung||among |
102 | amout||amount | 108 | amout||amount |
109 | amplifer||amplifier | ||
103 | an union||a union | 110 | an union||a union |
104 | an user||a user | 111 | an user||a user |
105 | an userspace||a userspace | 112 | an userspace||a userspace |
@@ -145,11 +152,15 @@ assistent||assistant | |||
145 | assocation||association | 152 | assocation||association |
146 | associcated||associated | 153 | associcated||associated |
147 | assotiated||associated | 154 | assotiated||associated |
155 | asssert||assert | ||
148 | assum||assume | 156 | assum||assume |
149 | assumtpion||assumption | 157 | assumtpion||assumption |
150 | asuming||assuming | 158 | asuming||assuming |
151 | asycronous||asynchronous | 159 | asycronous||asynchronous |
152 | asynchnous||asynchronous | 160 | asynchnous||asynchronous |
161 | asynchromous||asynchronous | ||
162 | asymetric||asymmetric | ||
163 | asymmeric||asymmetric | ||
153 | atomatically||automatically | 164 | atomatically||automatically |
154 | atomicly||atomically | 165 | atomicly||atomically |
155 | atempt||attempt | 166 | atempt||attempt |
@@ -172,6 +183,7 @@ avaible||available | |||
172 | availabe||available | 183 | availabe||available |
173 | availabled||available | 184 | availabled||available |
174 | availablity||availability | 185 | availablity||availability |
186 | availaible||available | ||
175 | availale||available | 187 | availale||available |
176 | availavility||availability | 188 | availavility||availability |
177 | availble||available | 189 | availble||available |
@@ -206,8 +218,11 @@ borad||board | |||
206 | boundry||boundary | 218 | boundry||boundary |
207 | brievely||briefly | 219 | brievely||briefly |
208 | broadcat||broadcast | 220 | broadcat||broadcast |
221 | bufufer||buffer | ||
209 | cacluated||calculated | 222 | cacluated||calculated |
223 | caculate||calculate | ||
210 | caculation||calculation | 224 | caculation||calculation |
225 | cadidate||candidate | ||
211 | calender||calendar | 226 | calender||calendar |
212 | calescing||coalescing | 227 | calescing||coalescing |
213 | calle||called | 228 | calle||called |
@@ -221,12 +236,14 @@ capabilty||capability | |||
221 | capabitilies||capabilities | 236 | capabitilies||capabilities |
222 | capatibilities||capabilities | 237 | capatibilities||capabilities |
223 | capapbilities||capabilities | 238 | capapbilities||capabilities |
239 | caputure||capture | ||
224 | carefuly||carefully | 240 | carefuly||carefully |
225 | cariage||carriage | 241 | cariage||carriage |
226 | catagory||category | 242 | catagory||category |
227 | cehck||check | 243 | cehck||check |
228 | challange||challenge | 244 | challange||challenge |
229 | challanges||challenges | 245 | challanges||challenges |
246 | chache||cache | ||
230 | chanell||channel | 247 | chanell||channel |
231 | changable||changeable | 248 | changable||changeable |
232 | chanined||chained | 249 | chanined||chained |
@@ -240,6 +257,7 @@ charaters||characters | |||
240 | charcter||character | 257 | charcter||character |
241 | chcek||check | 258 | chcek||check |
242 | chck||check | 259 | chck||check |
260 | checksumed||checksummed | ||
243 | checksuming||checksumming | 261 | checksuming||checksumming |
244 | childern||children | 262 | childern||children |
245 | childs||children | 263 | childs||children |
@@ -292,8 +310,10 @@ comunication||communication | |||
292 | conbination||combination | 310 | conbination||combination |
293 | conditionaly||conditionally | 311 | conditionaly||conditionally |
294 | conected||connected | 312 | conected||connected |
313 | conector||connector | ||
295 | connecetd||connected | 314 | connecetd||connected |
296 | configuartion||configuration | 315 | configuartion||configuration |
316 | configuation||configuration | ||
297 | configuratoin||configuration | 317 | configuratoin||configuration |
298 | configuraton||configuration | 318 | configuraton||configuration |
299 | configuretion||configuration | 319 | configuretion||configuration |
@@ -315,6 +335,7 @@ continous||continuous | |||
315 | continously||continuously | 335 | continously||continuously |
316 | continueing||continuing | 336 | continueing||continuing |
317 | contraints||constraints | 337 | contraints||constraints |
338 | contruct||construct | ||
318 | contol||control | 339 | contol||control |
319 | contoller||controller | 340 | contoller||controller |
320 | controled||controlled | 341 | controled||controlled |
@@ -343,6 +364,7 @@ dafault||default | |||
343 | deafult||default | 364 | deafult||default |
344 | deamon||daemon | 365 | deamon||daemon |
345 | decompres||decompress | 366 | decompres||decompress |
367 | decsribed||described | ||
346 | decription||description | 368 | decription||description |
347 | dectected||detected | 369 | dectected||detected |
348 | defailt||default | 370 | defailt||default |
@@ -379,6 +401,7 @@ desctiptor||descriptor | |||
379 | desriptor||descriptor | 401 | desriptor||descriptor |
380 | desriptors||descriptors | 402 | desriptors||descriptors |
381 | destionation||destination | 403 | destionation||destination |
404 | destoried||destroyed | ||
382 | destory||destroy | 405 | destory||destroy |
383 | destoryed||destroyed | 406 | destoryed||destroyed |
384 | destorys||destroys | 407 | destorys||destroys |
@@ -400,22 +423,30 @@ didnt||didn't | |||
400 | diferent||different | 423 | diferent||different |
401 | differrence||difference | 424 | differrence||difference |
402 | diffrent||different | 425 | diffrent||different |
426 | differenciate||differentiate | ||
403 | diffrentiate||differentiate | 427 | diffrentiate||differentiate |
404 | difinition||definition | 428 | difinition||definition |
405 | dimesions||dimensions | 429 | dimesions||dimensions |
406 | diplay||display | 430 | diplay||display |
431 | directon||direction | ||
407 | direectly||directly | 432 | direectly||directly |
433 | diregard||disregard | ||
408 | disassocation||disassociation | 434 | disassocation||disassociation |
409 | disapear||disappear | 435 | disapear||disappear |
410 | disapeared||disappeared | 436 | disapeared||disappeared |
411 | disappared||disappeared | 437 | disappared||disappeared |
438 | disbale||disable | ||
439 | disbaled||disabled | ||
412 | disble||disable | 440 | disble||disable |
413 | disbled||disabled | 441 | disbled||disabled |
414 | disconnet||disconnect | 442 | disconnet||disconnect |
415 | discontinous||discontinuous | 443 | discontinous||discontinuous |
444 | disharge||discharge | ||
416 | dispertion||dispersion | 445 | dispertion||dispersion |
417 | dissapears||disappears | 446 | dissapears||disappears |
418 | distiction||distinction | 447 | distiction||distinction |
448 | divisable||divisible | ||
449 | divsiors||divisors | ||
419 | docuentation||documentation | 450 | docuentation||documentation |
420 | documantation||documentation | 451 | documantation||documentation |
421 | documentaion||documentation | 452 | documentaion||documentation |
@@ -427,6 +458,7 @@ downlad||download | |||
427 | downlads||downloads | 458 | downlads||downloads |
428 | druing||during | 459 | druing||during |
429 | dynmaic||dynamic | 460 | dynmaic||dynamic |
461 | eanable||enable | ||
430 | easilly||easily | 462 | easilly||easily |
431 | ecspecially||especially | 463 | ecspecially||especially |
432 | edditable||editable | 464 | edditable||editable |
@@ -484,9 +516,12 @@ exprimental||experimental | |||
484 | extened||extended | 516 | extened||extended |
485 | extensability||extensibility | 517 | extensability||extensibility |
486 | extention||extension | 518 | extention||extension |
519 | extenstion||extension | ||
487 | extracter||extractor | 520 | extracter||extractor |
521 | faield||failed | ||
488 | falied||failed | 522 | falied||failed |
489 | faild||failed | 523 | faild||failed |
524 | failer||failure | ||
490 | faill||fail | 525 | faill||fail |
491 | failied||failed | 526 | failied||failed |
492 | faillure||failure | 527 | faillure||failure |
@@ -520,6 +555,7 @@ forseeable||foreseeable | |||
520 | forse||force | 555 | forse||force |
521 | fortan||fortran | 556 | fortan||fortran |
522 | forwardig||forwarding | 557 | forwardig||forwarding |
558 | frambuffer||framebuffer | ||
523 | framming||framing | 559 | framming||framing |
524 | framwork||framework | 560 | framwork||framework |
525 | frequncy||frequency | 561 | frequncy||frequency |
@@ -527,6 +563,7 @@ frome||from | |||
527 | fucntion||function | 563 | fucntion||function |
528 | fuction||function | 564 | fuction||function |
529 | fuctions||functions | 565 | fuctions||functions |
566 | funcation||function | ||
530 | funcion||function | 567 | funcion||function |
531 | functionallity||functionality | 568 | functionallity||functionality |
532 | functionaly||functionally | 569 | functionaly||functionally |
@@ -540,6 +577,7 @@ futrue||future | |||
540 | gaurenteed||guaranteed | 577 | gaurenteed||guaranteed |
541 | generiously||generously | 578 | generiously||generously |
542 | genereate||generate | 579 | genereate||generate |
580 | genereted||generated | ||
543 | genric||generic | 581 | genric||generic |
544 | globel||global | 582 | globel||global |
545 | grabing||grabbing | 583 | grabing||grabbing |
@@ -553,6 +591,7 @@ guarentee||guarantee | |||
553 | halfs||halves | 591 | halfs||halves |
554 | hander||handler | 592 | hander||handler |
555 | handfull||handful | 593 | handfull||handful |
594 | hanlde||handle | ||
556 | hanled||handled | 595 | hanled||handled |
557 | happend||happened | 596 | happend||happened |
558 | harware||hardware | 597 | harware||hardware |
@@ -561,6 +600,7 @@ helpfull||helpful | |||
561 | hybernate||hibernate | 600 | hybernate||hibernate |
562 | hierachy||hierarchy | 601 | hierachy||hierarchy |
563 | hierarchie||hierarchy | 602 | hierarchie||hierarchy |
603 | homogenous||homogeneous | ||
564 | howver||however | 604 | howver||however |
565 | hsould||should | 605 | hsould||should |
566 | hypervior||hypervisor | 606 | hypervior||hypervisor |
@@ -568,6 +608,8 @@ hypter||hyper | |||
568 | identidier||identifier | 608 | identidier||identifier |
569 | iligal||illegal | 609 | iligal||illegal |
570 | illigal||illegal | 610 | illigal||illegal |
611 | illgal||illegal | ||
612 | iomaped||iomapped | ||
571 | imblance||imbalance | 613 | imblance||imbalance |
572 | immeadiately||immediately | 614 | immeadiately||immediately |
573 | immedaite||immediate | 615 | immedaite||immediate |
@@ -618,12 +660,15 @@ initation||initiation | |||
618 | initators||initiators | 660 | initators||initiators |
619 | initialiazation||initialization | 661 | initialiazation||initialization |
620 | initializiation||initialization | 662 | initializiation||initialization |
663 | initialze||initialize | ||
621 | initialzed||initialized | 664 | initialzed||initialized |
622 | initilization||initialization | 665 | initilization||initialization |
623 | initilize||initialize | 666 | initilize||initialize |
624 | inofficial||unofficial | 667 | inofficial||unofficial |
668 | inrerface||interface | ||
625 | insititute||institute | 669 | insititute||institute |
626 | instal||install | 670 | instal||install |
671 | instanciate||instantiate | ||
627 | instanciated||instantiated | 672 | instanciated||instantiated |
628 | inteface||interface | 673 | inteface||interface |
629 | integreated||integrated | 674 | integreated||integrated |
@@ -657,6 +702,7 @@ intregral||integral | |||
657 | intrrupt||interrupt | 702 | intrrupt||interrupt |
658 | intterrupt||interrupt | 703 | intterrupt||interrupt |
659 | intuative||intuitive | 704 | intuative||intuitive |
705 | inavlid||invalid | ||
660 | invaid||invalid | 706 | invaid||invalid |
661 | invald||invalid | 707 | invald||invalid |
662 | invalde||invalid | 708 | invalde||invalid |
@@ -683,6 +729,7 @@ langauge||language | |||
683 | langugage||language | 729 | langugage||language |
684 | lauch||launch | 730 | lauch||launch |
685 | layed||laid | 731 | layed||laid |
732 | legnth||length | ||
686 | leightweight||lightweight | 733 | leightweight||lightweight |
687 | lengh||length | 734 | lengh||length |
688 | lenght||length | 735 | lenght||length |
@@ -696,6 +743,7 @@ licenceing||licencing | |||
696 | loggging||logging | 743 | loggging||logging |
697 | loggin||login | 744 | loggin||login |
698 | logile||logfile | 745 | logile||logfile |
746 | loobpack||loopback | ||
699 | loosing||losing | 747 | loosing||losing |
700 | losted||lost | 748 | losted||lost |
701 | machinary||machinery | 749 | machinary||machinery |
@@ -703,6 +751,7 @@ maintainance||maintenance | |||
703 | maintainence||maintenance | 751 | maintainence||maintenance |
704 | maintan||maintain | 752 | maintan||maintain |
705 | makeing||making | 753 | makeing||making |
754 | mailformed||malformed | ||
706 | malplaced||misplaced | 755 | malplaced||misplaced |
707 | malplace||misplace | 756 | malplace||misplace |
708 | managable||manageable | 757 | managable||manageable |
@@ -710,6 +759,7 @@ managment||management | |||
710 | mangement||management | 759 | mangement||management |
711 | manoeuvering||maneuvering | 760 | manoeuvering||maneuvering |
712 | mappping||mapping | 761 | mappping||mapping |
762 | matchs||matches | ||
713 | mathimatical||mathematical | 763 | mathimatical||mathematical |
714 | mathimatic||mathematic | 764 | mathimatic||mathematic |
715 | mathimatics||mathematics | 765 | mathimatics||mathematics |
@@ -725,6 +775,7 @@ messsage||message | |||
725 | messsages||messages | 775 | messsages||messages |
726 | micropone||microphone | 776 | micropone||microphone |
727 | microprocesspr||microprocessor | 777 | microprocesspr||microprocessor |
778 | migrateable||migratable | ||
728 | milliseonds||milliseconds | 779 | milliseonds||milliseconds |
729 | minium||minimum | 780 | minium||minimum |
730 | minimam||minimum | 781 | minimam||minimum |
@@ -741,6 +792,7 @@ missmatch||mismatch | |||
741 | miximum||maximum | 792 | miximum||maximum |
742 | mmnemonic||mnemonic | 793 | mmnemonic||mnemonic |
743 | mnay||many | 794 | mnay||many |
795 | modfiy||modify | ||
744 | modulues||modules | 796 | modulues||modules |
745 | momery||memory | 797 | momery||memory |
746 | memomry||memory | 798 | memomry||memory |
@@ -777,6 +829,7 @@ notifed||notified | |||
777 | numebr||number | 829 | numebr||number |
778 | numner||number | 830 | numner||number |
779 | obtaion||obtain | 831 | obtaion||obtain |
832 | obusing||abusing | ||
780 | occassionally||occasionally | 833 | occassionally||occasionally |
781 | occationally||occasionally | 834 | occationally||occasionally |
782 | occurance||occurrence | 835 | occurance||occurrence |
@@ -787,6 +840,7 @@ occure||occurred | |||
787 | occured||occurred | 840 | occured||occurred |
788 | occuring||occurring | 841 | occuring||occurring |
789 | offet||offset | 842 | offet||offset |
843 | offloded||offloaded | ||
790 | omited||omitted | 844 | omited||omitted |
791 | omiting||omitting | 845 | omiting||omitting |
792 | omitt||omit | 846 | omitt||omit |
@@ -829,6 +883,7 @@ parametes||parameters | |||
829 | parametised||parametrised | 883 | parametised||parametrised |
830 | paramter||parameter | 884 | paramter||parameter |
831 | paramters||parameters | 885 | paramters||parameters |
886 | parmaters||parameters | ||
832 | particuarly||particularly | 887 | particuarly||particularly |
833 | particularily||particularly | 888 | particularily||particularly |
834 | partiton||partition | 889 | partiton||partition |
@@ -837,6 +892,7 @@ passin||passing | |||
837 | pathes||paths | 892 | pathes||paths |
838 | pecularities||peculiarities | 893 | pecularities||peculiarities |
839 | peformance||performance | 894 | peformance||performance |
895 | peforming||performing | ||
840 | peice||piece | 896 | peice||piece |
841 | pendantic||pedantic | 897 | pendantic||pedantic |
842 | peprocessor||preprocessor | 898 | peprocessor||preprocessor |
@@ -846,6 +902,7 @@ peroid||period | |||
846 | persistance||persistence | 902 | persistance||persistence |
847 | persistant||persistent | 903 | persistant||persistent |
848 | plalform||platform | 904 | plalform||platform |
905 | platfoem||platform | ||
849 | platfrom||platform | 906 | platfrom||platform |
850 | plattform||platform | 907 | plattform||platform |
851 | pleaes||please | 908 | pleaes||please |
@@ -858,6 +915,7 @@ posible||possible | |||
858 | positon||position | 915 | positon||position |
859 | possibilites||possibilities | 916 | possibilites||possibilities |
860 | powerfull||powerful | 917 | powerfull||powerful |
918 | preamle||preamble | ||
861 | preample||preamble | 919 | preample||preamble |
862 | preapre||prepare | 920 | preapre||prepare |
863 | preceeded||preceded | 921 | preceeded||preceded |
@@ -870,6 +928,7 @@ prefered||preferred | |||
870 | prefferably||preferably | 928 | prefferably||preferably |
871 | premption||preemption | 929 | premption||preemption |
872 | prepaired||prepared | 930 | prepaired||prepared |
931 | preperation||preparation | ||
873 | pressre||pressure | 932 | pressre||pressure |
874 | primative||primitive | 933 | primative||primitive |
875 | princliple||principle | 934 | princliple||principle |
@@ -935,6 +994,7 @@ recommanded||recommended | |||
935 | recyle||recycle | 994 | recyle||recycle |
936 | redircet||redirect | 995 | redircet||redirect |
937 | redirectrion||redirection | 996 | redirectrion||redirection |
997 | redundacy||redundancy | ||
938 | reename||rename | 998 | reename||rename |
939 | refcounf||refcount | 999 | refcounf||refcount |
940 | refence||reference | 1000 | refence||reference |
@@ -945,6 +1005,7 @@ refernces||references | |||
945 | refernnce||reference | 1005 | refernnce||reference |
946 | refrence||reference | 1006 | refrence||reference |
947 | registerd||registered | 1007 | registerd||registered |
1008 | registeration||registration | ||
948 | registeresd||registered | 1009 | registeresd||registered |
949 | registerred||registered | 1010 | registerred||registered |
950 | registes||registers | 1011 | registes||registers |
@@ -973,7 +1034,9 @@ requirment||requirement | |||
973 | requred||required | 1034 | requred||required |
974 | requried||required | 1035 | requried||required |
975 | requst||request | 1036 | requst||request |
1037 | reregisteration||reregistration | ||
976 | reseting||resetting | 1038 | reseting||resetting |
1039 | reseverd||reserved | ||
977 | resizeable||resizable | 1040 | resizeable||resizable |
978 | resouce||resource | 1041 | resouce||resource |
979 | resouces||resources | 1042 | resouces||resources |
@@ -982,6 +1045,7 @@ responce||response | |||
982 | ressizes||resizes | 1045 | ressizes||resizes |
983 | ressource||resource | 1046 | ressource||resource |
984 | ressources||resources | 1047 | ressources||resources |
1048 | restesting||retesting | ||
985 | retransmited||retransmitted | 1049 | retransmited||retransmitted |
986 | retreived||retrieved | 1050 | retreived||retrieved |
987 | retreive||retrieve | 1051 | retreive||retrieve |
@@ -1006,6 +1070,7 @@ sacrifying||sacrificing | |||
1006 | safly||safely | 1070 | safly||safely |
1007 | safty||safety | 1071 | safty||safety |
1008 | savable||saveable | 1072 | savable||saveable |
1073 | scaleing||scaling | ||
1009 | scaned||scanned | 1074 | scaned||scanned |
1010 | scaning||scanning | 1075 | scaning||scanning |
1011 | scarch||search | 1076 | scarch||search |
@@ -1014,6 +1079,8 @@ searchs||searches | |||
1014 | secquence||sequence | 1079 | secquence||sequence |
1015 | secund||second | 1080 | secund||second |
1016 | segement||segment | 1081 | segement||segment |
1082 | semaphone||semaphore | ||
1083 | senario||scenario | ||
1017 | senarios||scenarios | 1084 | senarios||scenarios |
1018 | sentivite||sensitive | 1085 | sentivite||sensitive |
1019 | separatly||separately | 1086 | separatly||separately |
@@ -1025,9 +1092,13 @@ seperate||separate | |||
1025 | seperatly||separately | 1092 | seperatly||separately |
1026 | seperator||separator | 1093 | seperator||separator |
1027 | sepperate||separate | 1094 | sepperate||separate |
1095 | seqeunce||sequence | ||
1096 | seqeuncer||sequencer | ||
1097 | seqeuencer||sequencer | ||
1028 | sequece||sequence | 1098 | sequece||sequence |
1029 | sequencial||sequential | 1099 | sequencial||sequential |
1030 | serveral||several | 1100 | serveral||several |
1101 | servive||service | ||
1031 | setts||sets | 1102 | setts||sets |
1032 | settting||setting | 1103 | settting||setting |
1033 | shotdown||shutdown | 1104 | shotdown||shutdown |
@@ -1073,6 +1144,7 @@ standartization||standardization | |||
1073 | standart||standard | 1144 | standart||standard |
1074 | staticly||statically | 1145 | staticly||statically |
1075 | stoped||stopped | 1146 | stoped||stopped |
1147 | stoping||stopping | ||
1076 | stoppped||stopped | 1148 | stoppped||stopped |
1077 | straming||streaming | 1149 | straming||streaming |
1078 | struc||struct | 1150 | struc||struct |
@@ -1085,6 +1157,7 @@ subdirectoires||subdirectories | |||
1085 | suble||subtle | 1157 | suble||subtle |
1086 | substract||subtract | 1158 | substract||subtract |
1087 | submition||submission | 1159 | submition||submission |
1160 | suceed||succeed | ||
1088 | succesfully||successfully | 1161 | succesfully||successfully |
1089 | succesful||successful | 1162 | succesful||successful |
1090 | successed||succeeded | 1163 | successed||succeeded |
@@ -1108,6 +1181,7 @@ surpressed||suppressed | |||
1108 | surpresses||suppresses | 1181 | surpresses||suppresses |
1109 | susbsystem||subsystem | 1182 | susbsystem||subsystem |
1110 | suspeneded||suspended | 1183 | suspeneded||suspended |
1184 | suspsend||suspend | ||
1111 | suspicously||suspiciously | 1185 | suspicously||suspiciously |
1112 | swaping||swapping | 1186 | swaping||swapping |
1113 | switchs||switches | 1187 | switchs||switches |
@@ -1122,6 +1196,7 @@ swtich||switch | |||
1122 | symetric||symmetric | 1196 | symetric||symmetric |
1123 | synax||syntax | 1197 | synax||syntax |
1124 | synchonized||synchronized | 1198 | synchonized||synchronized |
1199 | synchronuously||synchronously | ||
1125 | syncronize||synchronize | 1200 | syncronize||synchronize |
1126 | syncronized||synchronized | 1201 | syncronized||synchronized |
1127 | syncronizing||synchronizing | 1202 | syncronizing||synchronizing |
@@ -1130,11 +1205,14 @@ syste||system | |||
1130 | sytem||system | 1205 | sytem||system |
1131 | sythesis||synthesis | 1206 | sythesis||synthesis |
1132 | taht||that | 1207 | taht||that |
1208 | tansmit||transmit | ||
1133 | targetted||targeted | 1209 | targetted||targeted |
1134 | targetting||targeting | 1210 | targetting||targeting |
1211 | taskelt||tasklet | ||
1135 | teh||the | 1212 | teh||the |
1136 | temorary||temporary | 1213 | temorary||temporary |
1137 | temproarily||temporarily | 1214 | temproarily||temporarily |
1215 | thead||thread | ||
1138 | therfore||therefore | 1216 | therfore||therefore |
1139 | thier||their | 1217 | thier||their |
1140 | threds||threads | 1218 | threds||threads |
@@ -1143,11 +1221,14 @@ thresold||threshold | |||
1143 | throught||through | 1221 | throught||through |
1144 | troughput||throughput | 1222 | troughput||throughput |
1145 | thses||these | 1223 | thses||these |
1224 | tiggers||triggers | ||
1146 | tiggered||triggered | 1225 | tiggered||triggered |
1147 | tipically||typically | 1226 | tipically||typically |
1227 | timeing||timing | ||
1148 | timout||timeout | 1228 | timout||timeout |
1149 | tmis||this | 1229 | tmis||this |
1150 | torerable||tolerable | 1230 | torerable||tolerable |
1231 | traking||tracking | ||
1151 | tramsmitted||transmitted | 1232 | tramsmitted||transmitted |
1152 | tramsmit||transmit | 1233 | tramsmit||transmit |
1153 | tranasction||transaction | 1234 | tranasction||transaction |
@@ -1162,6 +1243,7 @@ transormed||transformed | |||
1162 | trasfer||transfer | 1243 | trasfer||transfer |
1163 | trasmission||transmission | 1244 | trasmission||transmission |
1164 | treshold||threshold | 1245 | treshold||threshold |
1246 | trigerred||triggered | ||
1165 | trigerring||triggering | 1247 | trigerring||triggering |
1166 | trun||turn | 1248 | trun||turn |
1167 | tunning||tuning | 1249 | tunning||tuning |
@@ -1169,6 +1251,8 @@ ture||true | |||
1169 | tyep||type | 1251 | tyep||type |
1170 | udpate||update | 1252 | udpate||update |
1171 | uesd||used | 1253 | uesd||used |
1254 | uknown||unknown | ||
1255 | usupported||unsupported | ||
1172 | uncommited||uncommitted | 1256 | uncommited||uncommitted |
1173 | unconditionaly||unconditionally | 1257 | unconditionaly||unconditionally |
1174 | underun||underrun | 1258 | underun||underrun |
@@ -1181,11 +1265,14 @@ unexpeted||unexpected | |||
1181 | unexpexted||unexpected | 1265 | unexpexted||unexpected |
1182 | unfortunatelly||unfortunately | 1266 | unfortunatelly||unfortunately |
1183 | unifiy||unify | 1267 | unifiy||unify |
1268 | uniterrupted||uninterrupted | ||
1184 | unintialized||uninitialized | 1269 | unintialized||uninitialized |
1185 | unkmown||unknown | 1270 | unkmown||unknown |
1186 | unknonw||unknown | 1271 | unknonw||unknown |
1187 | unknow||unknown | 1272 | unknow||unknown |
1188 | unkown||unknown | 1273 | unkown||unknown |
1274 | unamed||unnamed | ||
1275 | uneeded||unneeded | ||
1189 | unneded||unneeded | 1276 | unneded||unneeded |
1190 | unneccecary||unnecessary | 1277 | unneccecary||unnecessary |
1191 | unneccesary||unnecessary | 1278 | unneccesary||unnecessary |
@@ -1210,6 +1297,7 @@ usefull||useful | |||
1210 | usege||usage | 1297 | usege||usage |
1211 | usera||users | 1298 | usera||users |
1212 | usualy||usually | 1299 | usualy||usually |
1300 | usupported||unsupported | ||
1213 | utilites||utilities | 1301 | utilites||utilities |
1214 | utillities||utilities | 1302 | utillities||utilities |
1215 | utilties||utilities | 1303 | utilties||utilities |
@@ -1233,7 +1321,9 @@ virtaul||virtual | |||
1233 | virtiual||virtual | 1321 | virtiual||virtual |
1234 | visiters||visitors | 1322 | visiters||visitors |
1235 | vitual||virtual | 1323 | vitual||virtual |
1324 | vunerable||vulnerable | ||
1236 | wakeus||wakeups | 1325 | wakeus||wakeups |
1326 | wathdog||watchdog | ||
1237 | wating||waiting | 1327 | wating||waiting |
1238 | wiat||wait | 1328 | wiat||wait |
1239 | wether||whether | 1329 | wether||whether |
diff --git a/scripts/tags.sh b/scripts/tags.sh index 66f08bb1cce9..26de7d5aa5c8 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh | |||
@@ -152,6 +152,7 @@ regex_asm=( | |||
152 | ) | 152 | ) |
153 | regex_c=( | 153 | regex_c=( |
154 | '/^SYSCALL_DEFINE[0-9](\([[:alnum:]_]*\).*/sys_\1/' | 154 | '/^SYSCALL_DEFINE[0-9](\([[:alnum:]_]*\).*/sys_\1/' |
155 | '/^BPF_CALL_[0-9](\([[:alnum:]_]*\).*/\1/' | ||
155 | '/^COMPAT_SYSCALL_DEFINE[0-9](\([[:alnum:]_]*\).*/compat_sys_\1/' | 156 | '/^COMPAT_SYSCALL_DEFINE[0-9](\([[:alnum:]_]*\).*/compat_sys_\1/' |
156 | '/^TRACE_EVENT(\([[:alnum:]_]*\).*/trace_\1/' | 157 | '/^TRACE_EVENT(\([[:alnum:]_]*\).*/trace_\1/' |
157 | '/^TRACE_EVENT(\([[:alnum:]_]*\).*/trace_\1_rcuidle/' | 158 | '/^TRACE_EVENT(\([[:alnum:]_]*\).*/trace_\1_rcuidle/' |
@@ -245,7 +246,7 @@ exuberant() | |||
245 | { | 246 | { |
246 | setup_regex exuberant asm c | 247 | setup_regex exuberant asm c |
247 | all_target_sources | xargs $1 -a \ | 248 | all_target_sources | xargs $1 -a \ |
248 | -I __initdata,__exitdata,__initconst, \ | 249 | -I __initdata,__exitdata,__initconst,__ro_after_init \ |
249 | -I __initdata_memblock \ | 250 | -I __initdata_memblock \ |
250 | -I __refdata,__attribute,__maybe_unused,__always_unused \ | 251 | -I __refdata,__attribute,__maybe_unused,__always_unused \ |
251 | -I __acquires,__releases,__deprecated \ | 252 | -I __acquires,__releases,__deprecated \ |
diff --git a/scripts/tracing/draw_functrace.py b/scripts/tracing/draw_functrace.py index db40fa04cd51..9b6dd4f36335 100755 --- a/scripts/tracing/draw_functrace.py +++ b/scripts/tracing/draw_functrace.py | |||
@@ -123,7 +123,7 @@ def main(): | |||
123 | tree = tree.getParent(caller) | 123 | tree = tree.getParent(caller) |
124 | tree = tree.calls(callee, calltime) | 124 | tree = tree.calls(callee, calltime) |
125 | 125 | ||
126 | print CallTree.ROOT | 126 | print(CallTree.ROOT) |
127 | 127 | ||
128 | if __name__ == "__main__": | 128 | if __name__ == "__main__": |
129 | main() | 129 | main() |
diff --git a/scripts/ver_linux b/scripts/ver_linux index 7227994ccf63..a6c728db05ce 100755 --- a/scripts/ver_linux +++ b/scripts/ver_linux | |||
@@ -32,11 +32,13 @@ BEGIN { | |||
32 | printversion("Nfs-utils", version("showmount --version")) | 32 | printversion("Nfs-utils", version("showmount --version")) |
33 | 33 | ||
34 | while (getline <"/proc/self/maps" > 0) { | 34 | while (getline <"/proc/self/maps" > 0) { |
35 | n = split($0, procmaps, "/") | 35 | if (/libc.*\.so$/) { |
36 | if (/libc.*so$/ && match(procmaps[n], /[0-9]+([.]?[0-9]+)+/)) { | 36 | n = split($0, procmaps, "/") |
37 | ver = substr(procmaps[n], RSTART, RLENGTH) | 37 | if (match(procmaps[n], /[0-9]+([.]?[0-9]+)+/)) { |
38 | printversion("Linux C Library", ver) | 38 | ver = substr(procmaps[n], RSTART, RLENGTH) |
39 | break | 39 | printversion("Linux C Library", ver) |
40 | break | ||
41 | } | ||
40 | } | 42 | } |
41 | } | 43 | } |
42 | 44 | ||
@@ -68,7 +70,7 @@ BEGIN { | |||
68 | function version(cmd, ver) { | 70 | function version(cmd, ver) { |
69 | cmd = cmd " 2>&1" | 71 | cmd = cmd " 2>&1" |
70 | while (cmd | getline > 0) { | 72 | while (cmd | getline > 0) { |
71 | if (!/ver_linux/ && match($0, /[0-9]+([.]?[0-9]+)+/)) { | 73 | if (match($0, /[0-9]+([.]?[0-9]+)+/)) { |
72 | ver = substr($0, RSTART, RLENGTH) | 74 | ver = substr($0, RSTART, RLENGTH) |
73 | break | 75 | break |
74 | } | 76 | } |