aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-10 14:35:36 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-10 14:35:36 -0500
commit4ba24fef3eb3b142197135223b90ced2f319cd53 (patch)
treea20c125b27740ec7b4c761b11d801108e1b316b2 /scripts
parent47c1ffb2b6b630894e9a16442611c056ab21c057 (diff)
parent98a4a59ee31a12105a2b84f5b8b515ac2cb208ef (diff)
Merge branch 'next' into for-linus
Prepare first round of input updates for 3.20.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Kbuild.include22
-rw-r--r--scripts/Makefile.build14
-rw-r--r--scripts/Makefile.clean30
-rw-r--r--scripts/Makefile.dtbinst51
-rw-r--r--scripts/Makefile.fwinst2
-rw-r--r--scripts/Makefile.headersinst1
-rw-r--r--scripts/Makefile.host6
-rw-r--r--scripts/Makefile.lib21
-rw-r--r--scripts/Makefile.modinst7
-rw-r--r--scripts/Makefile.modsign2
-rwxr-xr-xscripts/bloat-o-meter2
-rwxr-xr-x[-rw-r--r--]scripts/bootgraph.pl0
-rw-r--r--scripts/checkkconfigsymbols.py139
-rwxr-xr-xscripts/checkkconfigsymbols.sh59
-rwxr-xr-xscripts/checkpatch.pl336
-rwxr-xr-xscripts/checkstack.pl7
-rw-r--r--scripts/coccinelle/api/platform_no_drv_owner.cocci106
-rw-r--r--scripts/coccinelle/misc/bugon.cocci2
-rw-r--r--scripts/coccinelle/misc/simple_return.cocci180
-rwxr-xr-x[-rw-r--r--]scripts/export_report.pl0
-rwxr-xr-x[-rw-r--r--]scripts/gcc-goto.sh0
-rwxr-xr-x[-rw-r--r--]scripts/gcc-ld0
-rwxr-xr-x[-rw-r--r--]scripts/gcc-version.sh0
-rwxr-xr-x[-rw-r--r--]scripts/gcc-x86_32-has-stack-protector.sh0
-rwxr-xr-x[-rw-r--r--]scripts/gcc-x86_64-has-stack-protector.sh0
-rwxr-xr-x[-rw-r--r--]scripts/gen_initramfs_list.sh0
-rwxr-xr-xscripts/headers.sh2
-rwxr-xr-x[-rw-r--r--]scripts/headers_check.pl0
-rwxr-xr-x[-rw-r--r--]scripts/headers_install.sh4
-rw-r--r--scripts/kallsyms.c2
-rw-r--r--scripts/kconfig/Makefile57
-rw-r--r--scripts/kconfig/list.h6
-rwxr-xr-x[-rw-r--r--]scripts/kconfig/lxdialog/check-lxdialog.sh6
-rw-r--r--scripts/kconfig/lxdialog/dialog.h2
-rw-r--r--scripts/kconfig/mconf.c4
-rw-r--r--scripts/kconfig/menu.c4
-rwxr-xr-x[-rw-r--r--]scripts/kconfig/streamline_config.pl0
-rwxr-xr-xscripts/kernel-doc2
-rwxr-xr-x[-rw-r--r--]scripts/link-vmlinux.sh0
-rwxr-xr-x[-rw-r--r--]scripts/markup_oops.pl0
-rwxr-xr-x[-rw-r--r--]scripts/mkmakefile0
-rwxr-xr-x[-rw-r--r--]scripts/mksysmap0
-rw-r--r--scripts/mod/modpost.c27
-rwxr-xr-x[-rw-r--r--]scripts/package/builddeb26
-rwxr-xr-x[-rw-r--r--]scripts/package/buildtar0
-rwxr-xr-xscripts/package/mkspec4
-rwxr-xr-x[-rw-r--r--]scripts/profile2linkerlist.pl0
-rw-r--r--scripts/recordmcount.c6
-rwxr-xr-xscripts/recordmcount.pl9
-rwxr-xr-x[-rw-r--r--]scripts/rt-tester/rt-tester.py0
-rwxr-xr-x[-rw-r--r--]scripts/selinux/install_policy.sh0
-rwxr-xr-xscripts/sign-file2
-rw-r--r--scripts/sortextable.h2
-rw-r--r--scripts/spelling.txt1042
-rwxr-xr-xscripts/tags.sh10
-rwxr-xr-x[-rw-r--r--]scripts/tracing/draw_functrace.py0
-rwxr-xr-x[-rw-r--r--]scripts/xz_wrap.sh0
57 files changed, 1931 insertions, 273 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 8a9a4e1c7eab..edd2794569db 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -171,13 +171,31 @@ ld-ifversion = $(shell [ $(call ld-version) $(1) $(2) ] && echo $(3))
171# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj= 171# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
172# Usage: 172# Usage:
173# $(Q)$(MAKE) $(build)=dir 173# $(Q)$(MAKE) $(build)=dir
174build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj 174build := -f $(srctree)/scripts/Makefile.build obj
175 175
176### 176###
177# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj= 177# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
178# Usage: 178# Usage:
179# $(Q)$(MAKE) $(modbuiltin)=dir 179# $(Q)$(MAKE) $(modbuiltin)=dir
180modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj 180modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
181
182###
183# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.dtbinst obj=
184# Usage:
185# $(Q)$(MAKE) $(dtbinst)=dir
186dtbinst := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.dtbinst obj
187
188###
189# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=
190# Usage:
191# $(Q)$(MAKE) $(clean)=dir
192clean := -f $(srctree)/scripts/Makefile.clean obj
193
194###
195# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.headersinst obj=
196# Usage:
197# $(Q)$(MAKE) $(hdr-inst)=dir
198hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj
181 199
182# Prefix -I with $(srctree) if it is not an absolute path. 200# Prefix -I with $(srctree) if it is not an absolute path.
183# skip if -I has no parameter 201# skip if -I has no parameter
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index bf3e6778cd71..649ce6844033 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -79,11 +79,11 @@ endif
79 79
80# =========================================================================== 80# ===========================================================================
81 81
82ifneq ($(strip $(lib-y) $(lib-m) $(lib-n) $(lib-)),) 82ifneq ($(strip $(lib-y) $(lib-m) $(lib-)),)
83lib-target := $(obj)/lib.a 83lib-target := $(obj)/lib.a
84endif 84endif
85 85
86ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-) $(subdir-m) $(lib-target)),) 86ifneq ($(strip $(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)),)
87builtin-target := $(obj)/built-in.o 87builtin-target := $(obj)/built-in.o
88endif 88endif
89 89
@@ -382,16 +382,14 @@ cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalys
382quiet_cmd_link_multi-m = LD [M] $@ 382quiet_cmd_link_multi-m = LD [M] $@
383cmd_link_multi-m = $(cmd_link_multi-y) 383cmd_link_multi-m = $(cmd_link_multi-y)
384 384
385# We would rather have a list of rules like 385$(multi-used-y): FORCE
386# foo.o: $(foo-objs)
387# but that's not so easy, so we rather make all composite objects depend
388# on the set of all their parts
389$(multi-used-y) : %.o: $(multi-objs-y) FORCE
390 $(call if_changed,link_multi-y) 386 $(call if_changed,link_multi-y)
387$(call multi_depend, $(multi-used-y), .o, -objs -y)
391 388
392$(multi-used-m) : %.o: $(multi-objs-m) FORCE 389$(multi-used-m): FORCE
393 $(call if_changed,link_multi-m) 390 $(call if_changed,link_multi-m)
394 @{ echo $(@:.o=.ko); echo $(link_multi_deps); } > $(MODVERDIR)/$(@F:.o=.mod) 391 @{ echo $(@:.o=.ko); echo $(link_multi_deps); } > $(MODVERDIR)/$(@F:.o=.mod)
392$(call multi_depend, $(multi-used-m), .o, -objs -y)
395 393
396targets += $(multi-used-y) $(multi-used-m) 394targets += $(multi-used-y) $(multi-used-m)
397 395
diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean
index a651cee84f2a..627f8cbbedb8 100644
--- a/scripts/Makefile.clean
+++ b/scripts/Makefile.clean
@@ -7,10 +7,7 @@ src := $(obj)
7PHONY := __clean 7PHONY := __clean
8__clean: 8__clean:
9 9
10# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir 10include scripts/Kbuild.include
11# Usage:
12# $(Q)$(MAKE) $(clean)=dir
13clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
14 11
15# The filename Kbuild has precedence over Makefile 12# The filename Kbuild has precedence over Makefile
16kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 13kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
@@ -23,15 +20,13 @@ __subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
23subdir-y += $(__subdir-y) 20subdir-y += $(__subdir-y)
24__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m))) 21__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
25subdir-m += $(__subdir-m) 22subdir-m += $(__subdir-m)
26__subdir-n := $(patsubst %/,%,$(filter %/, $(obj-n)))
27subdir-n += $(__subdir-n)
28__subdir- := $(patsubst %/,%,$(filter %/, $(obj-))) 23__subdir- := $(patsubst %/,%,$(filter %/, $(obj-)))
29subdir- += $(__subdir-) 24subdir- += $(__subdir-)
30 25
31# Subdirectories we need to descend into 26# Subdirectories we need to descend into
32 27
33subdir-ym := $(sort $(subdir-y) $(subdir-m)) 28subdir-ym := $(sort $(subdir-y) $(subdir-m))
34subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-)) 29subdir-ymn := $(sort $(subdir-ym) $(subdir-))
35 30
36# Add subdir path 31# Add subdir path
37 32
@@ -47,19 +42,19 @@ __clean-files := $(extra-y) $(extra-m) $(extra-) \
47 42
48__clean-files := $(filter-out $(no-clean-files), $(__clean-files)) 43__clean-files := $(filter-out $(no-clean-files), $(__clean-files))
49 44
50# as clean-files is given relative to the current directory, this adds 45# clean-files is given relative to the current directory, unless it
51# a $(obj) prefix, except for absolute paths 46# starts with $(objtree)/ (which means "./", so do not add "./" unless
47# you want to delete a file from the toplevel object directory).
52 48
53__clean-files := $(wildcard \ 49__clean-files := $(wildcard \
54 $(addprefix $(obj)/, $(filter-out /%, $(__clean-files))) \ 50 $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(__clean-files))) \
55 $(filter /%, $(__clean-files))) 51 $(filter $(objtree)/%, $(__clean-files)))
56 52
57# as clean-dirs is given relative to the current directory, this adds 53# same as clean-files
58# a $(obj) prefix, except for absolute paths
59 54
60__clean-dirs := $(wildcard \ 55__clean-dirs := $(wildcard \
61 $(addprefix $(obj)/, $(filter-out /%, $(clean-dirs))) \ 56 $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(clean-dirs))) \
62 $(filter /%, $(clean-dirs))) 57 $(filter $(objtree)/%, $(clean-dirs)))
63 58
64# ========================================================================== 59# ==========================================================================
65 60
@@ -93,11 +88,6 @@ PHONY += $(subdir-ymn)
93$(subdir-ymn): 88$(subdir-ymn):
94 $(Q)$(MAKE) $(clean)=$@ 89 $(Q)$(MAKE) $(clean)=$@
95 90
96# If quiet is set, only print short version of command
97
98cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
99
100
101# Declare the contents of the .PHONY variable as phony. We keep that 91# Declare the contents of the .PHONY variable as phony. We keep that
102# information in a variable se we can use it in if_changed and friends. 92# information in a variable se we can use it in if_changed and friends.
103 93
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
new file mode 100644
index 000000000000..909ed7a2ac61
--- /dev/null
+++ b/scripts/Makefile.dtbinst
@@ -0,0 +1,51 @@
1# ==========================================================================
2# Installing dtb files
3#
4# Installs all dtb files listed in $(dtb-y) either in the
5# INSTALL_DTBS_PATH directory or the default location:
6#
7# $INSTALL_PATH/dtbs/$KERNELRELEASE
8#
9# Traverse through subdirectories listed in $(dts-dirs).
10# ==========================================================================
11
12src := $(obj)
13
14PHONY := __dtbs_install
15__dtbs_install:
16
17export dtbinst-root ?= $(obj)
18
19include include/config/auto.conf
20include scripts/Kbuild.include
21include $(srctree)/$(obj)/Makefile
22
23PHONY += __dtbs_install_prep
24__dtbs_install_prep:
25ifeq ("$(dtbinst-root)", "$(obj)")
26 $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi
27 $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi
28 $(Q)mkdir -p $(INSTALL_DTBS_PATH)
29endif
30
31dtbinst-files := $(dtb-y)
32dtbinst-dirs := $(dts-dirs)
33
34# Helper targets for Installing DTBs into the boot directory
35quiet_cmd_dtb_install = INSTALL $<
36 cmd_dtb_install = mkdir -p $(2); cp $< $(2)
37
38install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj))
39
40$(dtbinst-files) $(dtbinst-dirs): | __dtbs_install_prep
41
42$(dtbinst-files): %.dtb: $(obj)/%.dtb
43 $(call cmd,dtb_install,$(install-dir))
44
45$(dtbinst-dirs):
46 $(Q)$(MAKE) $(dtbinst)=$(obj)/$@
47
48PHONY += $(dtbinst-files) $(dtbinst-dirs)
49__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
50
51.PHONY: $(PHONY)
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst
index d8e335eed226..5b698add4f31 100644
--- a/scripts/Makefile.fwinst
+++ b/scripts/Makefile.fwinst
@@ -2,7 +2,7 @@
2# Installing firmware 2# Installing firmware
3# 3#
4# We don't include the .config, so all firmware files are in $(fw-shipped-) 4# We don't include the .config, so all firmware files are in $(fw-shipped-)
5# rather than in $(fw-shipped-y) or $(fw-shipped-n). 5# rather than in $(fw-shipped-y) or $(fw-shipped-m).
6# ========================================================================== 6# ==========================================================================
7 7
8INSTALL := install 8INSTALL := install
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index 8ccf83056a7a..1106d6ca3a38 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -122,7 +122,6 @@ $(check-file): scripts/headers_check.pl $(output-files) FORCE
122endif 122endif
123 123
124# Recursion 124# Recursion
125hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
126.PHONY: $(subdirs) 125.PHONY: $(subdirs)
127$(subdirs): 126$(subdirs):
128 $(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(_dst)/$@ 127 $(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(_dst)/$@
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index ab5980f91714..133edfae5b8a 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -96,8 +96,9 @@ quiet_cmd_host-cmulti = HOSTLD $@
96 cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \ 96 cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \
97 $(addprefix $(obj)/,$($(@F)-objs)) \ 97 $(addprefix $(obj)/,$($(@F)-objs)) \
98 $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 98 $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
99$(host-cmulti): $(obj)/%: $(host-cobjs) FORCE 99$(host-cmulti): FORCE
100 $(call if_changed,host-cmulti) 100 $(call if_changed,host-cmulti)
101$(call multi_depend, $(host-cmulti), , -objs)
101 102
102# Create .o file from a single .c file 103# Create .o file from a single .c file
103# host-cobjs -> .o 104# host-cobjs -> .o
@@ -113,8 +114,9 @@ quiet_cmd_host-cxxmulti = HOSTLD $@
113 $(foreach o,objs cxxobjs,\ 114 $(foreach o,objs cxxobjs,\
114 $(addprefix $(obj)/,$($(@F)-$(o)))) \ 115 $(addprefix $(obj)/,$($(@F)-$(o)))) \
115 $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 116 $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
116$(host-cxxmulti): $(obj)/%: $(host-cobjs) $(host-cxxobjs) FORCE 117$(host-cxxmulti): FORCE
117 $(call if_changed,host-cxxmulti) 118 $(call if_changed,host-cxxmulti)
119$(call multi_depend, $(host-cxxmulti), , -objs -cxxobjs)
118 120
119# Create .o file from a single .cc (C++) file 121# Create .o file from a single .cc (C++) file
120quiet_cmd_host-cxxobjs = HOSTCXX $@ 122quiet_cmd_host-cxxobjs = HOSTCXX $@
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 260bf8acfce9..511755200634 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -159,6 +159,15 @@ dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \
159modname-multi = $(sort $(foreach m,$(multi-used),\ 159modname-multi = $(sort $(foreach m,$(multi-used),\
160 $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=)))) 160 $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=))))
161 161
162# Useful for describing the dependency of composite objects
163# Usage:
164# $(call multi_depend, multi_used_targets, suffix_to_remove, suffix_to_add)
165define multi_depend
166$(foreach m, $(notdir $1), \
167 $(eval $(obj)/$m: \
168 $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s)))))))
169endef
170
162ifdef REGENERATE_PARSERS 171ifdef REGENERATE_PARSERS
163 172
164# GPERF 173# GPERF
@@ -274,18 +283,6 @@ $(obj)/%.dtb: $(src)/%.dts FORCE
274 283
275dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) 284dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
276 285
277# Helper targets for Installing DTBs into the boot directory
278quiet_cmd_dtb_install = INSTALL $<
279 cmd_dtb_install = cp $< $(2)
280
281_dtbinst_pre_:
282 $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi
283 $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi
284 $(Q)mkdir -p $(INSTALL_DTBS_PATH)
285
286%.dtb_dtbinst_: $(obj)/%.dtb _dtbinst_pre_
287 $(call cmd,dtb_install,$(INSTALL_DTBS_PATH))
288
289# Bzip2 286# Bzip2
290# --------------------------------------------------------------------------- 287# ---------------------------------------------------------------------------
291 288
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index 95ec7b35e8b6..e48a4e9d8868 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -18,7 +18,12 @@ __modinst: $(modules)
18 18
19# Don't stop modules_install if we can't sign external modules. 19# Don't stop modules_install if we can't sign external modules.
20quiet_cmd_modules_install = INSTALL $@ 20quiet_cmd_modules_install = INSTALL $@
21 cmd_modules_install = mkdir -p $(2); cp $@ $(2) ; $(mod_strip_cmd) $(2)/$(notdir $@) ; $(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) 21 cmd_modules_install = \
22 mkdir -p $(2) ; \
23 cp $@ $(2) ; \
24 $(mod_strip_cmd) $(2)/$(notdir $@) ; \
25 $(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) ; \
26 $(mod_compress_cmd) $(2)/$(notdir $@)
22 27
23# Modules built outside the kernel source tree go into extra by default 28# Modules built outside the kernel source tree go into extra by default
24INSTALL_MOD_DIR ?= extra 29INSTALL_MOD_DIR ?= extra
diff --git a/scripts/Makefile.modsign b/scripts/Makefile.modsign
index abfda626dbad..b6ac7084da79 100644
--- a/scripts/Makefile.modsign
+++ b/scripts/Makefile.modsign
@@ -7,7 +7,7 @@ __modsign:
7 7
8include scripts/Kbuild.include 8include scripts/Kbuild.include
9 9
10__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod))) 10__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
11modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) 11modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
12 12
13PHONY += $(modules) 13PHONY += $(modules)
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index 549d0ab8c662..23e78dcd12bf 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -20,6 +20,8 @@ def getsizes(file):
20 if type in "tTdDbBrR": 20 if type in "tTdDbBrR":
21 # strip generated symbols 21 # strip generated symbols
22 if name.startswith("__mod_"): continue 22 if name.startswith("__mod_"): continue
23 if name.startswith("SyS_"): continue
24 if name.startswith("compat_SyS_"): continue
23 if name == "linux_banner": continue 25 if name == "linux_banner": continue
24 # statics and some other optimizations adds random .NUMBER 26 # statics and some other optimizations adds random .NUMBER
25 name = re.sub(r'\.[0-9]+', '', name) 27 name = re.sub(r'\.[0-9]+', '', name)
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index 9ca667bcaee9..9ca667bcaee9 100644..100755
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py
new file mode 100644
index 000000000000..e9cc689033fe
--- /dev/null
+++ b/scripts/checkkconfigsymbols.py
@@ -0,0 +1,139 @@
1#!/usr/bin/env python
2
3"""Find Kconfig identifiers that are referenced but not defined."""
4
5# (c) 2014 Valentin Rothberg <valentinrothberg@gmail.com>
6# (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de>
7#
8# Licensed under the terms of the GNU GPL License version 2
9
10
11import os
12import re
13from subprocess import Popen, PIPE, STDOUT
14
15
16# regex expressions
17OPERATORS = r"&|\(|\)|\||\!"
18FEATURE = r"(?:\w*[A-Z0-9]\w*){2,}"
19DEF = r"^\s*(?:menu){,1}config\s+(" + FEATURE + r")\s*"
20EXPR = r"(?:" + OPERATORS + r"|\s|" + FEATURE + r")+"
21STMT = r"^\s*(?:if|select|depends\s+on)\s+" + EXPR
22SOURCE_FEATURE = r"(?:\W|\b)+[D]{,1}CONFIG_(" + FEATURE + r")"
23
24# regex objects
25REGEX_FILE_KCONFIG = re.compile(r".*Kconfig[\.\w+\-]*$")
26REGEX_FEATURE = re.compile(r"(" + FEATURE + r")")
27REGEX_SOURCE_FEATURE = re.compile(SOURCE_FEATURE)
28REGEX_KCONFIG_DEF = re.compile(DEF)
29REGEX_KCONFIG_EXPR = re.compile(EXPR)
30REGEX_KCONFIG_STMT = re.compile(STMT)
31REGEX_KCONFIG_HELP = re.compile(r"^\s+(help|---help---)\s*$")
32REGEX_FILTER_FEATURES = re.compile(r"[A-Za-z0-9]$")
33
34
35def main():
36 """Main function of this module."""
37 source_files = []
38 kconfig_files = []
39 defined_features = set()
40 referenced_features = dict() # {feature: [files]}
41
42 # use 'git ls-files' to get the worklist
43 pop = Popen("git ls-files", stdout=PIPE, stderr=STDOUT, shell=True)
44 (stdout, _) = pop.communicate() # wait until finished
45 if len(stdout) > 0 and stdout[-1] == "\n":
46 stdout = stdout[:-1]
47
48 for gitfile in stdout.rsplit("\n"):
49 if ".git" in gitfile or "ChangeLog" in gitfile or \
50 ".log" in gitfile or os.path.isdir(gitfile):
51 continue
52 if REGEX_FILE_KCONFIG.match(gitfile):
53 kconfig_files.append(gitfile)
54 else:
55 # all non-Kconfig files are checked for consistency
56 source_files.append(gitfile)
57
58 for sfile in source_files:
59 parse_source_file(sfile, referenced_features)
60
61 for kfile in kconfig_files:
62 parse_kconfig_file(kfile, defined_features, referenced_features)
63
64 print "Undefined symbol used\tFile list"
65 for feature in sorted(referenced_features):
66 # filter some false positives
67 if feature == "FOO" or feature == "BAR" or \
68 feature == "FOO_BAR" or feature == "XXX":
69 continue
70 if feature not in defined_features:
71 if feature.endswith("_MODULE"):
72 # avoid false positives for kernel modules
73 if feature[:-len("_MODULE")] in defined_features:
74 continue
75 files = referenced_features.get(feature)
76 print "%s\t%s" % (feature, ", ".join(files))
77
78
79def parse_source_file(sfile, referenced_features):
80 """Parse @sfile for referenced Kconfig features."""
81 lines = []
82 with open(sfile, "r") as stream:
83 lines = stream.readlines()
84
85 for line in lines:
86 if not "CONFIG_" in line:
87 continue
88 features = REGEX_SOURCE_FEATURE.findall(line)
89 for feature in features:
90 if not REGEX_FILTER_FEATURES.search(feature):
91 continue
92 sfiles = referenced_features.get(feature, set())
93 sfiles.add(sfile)
94 referenced_features[feature] = sfiles
95
96
97def get_features_in_line(line):
98 """Return mentioned Kconfig features in @line."""
99 return REGEX_FEATURE.findall(line)
100
101
102def parse_kconfig_file(kfile, defined_features, referenced_features):
103 """Parse @kfile and update feature definitions and references."""
104 lines = []
105 skip = False
106
107 with open(kfile, "r") as stream:
108 lines = stream.readlines()
109
110 for i in range(len(lines)):
111 line = lines[i]
112 line = line.strip('\n')
113 line = line.split("#")[0] # ignore comments
114
115 if REGEX_KCONFIG_DEF.match(line):
116 feature_def = REGEX_KCONFIG_DEF.findall(line)
117 defined_features.add(feature_def[0])
118 skip = False
119 elif REGEX_KCONFIG_HELP.match(line):
120 skip = True
121 elif skip:
122 # ignore content of help messages
123 pass
124 elif REGEX_KCONFIG_STMT.match(line):
125 features = get_features_in_line(line)
126 # multi-line statements
127 while line.endswith("\\"):
128 i += 1
129 line = lines[i]
130 line = line.strip('\n')
131 features.extend(get_features_in_line(line))
132 for feature in set(features):
133 paths = referenced_features.get(feature, set())
134 paths.add(kfile)
135 referenced_features[feature] = paths
136
137
138if __name__ == "__main__":
139 main()
diff --git a/scripts/checkkconfigsymbols.sh b/scripts/checkkconfigsymbols.sh
deleted file mode 100755
index ccb3391882d1..000000000000
--- a/scripts/checkkconfigsymbols.sh
+++ /dev/null
@@ -1,59 +0,0 @@
1#!/bin/sh
2# Find Kconfig variables used in source code but never defined in Kconfig
3# Copyright (C) 2007, Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
4
5# Tested with dash.
6paths="$@"
7[ -z "$paths" ] && paths=.
8
9# Doing this once at the beginning saves a lot of time, on a cache-hot tree.
10Kconfigs="`find . -name 'Kconfig' -o -name 'Kconfig*[^~]'`"
11
12printf "File list \tundefined symbol used\n"
13find $paths -name '*.[chS]' -o -name 'Makefile' -o -name 'Makefile*[^~]'| while read i
14do
15 # Output the bare Kconfig variable and the filename; the _MODULE part at
16 # the end is not removed here (would need perl an not-hungry regexp for that).
17 sed -ne 's!^.*\<\(UML_\)\?CONFIG_\([0-9A-Za-z_]\+\).*!\2 '$i'!p' < $i
18done | \
19# Smart "sort|uniq" implemented in awk and tuned to collect the names of all
20# files which use a given symbol
21awk '{map[$1, count[$1]++] = $2; }
22END {
23 for (combIdx in map) {
24 split(combIdx, separate, SUBSEP);
25 # The value may have been removed.
26 if (! ( (separate[1], separate[2]) in map ) )
27 continue;
28 symb=separate[1];
29 printf "%s ", symb;
30 #Use gawk extension to delete the names vector
31 delete names;
32 #Portably delete the names vector
33 #split("", names);
34 for (i=0; i < count[symb]; i++) {
35 names[map[symb, i]] = 1;
36 # Unfortunately, we may still encounter symb, i in the
37 # outside iteration.
38 delete map[symb, i];
39 }
40 i=0;
41 for (name in names) {
42 if (i > 0)
43 printf ", %s", name;
44 else
45 printf "%s", name;
46 i++;
47 }
48 printf "\n";
49 }
50}' |
51while read symb files; do
52 # Remove the _MODULE suffix when checking the variable name. This should
53 # be done only on tristate symbols, actually, but Kconfig parsing is
54 # beyond the purpose of this script.
55 symb_bare=`echo $symb | sed -e 's/_MODULE//'`
56 if ! grep -q "\<$symb_bare\>" $Kconfigs; then
57 printf "$files: \t$symb\n"
58 fi
59done|sort
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4d08b398411f..f0bb6d60c07b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -7,9 +7,11 @@
7 7
8use strict; 8use strict;
9use POSIX; 9use POSIX;
10use File::Basename;
11use Cwd 'abs_path';
10 12
11my $P = $0; 13my $P = $0;
12$P =~ s@.*/@@g; 14my $D = dirname(abs_path($P));
13 15
14my $V = '0.32'; 16my $V = '0.32';
15 17
@@ -43,6 +45,8 @@ my $configuration_file = ".checkpatch.conf";
43my $max_line_length = 80; 45my $max_line_length = 80;
44my $ignore_perl_version = 0; 46my $ignore_perl_version = 0;
45my $minimum_perl_version = 5.10.0; 47my $minimum_perl_version = 5.10.0;
48my $min_conf_desc_length = 4;
49my $spelling_file = "$D/spelling.txt";
46 50
47sub help { 51sub help {
48 my ($exitcode) = @_; 52 my ($exitcode) = @_;
@@ -63,6 +67,7 @@ Options:
63 --types TYPE(,TYPE2...) show only these comma separated message types 67 --types TYPE(,TYPE2...) show only these comma separated message types
64 --ignore TYPE(,TYPE2...) ignore various comma separated message types 68 --ignore TYPE(,TYPE2...) ignore various comma separated message types
65 --max-line-length=n set the maximum line length, if exceeded, warn 69 --max-line-length=n set the maximum line length, if exceeded, warn
70 --min-conf-desc-length=n set the min description length, if shorter, warn
66 --show-types show the message "types" in the output 71 --show-types show the message "types" in the output
67 --root=PATH PATH to the kernel tree root 72 --root=PATH PATH to the kernel tree root
68 --no-summary suppress the per-file summary 73 --no-summary suppress the per-file summary
@@ -131,6 +136,7 @@ GetOptions(
131 'types=s' => \@use, 136 'types=s' => \@use,
132 'show-types!' => \$show_types, 137 'show-types!' => \$show_types,
133 'max-line-length=i' => \$max_line_length, 138 'max-line-length=i' => \$max_line_length,
139 'min-conf-desc-length=i' => \$min_conf_desc_length,
134 'root=s' => \$root, 140 'root=s' => \$root,
135 'summary!' => \$summary, 141 'summary!' => \$summary,
136 'mailback!' => \$mailback, 142 'mailback!' => \$mailback,
@@ -425,10 +431,38 @@ foreach my $entry (@mode_permission_funcs) {
425 431
426our $allowed_asm_includes = qr{(?x: 432our $allowed_asm_includes = qr{(?x:
427 irq| 433 irq|
428 memory 434 memory|
435 time|
436 reboot
429)}; 437)};
430# memory.h: ARM has a custom one 438# memory.h: ARM has a custom one
431 439
440# Load common spelling mistakes and build regular expression list.
441my $misspellings;
442my %spelling_fix;
443
444if (open(my $spelling, '<', $spelling_file)) {
445 my @spelling_list;
446 while (<$spelling>) {
447 my $line = $_;
448
449 $line =~ s/\s*\n?$//g;
450 $line =~ s/^\s*//g;
451
452 next if ($line =~ m/^\s*#/);
453 next if ($line =~ m/^\s*$/);
454
455 my ($suspect, $fix) = split(/\|\|/, $line);
456
457 push(@spelling_list, $suspect);
458 $spelling_fix{$suspect} = $fix;
459 }
460 close($spelling);
461 $misspellings = join("|", @spelling_list);
462} else {
463 warn "No typos will be found - file '$spelling_file': $!\n";
464}
465
432sub build_types { 466sub build_types {
433 my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)"; 467 my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)";
434 my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)"; 468 my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)";
@@ -912,7 +946,7 @@ sub sanitise_line {
912sub get_quoted_string { 946sub get_quoted_string {
913 my ($line, $rawline) = @_; 947 my ($line, $rawline) = @_;
914 948
915 return "" if ($line !~ m/(\"[X]+\")/g); 949 return "" if ($line !~ m/(\"[X\t]+\")/g);
916 return substr($rawline, $-[0], $+[0] - $-[0]); 950 return substr($rawline, $-[0], $+[0] - $-[0]);
917} 951}
918 952
@@ -1813,6 +1847,7 @@ sub process {
1813 my $non_utf8_charset = 0; 1847 my $non_utf8_charset = 0;
1814 1848
1815 my $last_blank_line = 0; 1849 my $last_blank_line = 0;
1850 my $last_coalesced_string_linenr = -1;
1816 1851
1817 our @report = (); 1852 our @report = ();
1818 our $cnt_lines = 0; 1853 our $cnt_lines = 0;
@@ -2048,6 +2083,12 @@ sub process {
2048 $in_commit_log = 0; 2083 $in_commit_log = 0;
2049 } 2084 }
2050 2085
2086# Check if MAINTAINERS is being updated. If so, there's probably no need to
2087# emit the "does MAINTAINERS need updating?" message on file add/move/delete
2088 if ($line =~ /^\s*MAINTAINERS\s*\|/) {
2089 $reported_maintainer_file = 1;
2090 }
2091
2051# Check signature styles 2092# Check signature styles
2052 if (!$in_header_lines && 2093 if (!$in_header_lines &&
2053 $line =~ /^(\s*)([a-z0-9_-]+by:|$signature_tags)(\s*)(.*)/i) { 2094 $line =~ /^(\s*)([a-z0-9_-]+by:|$signature_tags)(\s*)(.*)/i) {
@@ -2215,6 +2256,23 @@ sub process {
2215 "8-bit UTF-8 used in possible commit log\n" . $herecurr); 2256 "8-bit UTF-8 used in possible commit log\n" . $herecurr);
2216 } 2257 }
2217 2258
2259# Check for various typo / spelling mistakes
2260 if (defined($misspellings) && ($in_commit_log || $line =~ /^\+/)) {
2261 while ($rawline =~ /(?:^|[^a-z@])($misspellings)(?:$|[^a-z@])/gi) {
2262 my $typo = $1;
2263 my $typo_fix = $spelling_fix{lc($typo)};
2264 $typo_fix = ucfirst($typo_fix) if ($typo =~ /^[A-Z]/);
2265 $typo_fix = uc($typo_fix) if ($typo =~ /^[A-Z]+$/);
2266 my $msg_type = \&WARN;
2267 $msg_type = \&CHK if ($file);
2268 if (&{$msg_type}("TYPO_SPELLING",
2269 "'$typo' may be misspelled - perhaps '$typo_fix'?\n" . $herecurr) &&
2270 $fix) {
2271 $fixed[$fixlinenr] =~ s/(^|[^A-Za-z@])($typo)($|[^A-Za-z@])/$1$typo_fix$3/;
2272 }
2273 }
2274 }
2275
2218# ignore non-hunk lines and lines being removed 2276# ignore non-hunk lines and lines being removed
2219 next if (!$hunk_line || $line =~ /^-/); 2277 next if (!$hunk_line || $line =~ /^-/);
2220 2278
@@ -2283,8 +2341,10 @@ sub process {
2283 } 2341 }
2284 $length++; 2342 $length++;
2285 } 2343 }
2286 WARN("CONFIG_DESCRIPTION", 2344 if ($is_start && $is_end && $length < $min_conf_desc_length) {
2287 "please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_start && $is_end && $length < 4); 2345 WARN("CONFIG_DESCRIPTION",
2346 "please write a paragraph that describes the config symbol fully\n" . $herecurr);
2347 }
2288 #print "is_start<$is_start> is_end<$is_end> length<$length>\n"; 2348 #print "is_start<$is_start> is_end<$is_end> length<$length>\n";
2289 } 2349 }
2290 2350
@@ -2341,7 +2401,7 @@ sub process {
2341 } 2401 }
2342 2402
2343# check we are in a valid source file if not then ignore this hunk 2403# check we are in a valid source file if not then ignore this hunk
2344 next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/); 2404 next if ($realfile !~ /\.(h|c|s|S|pl|sh|dtsi|dts)$/);
2345 2405
2346#line length limit 2406#line length limit
2347 if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ && 2407 if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
@@ -2354,33 +2414,6 @@ sub process {
2354 "line over $max_line_length characters\n" . $herecurr); 2414 "line over $max_line_length characters\n" . $herecurr);
2355 } 2415 }
2356 2416
2357# Check for user-visible strings broken across lines, which breaks the ability
2358# to grep for the string. Make exceptions when the previous string ends in a
2359# newline (multiple lines in one string constant) or '\t', '\r', ';', or '{'
2360# (common in inline assembly) or is a octal \123 or hexadecimal \xaf value
2361 if ($line =~ /^\+\s*"/ &&
2362 $prevline =~ /"\s*$/ &&
2363 $prevrawline !~ /(?:\\(?:[ntr]|[0-7]{1,3}|x[0-9a-fA-F]{1,2})|;\s*|\{\s*)"\s*$/) {
2364 WARN("SPLIT_STRING",
2365 "quoted string split across lines\n" . $hereprev);
2366 }
2367
2368# check for missing a space in a string concatination
2369 if ($prevrawline =~ /[^\\]\w"$/ && $rawline =~ /^\+[\t ]+"\w/) {
2370 WARN('MISSING_SPACE',
2371 "break quoted strings at a space character\n" . $hereprev);
2372 }
2373
2374# check for spaces before a quoted newline
2375 if ($rawline =~ /^.*\".*\s\\n/) {
2376 if (WARN("QUOTED_WHITESPACE_BEFORE_NEWLINE",
2377 "unnecessary whitespace before a quoted newline\n" . $herecurr) &&
2378 $fix) {
2379 $fixed[$fixlinenr] =~ s/^(\+.*\".*)\s+\\n/$1\\n/;
2380 }
2381
2382 }
2383
2384# check for adding lines without a newline. 2417# check for adding lines without a newline.
2385 if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) { 2418 if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
2386 WARN("MISSING_EOF_NEWLINE", 2419 WARN("MISSING_EOF_NEWLINE",
@@ -2402,7 +2435,7 @@ sub process {
2402 } 2435 }
2403 2436
2404# check we are in a valid source file C or perl if not then ignore this hunk 2437# check we are in a valid source file C or perl if not then ignore this hunk
2405 next if ($realfile !~ /\.(h|c|pl)$/); 2438 next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/);
2406 2439
2407# at the beginning of a line any tabs must come first and anything 2440# at the beginning of a line any tabs must come first and anything
2408# more than 8 must use tabs. 2441# more than 8 must use tabs.
@@ -2424,7 +2457,7 @@ sub process {
2424 "please, no space before tabs\n" . $herevet) && 2457 "please, no space before tabs\n" . $herevet) &&
2425 $fix) { 2458 $fix) {
2426 while ($fixed[$fixlinenr] =~ 2459 while ($fixed[$fixlinenr] =~
2427 s/(^\+.*) {8,8}+\t/$1\t\t/) {} 2460 s/(^\+.*) {8,8}\t/$1\t\t/) {}
2428 while ($fixed[$fixlinenr] =~ 2461 while ($fixed[$fixlinenr] =~
2429 s/(^\+.*) +\t/$1\t/) {} 2462 s/(^\+.*) +\t/$1\t/) {}
2430 } 2463 }
@@ -2466,7 +2499,8 @@ sub process {
2466 } 2499 }
2467 } 2500 }
2468 2501
2469 if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|{)/) { 2502 if ($line =~ /^\+.*(\w+\s*)?\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|[,;\({\[\<\>])/ &&
2503 (!defined($1) || $1 !~ /sizeof\s*/)) {
2470 if (CHK("SPACING", 2504 if (CHK("SPACING",
2471 "No space is necessary after a cast\n" . $herecurr) && 2505 "No space is necessary after a cast\n" . $herecurr) &&
2472 $fix) { 2506 $fix) {
@@ -2592,10 +2626,14 @@ sub process {
2592 next if ($realfile !~ /\.(h|c)$/); 2626 next if ($realfile !~ /\.(h|c)$/);
2593 2627
2594# check indentation of any line with a bare else 2628# check indentation of any line with a bare else
2629# (but not if it is a multiple line "if (foo) return bar; else return baz;")
2595# if the previous line is a break or return and is indented 1 tab more... 2630# if the previous line is a break or return and is indented 1 tab more...
2596 if ($sline =~ /^\+([\t]+)(?:}[ \t]*)?else(?:[ \t]*{)?\s*$/) { 2631 if ($sline =~ /^\+([\t]+)(?:}[ \t]*)?else(?:[ \t]*{)?\s*$/) {
2597 my $tabs = length($1) + 1; 2632 my $tabs = length($1) + 1;
2598 if ($prevline =~ /^\+\t{$tabs,$tabs}(?:break|return)\b/) { 2633 if ($prevline =~ /^\+\t{$tabs,$tabs}break\b/ ||
2634 ($prevline =~ /^\+\t{$tabs,$tabs}return\b/ &&
2635 defined $lines[$linenr] &&
2636 $lines[$linenr] !~ /^[ \+]\t{$tabs,$tabs}return/)) {
2599 WARN("UNNECESSARY_ELSE", 2637 WARN("UNNECESSARY_ELSE",
2600 "else is not generally useful after a break or return\n" . $hereprev); 2638 "else is not generally useful after a break or return\n" . $hereprev);
2601 } 2639 }
@@ -3510,14 +3548,33 @@ sub process {
3510 } 3548 }
3511 } 3549 }
3512 3550
3513 # , must have a space on the right. 3551 # , must not have a space before and must have a space on the right.
3514 } elsif ($op eq ',') { 3552 } elsif ($op eq ',') {
3553 my $rtrim_before = 0;
3554 my $space_after = 0;
3555 if ($ctx =~ /Wx./) {
3556 if (ERROR("SPACING",
3557 "space prohibited before that '$op' $at\n" . $hereptr)) {
3558 $line_fixed = 1;
3559 $rtrim_before = 1;
3560 }
3561 }
3515 if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/) { 3562 if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/) {
3516 if (ERROR("SPACING", 3563 if (ERROR("SPACING",
3517 "space required after that '$op' $at\n" . $hereptr)) { 3564 "space required after that '$op' $at\n" . $hereptr)) {
3518 $good = $fix_elements[$n] . trim($fix_elements[$n + 1]) . " ";
3519 $line_fixed = 1; 3565 $line_fixed = 1;
3520 $last_after = $n; 3566 $last_after = $n;
3567 $space_after = 1;
3568 }
3569 }
3570 if ($rtrim_before || $space_after) {
3571 if ($rtrim_before) {
3572 $good = rtrim($fix_elements[$n]) . trim($fix_elements[$n + 1]);
3573 } else {
3574 $good = $fix_elements[$n] . trim($fix_elements[$n + 1]);
3575 }
3576 if ($space_after) {
3577 $good .= " ";
3521 } 3578 }
3522 } 3579 }
3523 3580
@@ -3752,7 +3809,6 @@ sub process {
3752 if (ERROR("SPACING", 3809 if (ERROR("SPACING",
3753 "space prohibited before that close parenthesis ')'\n" . $herecurr) && 3810 "space prohibited before that close parenthesis ')'\n" . $herecurr) &&
3754 $fix) { 3811 $fix) {
3755 print("fixlinenr: <$fixlinenr> fixed[fixlinenr]: <$fixed[$fixlinenr]>\n");
3756 $fixed[$fixlinenr] =~ 3812 $fixed[$fixlinenr] =~
3757 s/\s+\)/\)/; 3813 s/\s+\)/\)/;
3758 } 3814 }
@@ -3762,9 +3818,27 @@ sub process {
3762# ie: &(foo->bar) should be &foo->bar and *(foo->bar) should be *foo->bar 3818# ie: &(foo->bar) should be &foo->bar and *(foo->bar) should be *foo->bar
3763 3819
3764 while ($line =~ /(?:[^&]&\s*|\*)\(\s*($Ident\s*(?:$Member\s*)+)\s*\)/g) { 3820 while ($line =~ /(?:[^&]&\s*|\*)\(\s*($Ident\s*(?:$Member\s*)+)\s*\)/g) {
3765 CHK("UNNECESSARY_PARENTHESES", 3821 my $var = $1;
3766 "Unnecessary parentheses around $1\n" . $herecurr); 3822 if (CHK("UNNECESSARY_PARENTHESES",
3767 } 3823 "Unnecessary parentheses around $var\n" . $herecurr) &&
3824 $fix) {
3825 $fixed[$fixlinenr] =~ s/\(\s*\Q$var\E\s*\)/$var/;
3826 }
3827 }
3828
3829# check for unnecessary parentheses around function pointer uses
3830# ie: (foo->bar)(); should be foo->bar();
3831# but not "if (foo->bar) (" to avoid some false positives
3832 if ($line =~ /(\bif\s*|)(\(\s*$Ident\s*(?:$Member\s*)+\))[ \t]*\(/ && $1 !~ /^if/) {
3833 my $var = $2;
3834 if (CHK("UNNECESSARY_PARENTHESES",
3835 "Unnecessary parentheses around function pointer $var\n" . $herecurr) &&
3836 $fix) {
3837 my $var2 = deparenthesize($var);
3838 $var2 =~ s/\s//g;
3839 $fixed[$fixlinenr] =~ s/\Q$var\E/$var2/;
3840 }
3841 }
3768 3842
3769#goto labels aren't indented, allow a single space however 3843#goto labels aren't indented, allow a single space however
3770 if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and 3844 if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and
@@ -4004,7 +4078,9 @@ sub process {
4004#Ignore Page<foo> variants 4078#Ignore Page<foo> variants
4005 $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ && 4079 $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
4006#Ignore SI style variants like nS, mV and dB (ie: max_uV, regulator_min_uA_show) 4080#Ignore SI style variants like nS, mV and dB (ie: max_uV, regulator_min_uA_show)
4007 $var !~ /^(?:[a-z_]*?)_?[a-z][A-Z](?:_[a-z_]+)?$/) { 4081 $var !~ /^(?:[a-z_]*?)_?[a-z][A-Z](?:_[a-z_]+)?$/ &&
4082#Ignore some three character SI units explicitly, like MiB and KHz
4083 $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) {
4008 while ($var =~ m{($Ident)}g) { 4084 while ($var =~ m{($Ident)}g) {
4009 my $word = $1; 4085 my $word = $1;
4010 next if ($word !~ /[A-Z][a-z]|[a-z][A-Z]/); 4086 next if ($word !~ /[A-Z][a-z]|[a-z][A-Z]/);
@@ -4060,12 +4136,17 @@ sub process {
4060 my $cnt = $realcnt; 4136 my $cnt = $realcnt;
4061 my ($off, $dstat, $dcond, $rest); 4137 my ($off, $dstat, $dcond, $rest);
4062 my $ctx = ''; 4138 my $ctx = '';
4139 my $has_flow_statement = 0;
4140 my $has_arg_concat = 0;
4063 ($dstat, $dcond, $ln, $cnt, $off) = 4141 ($dstat, $dcond, $ln, $cnt, $off) =
4064 ctx_statement_block($linenr, $realcnt, 0); 4142 ctx_statement_block($linenr, $realcnt, 0);
4065 $ctx = $dstat; 4143 $ctx = $dstat;
4066 #print "dstat<$dstat> dcond<$dcond> cnt<$cnt> off<$off>\n"; 4144 #print "dstat<$dstat> dcond<$dcond> cnt<$cnt> off<$off>\n";
4067 #print "LINE<$lines[$ln-1]> len<" . length($lines[$ln-1]) . "\n"; 4145 #print "LINE<$lines[$ln-1]> len<" . length($lines[$ln-1]) . "\n";
4068 4146
4147 $has_flow_statement = 1 if ($ctx =~ /\b(goto|return)\b/);
4148 $has_arg_concat = 1 if ($ctx =~ /\#\#/);
4149
4069 $dstat =~ s/^.\s*\#\s*define\s+$Ident(?:\([^\)]*\))?\s*//; 4150 $dstat =~ s/^.\s*\#\s*define\s+$Ident(?:\([^\)]*\))?\s*//;
4070 $dstat =~ s/$;//g; 4151 $dstat =~ s/$;//g;
4071 $dstat =~ s/\\\n.//g; 4152 $dstat =~ s/\\\n.//g;
@@ -4126,8 +4207,21 @@ sub process {
4126 "Macros with multiple statements should be enclosed in a do - while loop\n" . "$herectx"); 4207 "Macros with multiple statements should be enclosed in a do - while loop\n" . "$herectx");
4127 } else { 4208 } else {
4128 ERROR("COMPLEX_MACRO", 4209 ERROR("COMPLEX_MACRO",
4129 "Macros with complex values should be enclosed in parenthesis\n" . "$herectx"); 4210 "Macros with complex values should be enclosed in parentheses\n" . "$herectx");
4211 }
4212 }
4213
4214# check for macros with flow control, but without ## concatenation
4215# ## concatenation is commonly a macro that defines a function so ignore those
4216 if ($has_flow_statement && !$has_arg_concat) {
4217 my $herectx = $here . "\n";
4218 my $cnt = statement_rawlines($ctx);
4219
4220 for (my $n = 0; $n < $cnt; $n++) {
4221 $herectx .= raw_line($linenr, $n) . "\n";
4130 } 4222 }
4223 WARN("MACRO_WITH_FLOW_CONTROL",
4224 "Macros with flow control statements should be avoided\n" . "$herectx");
4131 } 4225 }
4132 4226
4133# check for line continuations outside of #defines, preprocessor #, and asm 4227# check for line continuations outside of #defines, preprocessor #, and asm
@@ -4338,6 +4432,85 @@ sub process {
4338 "Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr); 4432 "Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr);
4339 } 4433 }
4340 4434
4435# Check for user-visible strings broken across lines, which breaks the ability
4436# to grep for the string. Make exceptions when the previous string ends in a
4437# newline (multiple lines in one string constant) or '\t', '\r', ';', or '{'
4438# (common in inline assembly) or is a octal \123 or hexadecimal \xaf value
4439 if ($line =~ /^\+\s*"[X\t]*"/ &&
4440 $prevline =~ /"\s*$/ &&
4441 $prevrawline !~ /(?:\\(?:[ntr]|[0-7]{1,3}|x[0-9a-fA-F]{1,2})|;\s*|\{\s*)"\s*$/) {
4442 if (WARN("SPLIT_STRING",
4443 "quoted string split across lines\n" . $hereprev) &&
4444 $fix &&
4445 $prevrawline =~ /^\+.*"\s*$/ &&
4446 $last_coalesced_string_linenr != $linenr - 1) {
4447 my $extracted_string = get_quoted_string($line, $rawline);
4448 my $comma_close = "";
4449 if ($rawline =~ /\Q$extracted_string\E(\s*\)\s*;\s*$|\s*,\s*)/) {
4450 $comma_close = $1;
4451 }
4452
4453 fix_delete_line($fixlinenr - 1, $prevrawline);
4454 fix_delete_line($fixlinenr, $rawline);
4455 my $fixedline = $prevrawline;
4456 $fixedline =~ s/"\s*$//;
4457 $fixedline .= substr($extracted_string, 1) . trim($comma_close);
4458 fix_insert_line($fixlinenr - 1, $fixedline);
4459 $fixedline = $rawline;
4460 $fixedline =~ s/\Q$extracted_string\E\Q$comma_close\E//;
4461 if ($fixedline !~ /\+\s*$/) {
4462 fix_insert_line($fixlinenr, $fixedline);
4463 }
4464 $last_coalesced_string_linenr = $linenr;
4465 }
4466 }
4467
4468# check for missing a space in a string concatenation
4469 if ($prevrawline =~ /[^\\]\w"$/ && $rawline =~ /^\+[\t ]+"\w/) {
4470 WARN('MISSING_SPACE',
4471 "break quoted strings at a space character\n" . $hereprev);
4472 }
4473
4474# check for spaces before a quoted newline
4475 if ($rawline =~ /^.*\".*\s\\n/) {
4476 if (WARN("QUOTED_WHITESPACE_BEFORE_NEWLINE",
4477 "unnecessary whitespace before a quoted newline\n" . $herecurr) &&
4478 $fix) {
4479 $fixed[$fixlinenr] =~ s/^(\+.*\".*)\s+\\n/$1\\n/;
4480 }
4481
4482 }
4483
4484# concatenated string without spaces between elements
4485 if ($line =~ /"X+"[A-Z_]+/ || $line =~ /[A-Z_]+"X+"/) {
4486 CHK("CONCATENATED_STRING",
4487 "Concatenated strings should use spaces between elements\n" . $herecurr);
4488 }
4489
4490# uncoalesced string fragments
4491 if ($line =~ /"X*"\s*"/) {
4492 WARN("STRING_FRAGMENTS",
4493 "Consecutive strings are generally better as a single string\n" . $herecurr);
4494 }
4495
4496# check for %L{u,d,i} in strings
4497 my $string;
4498 while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) {
4499 $string = substr($rawline, $-[1], $+[1] - $-[1]);
4500 $string =~ s/%%/__/g;
4501 if ($string =~ /(?<!%)%L[udi]/) {
4502 WARN("PRINTF_L",
4503 "\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr);
4504 last;
4505 }
4506 }
4507
4508# check for line continuations in quoted strings with odd counts of "
4509 if ($rawline =~ /\\$/ && $rawline =~ tr/"/"/ % 2) {
4510 WARN("LINE_CONTINUATIONS",
4511 "Avoid line continuations in quoted strings\n" . $herecurr);
4512 }
4513
4341# warn about #if 0 4514# warn about #if 0
4342 if ($line =~ /^.\s*\#\s*if\s+0\b/) { 4515 if ($line =~ /^.\s*\#\s*if\s+0\b/) {
4343 CHK("REDUNDANT_CODE", 4516 CHK("REDUNDANT_CODE",
@@ -4350,7 +4523,7 @@ sub process {
4350 my $expr = '\s*\(\s*' . quotemeta($1) . '\s*\)\s*;'; 4523 my $expr = '\s*\(\s*' . quotemeta($1) . '\s*\)\s*;';
4351 if ($line =~ /\b(kfree|usb_free_urb|debugfs_remove(?:_recursive)?)$expr/) { 4524 if ($line =~ /\b(kfree|usb_free_urb|debugfs_remove(?:_recursive)?)$expr/) {
4352 WARN('NEEDLESS_IF', 4525 WARN('NEEDLESS_IF',
4353 "$1(NULL) is safe this check is probably not required\n" . $hereprev); 4526 "$1(NULL) is safe and this check is probably not required\n" . $hereprev);
4354 } 4527 }
4355 } 4528 }
4356 4529
@@ -4371,6 +4544,39 @@ sub process {
4371 } 4544 }
4372 } 4545 }
4373 4546
4547# check for logging functions with KERN_<LEVEL>
4548 if ($line !~ /printk\s*\(/ &&
4549 $line =~ /\b$logFunctions\s*\(.*\b(KERN_[A-Z]+)\b/) {
4550 my $level = $1;
4551 if (WARN("UNNECESSARY_KERN_LEVEL",
4552 "Possible unnecessary $level\n" . $herecurr) &&
4553 $fix) {
4554 $fixed[$fixlinenr] =~ s/\s*$level\s*//;
4555 }
4556 }
4557
4558# check for mask then right shift without a parentheses
4559 if ($^V && $^V ge 5.10.0 &&
4560 $line =~ /$LvalOrFunc\s*\&\s*($LvalOrFunc)\s*>>/ &&
4561 $4 !~ /^\&/) { # $LvalOrFunc may be &foo, ignore if so
4562 WARN("MASK_THEN_SHIFT",
4563 "Possible precedence defect with mask then right shift - may need parentheses\n" . $herecurr);
4564 }
4565
4566# check for pointer comparisons to NULL
4567 if ($^V && $^V ge 5.10.0) {
4568 while ($line =~ /\b$LvalOrFunc\s*(==|\!=)\s*NULL\b/g) {
4569 my $val = $1;
4570 my $equal = "!";
4571 $equal = "" if ($4 eq "!=");
4572 if (CHK("COMPARISON_TO_NULL",
4573 "Comparison to NULL could be written \"${equal}${val}\"\n" . $herecurr) &&
4574 $fix) {
4575 $fixed[$fixlinenr] =~ s/\b\Q$val\E\s*(?:==|\!=)\s*NULL\b/$equal$val/;
4576 }
4577 }
4578 }
4579
4374# check for bad placement of section $InitAttribute (e.g.: __initdata) 4580# check for bad placement of section $InitAttribute (e.g.: __initdata)
4375 if ($line =~ /(\b$InitAttribute\b)/) { 4581 if ($line =~ /(\b$InitAttribute\b)/) {
4376 my $attr = $1; 4582 my $attr = $1;
@@ -4565,6 +4771,15 @@ sub process {
4565 } 4771 }
4566 } 4772 }
4567 4773
4774# Check for __attribute__ weak, or __weak declarations (may have link issues)
4775 if ($^V && $^V ge 5.10.0 &&
4776 $line =~ /(?:$Declare|$DeclareMisordered)\s*$Ident\s*$balanced_parens\s*(?:$Attribute)?\s*;/ &&
4777 ($line =~ /\b__attribute__\s*\(\s*\(.*\bweak\b/ ||
4778 $line =~ /\b__weak\b/)) {
4779 ERROR("WEAK_DECLARATION",
4780 "Using weak declarations can have unintended link defects\n" . $herecurr);
4781 }
4782
4568# check for sizeof(&) 4783# check for sizeof(&)
4569 if ($line =~ /\bsizeof\s*\(\s*\&/) { 4784 if ($line =~ /\bsizeof\s*\(\s*\&/) {
4570 WARN("SIZEOF_ADDRESS", 4785 WARN("SIZEOF_ADDRESS",
@@ -4580,12 +4795,6 @@ sub process {
4580 } 4795 }
4581 } 4796 }
4582 4797
4583# check for line continuations in quoted strings with odd counts of "
4584 if ($rawline =~ /\\$/ && $rawline =~ tr/"/"/ % 2) {
4585 WARN("LINE_CONTINUATIONS",
4586 "Avoid line continuations in quoted strings\n" . $herecurr);
4587 }
4588
4589# check for struct spinlock declarations 4798# check for struct spinlock declarations
4590 if ($line =~ /^.\s*\bstruct\s+spinlock\s+\w+\s*;/) { 4799 if ($line =~ /^.\s*\bstruct\s+spinlock\s+\w+\s*;/) {
4591 WARN("USE_SPINLOCK_T", 4800 WARN("USE_SPINLOCK_T",
@@ -4821,6 +5030,17 @@ sub process {
4821 } 5030 }
4822 } 5031 }
4823 5032
5033# check for #defines like: 1 << <digit> that could be BIT(digit)
5034 if ($line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) {
5035 my $ull = "";
5036 $ull = "_ULL" if (defined($1) && $1 =~ /ll/i);
5037 if (CHK("BIT_MACRO",
5038 "Prefer using the BIT$ull macro\n" . $herecurr) &&
5039 $fix) {
5040 $fixed[$fixlinenr] =~ s/\(?\s*1\s*[ulUL]*\s*<<\s*(\d+|$Ident)\s*\)?/BIT${ull}($1)/;
5041 }
5042 }
5043
4824# check for case / default statements not preceded by break/fallthrough/switch 5044# check for case / default statements not preceded by break/fallthrough/switch
4825 if ($line =~ /^.\s*(?:case\s+(?:$Ident|$Constant)\s*|default):/) { 5045 if ($line =~ /^.\s*(?:case\s+(?:$Ident|$Constant)\s*|default):/) {
4826 my $has_break = 0; 5046 my $has_break = 0;
@@ -4984,18 +5204,6 @@ sub process {
4984 "#define of '$1' is wrong - use Kconfig variables or standard guards instead\n" . $herecurr); 5204 "#define of '$1' is wrong - use Kconfig variables or standard guards instead\n" . $herecurr);
4985 } 5205 }
4986 5206
4987# check for %L{u,d,i} in strings
4988 my $string;
4989 while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) {
4990 $string = substr($rawline, $-[1], $+[1] - $-[1]);
4991 $string =~ s/%%/__/g;
4992 if ($string =~ /(?<!%)%L[udi]/) {
4993 WARN("PRINTF_L",
4994 "\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr);
4995 last;
4996 }
4997 }
4998
4999# whine mightly about in_atomic 5207# whine mightly about in_atomic
5000 if ($line =~ /\bin_atomic\s*\(/) { 5208 if ($line =~ /\bin_atomic\s*\(/) {
5001 if ($realfile =~ m@^drivers/@) { 5209 if ($realfile =~ m@^drivers/@) {
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index 899b4230320e..dd8397894d5c 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -13,7 +13,7 @@
13# Random bits by Matt Mackall <mpm@selenic.com> 13# Random bits by Matt Mackall <mpm@selenic.com>
14# M68k port by Geert Uytterhoeven and Andreas Schwab 14# M68k port by Geert Uytterhoeven and Andreas Schwab
15# AVR32 port by Haavard Skinnemoen (Atmel) 15# AVR32 port by Haavard Skinnemoen (Atmel)
16# PARISC port by Kyle McMartin <kyle@parisc-linux.org> 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# 18#
19# Usage: 19# Usage:
@@ -45,7 +45,10 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
45 $x = "[0-9a-f]"; # hex character 45 $x = "[0-9a-f]"; # hex character
46 $xs = "[0-9a-f ]"; # hex character or space 46 $xs = "[0-9a-f ]"; # hex character or space
47 $funcre = qr/^$x* <(.*)>:$/; 47 $funcre = qr/^$x* <(.*)>:$/;
48 if ($arch eq 'arm') { 48 if ($arch eq 'aarch64') {
49 #ffffffc0006325cc: a9bb7bfd stp x29, x30, [sp,#-80]!
50 $re = qr/^.*stp.*sp,\#-([0-9]{1,8})\]\!/o;
51 } elsif ($arch eq 'arm') {
49 #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64 52 #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64
50 $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o; 53 $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o;
51 } elsif ($arch eq 'avr32') { 54 } elsif ($arch eq 'avr32') {
diff --git a/scripts/coccinelle/api/platform_no_drv_owner.cocci b/scripts/coccinelle/api/platform_no_drv_owner.cocci
new file mode 100644
index 000000000000..e065b9e714fc
--- /dev/null
+++ b/scripts/coccinelle/api/platform_no_drv_owner.cocci
@@ -0,0 +1,106 @@
1/// Remove .owner field if calls are used which set it automatically
2///
3// Confidence: High
4// Copyright: (C) 2014 Wolfram Sang. GPL v2.
5
6virtual patch
7virtual context
8virtual org
9virtual report
10
11@match1@
12declarer name module_platform_driver;
13declarer name module_platform_driver_probe;
14identifier __driver;
15@@
16(
17 module_platform_driver(__driver);
18|
19 module_platform_driver_probe(__driver, ...);
20)
21
22@fix1 depends on match1 && patch && !context && !org && !report@
23identifier match1.__driver;
24@@
25 static struct platform_driver __driver = {
26 .driver = {
27- .owner = THIS_MODULE,
28 }
29 };
30
31@match2@
32identifier __driver;
33@@
34(
35 platform_driver_register(&__driver)
36|
37 platform_driver_probe(&__driver, ...)
38|
39 platform_create_bundle(&__driver, ...)
40)
41
42@fix2 depends on match2 && patch && !context && !org && !report@
43identifier match2.__driver;
44@@
45 static struct platform_driver __driver = {
46 .driver = {
47- .owner = THIS_MODULE,
48 }
49 };
50
51// ----------------------------------------------------------------------------
52
53@fix1_context depends on match1 && !patch && (context || org || report)@
54identifier match1.__driver;
55position j0;
56@@
57
58 static struct platform_driver __driver = {
59 .driver = {
60* .owner@j0 = THIS_MODULE,
61 }
62 };
63
64@fix2_context depends on match2 && !patch && (context || org || report)@
65identifier match2.__driver;
66position j0;
67@@
68
69 static struct platform_driver __driver = {
70 .driver = {
71* .owner@j0 = THIS_MODULE,
72 }
73 };
74
75// ----------------------------------------------------------------------------
76
77@script:python fix1_org depends on org@
78j0 << fix1_context.j0;
79@@
80
81msg = "No need to set .owner here. The core will do it."
82coccilib.org.print_todo(j0[0], msg)
83
84@script:python fix2_org depends on org@
85j0 << fix2_context.j0;
86@@
87
88msg = "No need to set .owner here. The core will do it."
89coccilib.org.print_todo(j0[0], msg)
90
91// ----------------------------------------------------------------------------
92
93@script:python fix1_report depends on report@
94j0 << fix1_context.j0;
95@@
96
97msg = "No need to set .owner here. The core will do it."
98coccilib.report.print_report(j0[0], msg)
99
100@script:python fix2_report depends on report@
101j0 << fix2_context.j0;
102@@
103
104msg = "No need to set .owner here. The core will do it."
105coccilib.report.print_report(j0[0], msg)
106
diff --git a/scripts/coccinelle/misc/bugon.cocci b/scripts/coccinelle/misc/bugon.cocci
index 556456ca761c..3b7eec24fb5a 100644
--- a/scripts/coccinelle/misc/bugon.cocci
+++ b/scripts/coccinelle/misc/bugon.cocci
@@ -8,7 +8,7 @@
8// Confidence: High 8// Confidence: High
9// Copyright: (C) 2014 Himangi Saraogi. GPLv2. 9// Copyright: (C) 2014 Himangi Saraogi. GPLv2.
10// Comments: 10// Comments:
11// Options: --no-includes, --include-headers 11// Options: --no-includes --include-headers
12 12
13virtual patch 13virtual patch
14virtual context 14virtual context
diff --git a/scripts/coccinelle/misc/simple_return.cocci b/scripts/coccinelle/misc/simple_return.cocci
new file mode 100644
index 000000000000..47f7084b6360
--- /dev/null
+++ b/scripts/coccinelle/misc/simple_return.cocci
@@ -0,0 +1,180 @@
1/// Simplify a trivial if-return sequence. Possibly combine with a
2/// preceding function call.
3//
4// Confidence: High
5// Copyright: (C) 2014 Julia Lawall, INRIA/LIP6. GPLv2.
6// Copyright: (C) 2014 Gilles Muller, INRIA/LiP6. GPLv2.
7// URL: http://coccinelle.lip6.fr/
8// Comments:
9// Options: --no-includes --include-headers
10
11virtual patch
12virtual context
13virtual org
14virtual report
15
16@r depends on patch@
17local idexpression e;
18identifier i,f,fn;
19@@
20
21fn(...) { <...
22- e@i =
23+ return
24 f(...);
25-if (i != 0) return i;
26-return 0;
27...> }
28
29@depends on patch@
30identifier r.i;
31type t;
32@@
33
34-t i;
35 ... when != i
36
37@depends on patch@
38expression e;
39@@
40
41-if (e != 0)
42 return e;
43-return 0;
44
45// -----------------------------------------------------------------------
46
47@s1 depends on context || org || report@
48local idexpression e;
49identifier i,f,fn;
50position p,p1,p2;
51@@
52
53fn(...) { <...
54* e@i@p = f(...);
55 if (\(i@p1 != 0\|i@p2 < 0\))
56 return i;
57 return 0;
58...> }
59
60@s2 depends on context || org || report forall@
61identifier s1.i;
62type t;
63position q,s1.p;
64expression e,f;
65@@
66
67* t i@q;
68 ... when != i
69 e@p = f(...);
70
71@s3 depends on context || org || report@
72expression e;
73position p1!=s1.p1;
74position p2!=s1.p2;
75@@
76
77*if (\(e@p1 != 0\|e@p2 < 0\))
78 return e;
79 return 0;
80
81// -----------------------------------------------------------------------
82
83@script:python depends on org@
84p << s1.p;
85p1 << s1.p1;
86q << s2.q;
87@@
88
89cocci.print_main("decl",q)
90cocci.print_secs("use",p)
91cocci.include_match(False)
92
93@script:python depends on org@
94p << s1.p;
95p2 << s1.p2;
96q << s2.q;
97@@
98
99cocci.print_main("decl",q)
100cocci.print_secs("use with questionable test",p)
101cocci.include_match(False)
102
103@script:python depends on org@
104p << s1.p;
105p1 << s1.p1;
106@@
107
108cocci.print_main("use",p)
109
110@script:python depends on org@
111p << s1.p;
112p2 << s1.p2;
113@@
114
115cocci.print_main("use with questionable test",p)
116
117@script:python depends on org@
118p << s3.p1;
119@@
120
121cocci.print_main("test",p)
122
123@script:python depends on org@
124p << s3.p2;
125@@
126
127cocci.print_main("questionable test",p)
128
129// -----------------------------------------------------------------------
130
131@script:python depends on report@
132p << s1.p;
133p1 << s1.p1;
134q << s2.q;
135@@
136
137msg = "WARNING: end returns can be simpified and declaration on line %s can be dropped" % (q[0].line)
138coccilib.report.print_report(p[0],msg)
139cocci.include_match(False)
140
141@script:python depends on report@
142p << s1.p;
143p1 << s1.p1;
144q << s2.q
145;
146@@
147
148msg = "WARNING: end returns may be simpified if negative or 0 value and declaration on line %s can be dropped" % (q[0].line)
149coccilib.report.print_report(p[0],msg)
150cocci.include_match(False)
151
152@script:python depends on report@
153p << s1.p;
154p1 << s1.p1;
155@@
156
157msg = "WARNING: end returns can be simpified"
158coccilib.report.print_report(p[0],msg)
159
160@script:python depends on report@
161p << s1.p;
162p2 << s1.p2;
163@@
164
165msg = "WARNING: end returns can be simpified if negative or 0 value"
166coccilib.report.print_report(p[0],msg)
167
168@script:python depends on report@
169p << s3.p1;
170@@
171
172msg = "WARNING: end returns can be simpified"
173coccilib.report.print_report(p[0],msg)
174
175@script:python depends on report@
176p << s3.p2;
177@@
178
179msg = "WARNING: end returns can be simpified if tested value is negative or 0"
180coccilib.report.print_report(p[0],msg)
diff --git a/scripts/export_report.pl b/scripts/export_report.pl
index 8f79b701de87..8f79b701de87 100644..100755
--- a/scripts/export_report.pl
+++ b/scripts/export_report.pl
diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh
index c9469d34ecc6..c9469d34ecc6 100644..100755
--- a/scripts/gcc-goto.sh
+++ b/scripts/gcc-goto.sh
diff --git a/scripts/gcc-ld b/scripts/gcc-ld
index cadab9a13ed7..cadab9a13ed7 100644..100755
--- a/scripts/gcc-ld
+++ b/scripts/gcc-ld
diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh
index 7f2126df91f2..7f2126df91f2 100644..100755
--- a/scripts/gcc-version.sh
+++ b/scripts/gcc-version.sh
diff --git a/scripts/gcc-x86_32-has-stack-protector.sh b/scripts/gcc-x86_32-has-stack-protector.sh
index 12dbd0b11ea4..12dbd0b11ea4 100644..100755
--- a/scripts/gcc-x86_32-has-stack-protector.sh
+++ b/scripts/gcc-x86_32-has-stack-protector.sh
diff --git a/scripts/gcc-x86_64-has-stack-protector.sh b/scripts/gcc-x86_64-has-stack-protector.sh
index 973e8c141567..973e8c141567 100644..100755
--- a/scripts/gcc-x86_64-has-stack-protector.sh
+++ b/scripts/gcc-x86_64-has-stack-protector.sh
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 17fa901418ae..17fa901418ae 100644..100755
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
diff --git a/scripts/headers.sh b/scripts/headers.sh
index 95ece06599a5..d4dc4de5cea1 100755
--- a/scripts/headers.sh
+++ b/scripts/headers.sh
@@ -19,8 +19,6 @@ for arch in ${archs}; do
19 case ${arch} in 19 case ${arch} in
20 um) # no userspace export 20 um) # no userspace export
21 ;; 21 ;;
22 cris) # headers export are known broken
23 ;;
24 *) 22 *)
25 if [ -d ${srctree}/arch/${arch} ]; then 23 if [ -d ${srctree}/arch/${arch} ]; then
26 do_command $1 ${arch} 24 do_command $1 ${arch}
diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
index 62320f93e903..62320f93e903 100644..100755
--- a/scripts/headers_check.pl
+++ b/scripts/headers_check.pl
diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh
index 5de5660cb708..fdebd66f8fc1 100644..100755
--- a/scripts/headers_install.sh
+++ b/scripts/headers_install.sh
@@ -1,8 +1,8 @@
1#!/bin/sh 1#!/bin/sh
2 2
3if [ $# -lt 1 ] 3if [ $# -lt 2 ]
4then 4then
5 echo "Usage: headers_install.sh OUTDIR SRCDIR [FILES...] 5 echo "Usage: headers_install.sh OUTDIR SRCDIR [FILES...]"
6 echo 6 echo
7 echo "Prepares kernel header files for use by user space, by removing" 7 echo "Prepares kernel header files for use by user space, by removing"
8 echo "all compiler.h definitions and #includes, removing any" 8 echo "all compiler.h definitions and #includes, removing any"
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index dc7aa45e80ce..c6d33bd15b04 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -84,7 +84,7 @@ static void usage(void)
84 */ 84 */
85static inline int is_arm_mapping_symbol(const char *str) 85static inline int is_arm_mapping_symbol(const char *str)
86{ 86{
87 return str[0] == '$' && strchr("atd", str[1]) 87 return str[0] == '$' && strchr("axtd", str[1])
88 && (str[2] == '\0' || str[2] == '.'); 88 && (str[2] == '\0' || str[2] == '.');
89} 89}
90 90
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 9c4d2412fb72..9645c0739386 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -104,6 +104,23 @@ endif
104%_defconfig: $(obj)/conf 104%_defconfig: $(obj)/conf
105 $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) 105 $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
106 106
107configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config)
108
109define mergeconfig
110$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
111$(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture))
112$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1))
113$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
114endef
115
116PHONY += kvmconfig
117kvmconfig:
118 $(call mergeconfig,kvm_guest)
119
120PHONY += tinyconfig
121tinyconfig: allnoconfig
122 $(call mergeconfig,tiny)
123
107# Help text used by make help 124# Help text used by make help
108help: 125help:
109 @echo ' config - Update current config utilising a line-oriented program' 126 @echo ' config - Update current config utilising a line-oriented program'
@@ -124,6 +141,8 @@ help:
124 @echo ' randconfig - New config with random answer to all options' 141 @echo ' randconfig - New config with random answer to all options'
125 @echo ' listnewconfig - List new options' 142 @echo ' listnewconfig - List new options'
126 @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value' 143 @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value'
144 @echo ' kvmconfig - Enable additional options for guest kernel support'
145 @echo ' tinyconfig - Configure the tiniest possible kernel'
127 146
128# lxdialog stuff 147# lxdialog stuff
129check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh 148check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
@@ -157,39 +176,10 @@ qconf-cxxobjs := qconf.o
157qconf-objs := zconf.tab.o 176qconf-objs := zconf.tab.o
158gconf-objs := gconf.o zconf.tab.o 177gconf-objs := gconf.o zconf.tab.o
159 178
160hostprogs-y := conf 179hostprogs-y := conf nconf mconf kxgettext qconf gconf
161
162ifeq ($(MAKECMDGOALS),nconfig)
163 hostprogs-y += nconf
164endif
165
166ifeq ($(MAKECMDGOALS),menuconfig)
167 hostprogs-y += mconf
168endif
169
170ifeq ($(MAKECMDGOALS),update-po-config)
171 hostprogs-y += kxgettext
172endif
173
174ifeq ($(MAKECMDGOALS),xconfig)
175 qconf-target := 1
176endif
177ifeq ($(MAKECMDGOALS),gconfig)
178 gconf-target := 1
179endif
180
181
182ifeq ($(qconf-target),1)
183 hostprogs-y += qconf
184endif
185
186ifeq ($(gconf-target),1)
187 hostprogs-y += gconf
188endif
189 180
190clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck 181clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck
191clean-files += zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h 182clean-files += zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h
192clean-files += mconf qconf gconf nconf
193clean-files += config.pot linux.pot 183clean-files += config.pot linux.pot
194 184
195# Check that we have the required ncurses stuff installed for lxdialog (menuconfig) 185# Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
@@ -220,11 +210,12 @@ HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
220HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) 210HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
221 211
222HOSTLOADLIBES_nconf = $(shell \ 212HOSTLOADLIBES_nconf = $(shell \
223 pkg-config --libs menu panel ncurses 2>/dev/null \ 213 pkg-config --libs menuw panelw ncursesw 2>/dev/null \
214 || pkg-config --libs menu panel ncurses 2>/dev/null \
224 || echo "-lmenu -lpanel -lncurses" ) 215 || echo "-lmenu -lpanel -lncurses" )
225$(obj)/qconf.o: $(obj)/.tmp_qtcheck 216$(obj)/qconf.o: $(obj)/.tmp_qtcheck
226 217
227ifeq ($(qconf-target),1) 218ifeq ($(MAKECMDGOALS),xconfig)
228$(obj)/.tmp_qtcheck: $(src)/Makefile 219$(obj)/.tmp_qtcheck: $(src)/Makefile
229-include $(obj)/.tmp_qtcheck 220-include $(obj)/.tmp_qtcheck
230 221
@@ -281,7 +272,7 @@ endif
281 272
282$(obj)/gconf.o: $(obj)/.tmp_gtkcheck 273$(obj)/gconf.o: $(obj)/.tmp_gtkcheck
283 274
284ifeq ($(gconf-target),1) 275ifeq ($(MAKECMDGOALS),gconfig)
285-include $(obj)/.tmp_gtkcheck 276-include $(obj)/.tmp_gtkcheck
286 277
287# GTK needs some extra effort, too... 278# GTK needs some extra effort, too...
diff --git a/scripts/kconfig/list.h b/scripts/kconfig/list.h
index 685d80e1bb0e..2cf23f002d3f 100644
--- a/scripts/kconfig/list.h
+++ b/scripts/kconfig/list.h
@@ -34,7 +34,7 @@ struct list_head {
34 * list_entry - get the struct for this entry 34 * list_entry - get the struct for this entry
35 * @ptr: the &struct list_head pointer. 35 * @ptr: the &struct list_head pointer.
36 * @type: the type of the struct this is embedded in. 36 * @type: the type of the struct this is embedded in.
37 * @member: the name of the list_struct within the struct. 37 * @member: the name of the list_head within the struct.
38 */ 38 */
39#define list_entry(ptr, type, member) \ 39#define list_entry(ptr, type, member) \
40 container_of(ptr, type, member) 40 container_of(ptr, type, member)
@@ -43,7 +43,7 @@ struct list_head {
43 * list_for_each_entry - iterate over list of given type 43 * list_for_each_entry - iterate over list of given type
44 * @pos: the type * to use as a loop cursor. 44 * @pos: the type * to use as a loop cursor.
45 * @head: the head for your list. 45 * @head: the head for your list.
46 * @member: the name of the list_struct within the struct. 46 * @member: the name of the list_head within the struct.
47 */ 47 */
48#define list_for_each_entry(pos, head, member) \ 48#define list_for_each_entry(pos, head, member) \
49 for (pos = list_entry((head)->next, typeof(*pos), member); \ 49 for (pos = list_entry((head)->next, typeof(*pos), member); \
@@ -55,7 +55,7 @@ struct list_head {
55 * @pos: the type * to use as a loop cursor. 55 * @pos: the type * to use as a loop cursor.
56 * @n: another type * to use as temporary storage 56 * @n: another type * to use as temporary storage
57 * @head: the head for your list. 57 * @head: the head for your list.
58 * @member: the name of the list_struct within the struct. 58 * @member: the name of the list_head within the struct.
59 */ 59 */
60#define list_for_each_entry_safe(pos, n, head, member) \ 60#define list_for_each_entry_safe(pos, n, head, member) \
61 for (pos = list_entry((head)->next, typeof(*pos), member), \ 61 for (pos = list_entry((head)->next, typeof(*pos), member), \
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 9d2a4c585ee1..5075ebf2d3b9 100644..100755
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -21,7 +21,11 @@ ldflags()
21# Where is ncurses.h? 21# Where is ncurses.h?
22ccflags() 22ccflags()
23{ 23{
24 if [ -f /usr/include/ncursesw/curses.h ]; then 24 if pkg-config --cflags ncursesw 2>/dev/null; then
25 echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1'
26 elif pkg-config --cflags ncurses 2>/dev/null; then
27 echo '-DCURSES_LOC="<ncurses.h>"'
28 elif [ -f /usr/include/ncursesw/curses.h ]; then
25 echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"' 29 echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
26 echo ' -DNCURSES_WIDECHAR=1' 30 echo ' -DNCURSES_WIDECHAR=1'
27 elif [ -f /usr/include/ncurses/ncurses.h ]; then 31 elif [ -f /usr/include/ncurses/ncurses.h ]; then
diff --git a/scripts/kconfig/lxdialog/dialog.h b/scripts/kconfig/lxdialog/dialog.h
index b4343d384926..fcffd5b41fb0 100644
--- a/scripts/kconfig/lxdialog/dialog.h
+++ b/scripts/kconfig/lxdialog/dialog.h
@@ -170,7 +170,7 @@ char item_tag(void);
170/* item list manipulation for lxdialog use */ 170/* item list manipulation for lxdialog use */
171#define MAXITEMSTR 200 171#define MAXITEMSTR 200
172struct dialog_item { 172struct dialog_item {
173 char str[MAXITEMSTR]; /* promtp displayed */ 173 char str[MAXITEMSTR]; /* prompt displayed */
174 char tag; 174 char tag;
175 void *data; /* pointer to menu item - used by menubox+checklist */ 175 void *data; /* pointer to menu item - used by menubox+checklist */
176 int selected; /* Set to 1 by dialog_*() function if selected. */ 176 int selected; /* Set to 1 by dialog_*() function if selected. */
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 14cea7463a62..4dd37552abc2 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -330,10 +330,10 @@ static void set_subtitle(void)
330 list_for_each_entry(sp, &trail, entries) { 330 list_for_each_entry(sp, &trail, entries) {
331 if (sp->text) { 331 if (sp->text) {
332 if (pos) { 332 if (pos) {
333 pos->next = xcalloc(sizeof(*pos), 1); 333 pos->next = xcalloc(1, sizeof(*pos));
334 pos = pos->next; 334 pos = pos->next;
335 } else { 335 } else {
336 subtitles = pos = xcalloc(sizeof(*pos), 1); 336 subtitles = pos = xcalloc(1, sizeof(*pos));
337 } 337 }
338 pos->text = sp->text; 338 pos->text = sp->text;
339 } 339 }
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index a26cc5d2a9b0..72c9dba84c5d 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -548,7 +548,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
548{ 548{
549 int i, j; 549 int i, j;
550 struct menu *submenu[8], *menu, *location = NULL; 550 struct menu *submenu[8], *menu, *location = NULL;
551 struct jump_key *jump; 551 struct jump_key *jump = NULL;
552 552
553 str_printf(r, _("Prompt: %s\n"), _(prop->text)); 553 str_printf(r, _("Prompt: %s\n"), _(prop->text));
554 menu = prop->menu->parent; 554 menu = prop->menu->parent;
@@ -586,7 +586,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
586 str_printf(r, _(" Location:\n")); 586 str_printf(r, _(" Location:\n"));
587 for (j = 4; --i >= 0; j += 2) { 587 for (j = 4; --i >= 0; j += 2) {
588 menu = submenu[i]; 588 menu = submenu[i];
589 if (head && location && menu == location) 589 if (jump && menu == location)
590 jump->offset = strlen(r->s); 590 jump->offset = strlen(r->s);
591 str_printf(r, "%*c-> %s", j, ' ', 591 str_printf(r, "%*c-> %s", j, ' ',
592 _(menu_get_prompt(menu))); 592 _(menu_get_prompt(menu)));
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 9cb8522d8d22..9cb8522d8d22 100644..100755
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 70bea942b413..9922e66883a5 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1753,7 +1753,7 @@ sub dump_struct($$) {
1753 # strip kmemcheck_bitfield_{begin,end}.*; 1753 # strip kmemcheck_bitfield_{begin,end}.*;
1754 $members =~ s/kmemcheck_bitfield_.*?;//gos; 1754 $members =~ s/kmemcheck_bitfield_.*?;//gos;
1755 # strip attributes 1755 # strip attributes
1756 $members =~ s/__aligned\s*\(.+\)//gos; 1756 $members =~ s/__aligned\s*\([^;]*\)//gos;
1757 1757
1758 create_parameterlist($members, ';', $file); 1758 create_parameterlist($members, ';', $file);
1759 check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested); 1759 check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested);
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 86a4fe75f453..86a4fe75f453 100644..100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl
index c21d16328d3f..c21d16328d3f 100644..100755
--- a/scripts/markup_oops.pl
+++ b/scripts/markup_oops.pl
diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index 84af27bf0f99..84af27bf0f99 100644..100755
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
diff --git a/scripts/mksysmap b/scripts/mksysmap
index 7ada35a0f478..7ada35a0f478 100644..100755
--- a/scripts/mksysmap
+++ b/scripts/mksysmap
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 091d90573b63..d439856f8176 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -24,9 +24,9 @@
24#include "../../include/linux/export.h" 24#include "../../include/linux/export.h"
25 25
26/* Are we using CONFIG_MODVERSIONS? */ 26/* Are we using CONFIG_MODVERSIONS? */
27int modversions = 0; 27static int modversions = 0;
28/* Warn about undefined symbols? (do so if we have vmlinux) */ 28/* Warn about undefined symbols? (do so if we have vmlinux) */
29int have_vmlinux = 0; 29static int have_vmlinux = 0;
30/* Is CONFIG_MODULE_SRCVERSION_ALL set? */ 30/* Is CONFIG_MODULE_SRCVERSION_ALL set? */
31static int all_versions = 0; 31static int all_versions = 0;
32/* If we are modposting external module set to 1 */ 32/* If we are modposting external module set to 1 */
@@ -229,7 +229,7 @@ static struct symbol *find_symbol(const char *name)
229 return NULL; 229 return NULL;
230} 230}
231 231
232static struct { 232static const struct {
233 const char *str; 233 const char *str;
234 enum export export; 234 enum export export;
235} export_list[] = { 235} export_list[] = {
@@ -805,7 +805,7 @@ static int match(const char *sym, const char * const pat[])
805} 805}
806 806
807/* sections that we do not want to do full section mismatch check on */ 807/* sections that we do not want to do full section mismatch check on */
808static const char *section_white_list[] = 808static const char *const section_white_list[] =
809{ 809{
810 ".comment*", 810 ".comment*",
811 ".debug*", 811 ".debug*",
@@ -882,17 +882,18 @@ static void check_section(const char *modname, struct elf_info *elf,
882#define MEM_EXIT_SECTIONS ".memexit.*" 882#define MEM_EXIT_SECTIONS ".memexit.*"
883 883
884/* init data sections */ 884/* init data sections */
885static const char *init_data_sections[] = { ALL_INIT_DATA_SECTIONS, NULL }; 885static const char *const init_data_sections[] =
886 { ALL_INIT_DATA_SECTIONS, NULL };
886 887
887/* all init sections */ 888/* all init sections */
888static const char *init_sections[] = { ALL_INIT_SECTIONS, NULL }; 889static const char *const init_sections[] = { ALL_INIT_SECTIONS, NULL };
889 890
890/* All init and exit sections (code + data) */ 891/* All init and exit sections (code + data) */
891static const char *init_exit_sections[] = 892static const char *const init_exit_sections[] =
892 {ALL_INIT_SECTIONS, ALL_EXIT_SECTIONS, NULL }; 893 {ALL_INIT_SECTIONS, ALL_EXIT_SECTIONS, NULL };
893 894
894/* data section */ 895/* data section */
895static const char *data_sections[] = { DATA_SECTIONS, NULL }; 896static const char *const data_sections[] = { DATA_SECTIONS, NULL };
896 897
897 898
898/* symbols in .data that may refer to init/exit sections */ 899/* symbols in .data that may refer to init/exit sections */
@@ -906,8 +907,8 @@ static const char *data_sections[] = { DATA_SECTIONS, NULL };
906 "*_probe_one", \ 907 "*_probe_one", \
907 "*_console" 908 "*_console"
908 909
909static const char *head_sections[] = { ".head.text*", NULL }; 910static const char *const head_sections[] = { ".head.text*", NULL };
910static const char *linker_symbols[] = 911static const char *const linker_symbols[] =
911 { "__init_begin", "_sinittext", "_einittext", NULL }; 912 { "__init_begin", "_sinittext", "_einittext", NULL };
912 913
913enum mismatch { 914enum mismatch {
@@ -929,7 +930,7 @@ struct sectioncheck {
929 const char *symbol_white_list[20]; 930 const char *symbol_white_list[20];
930}; 931};
931 932
932const struct sectioncheck sectioncheck[] = { 933static const struct sectioncheck sectioncheck[] = {
933/* Do not reference init/exit code/data from 934/* Do not reference init/exit code/data from
934 * normal code and data 935 * normal code and data
935 */ 936 */
@@ -1146,7 +1147,7 @@ static Elf_Sym *find_elf_symbol(struct elf_info *elf, Elf64_Sword addr,
1146 1147
1147static inline int is_arm_mapping_symbol(const char *str) 1148static inline int is_arm_mapping_symbol(const char *str)
1148{ 1149{
1149 return str[0] == '$' && strchr("atd", str[1]) 1150 return str[0] == '$' && strchr("axtd", str[1])
1150 && (str[2] == '\0' || str[2] == '.'); 1151 && (str[2] == '\0' || str[2] == '.');
1151} 1152}
1152 1153
@@ -2211,7 +2212,7 @@ int main(int argc, char **argv)
2211 err = 0; 2212 err = 0;
2212 2213
2213 for (mod = modules; mod; mod = mod->next) { 2214 for (mod = modules; mod; mod = mod->next) {
2214 char fname[strlen(mod->name) + 10]; 2215 char fname[PATH_MAX];
2215 2216
2216 if (mod->skip) 2217 if (mod->skip)
2217 continue; 2218 continue;
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 35d5a5877d04..59726243c2eb 100644..100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -37,7 +37,7 @@ create_package() {
37 s390*) 37 s390*)
38 debarch=s390$(grep -q CONFIG_64BIT=y $KCONFIG_CONFIG && echo x || true) ;; 38 debarch=s390$(grep -q CONFIG_64BIT=y $KCONFIG_CONFIG && echo x || true) ;;
39 ppc*) 39 ppc*)
40 debarch=powerpc ;; 40 debarch=$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo ppc64el || echo powerpc) ;;
41 parisc*) 41 parisc*)
42 debarch=hppa ;; 42 debarch=hppa ;;
43 mips*) 43 mips*)
@@ -64,7 +64,7 @@ create_package() {
64 fi 64 fi
65 65
66 # Create the package 66 # Create the package
67 dpkg-gencontrol -isp $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir" 67 dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir"
68 dpkg --build "$pdir" .. 68 dpkg --build "$pdir" ..
69} 69}
70 70
@@ -152,18 +152,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
152 rmdir "$tmpdir/lib/modules/$version" 152 rmdir "$tmpdir/lib/modules/$version"
153 fi 153 fi
154 if [ -n "$BUILD_DEBUG" ] ; then 154 if [ -n "$BUILD_DEBUG" ] ; then
155 ( 155 for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do
156 cd $tmpdir 156 module=lib/modules/$module
157 for module in $(find lib/modules/ -name *.ko); do 157 mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
158 mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module) 158 # only keep debug symbols in the debug file
159 # only keep debug symbols in the debug file 159 $OBJCOPY --only-keep-debug $tmpdir/$module $dbg_dir/usr/lib/debug/$module
160 $OBJCOPY --only-keep-debug $module $dbg_dir/usr/lib/debug/$module 160 # strip original module from debug symbols
161 # strip original module from debug symbols 161 $OBJCOPY --strip-debug $tmpdir/$module
162 $OBJCOPY --strip-debug $module 162 # then add a link to those
163 # then add a link to those 163 $OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $tmpdir/$module
164 $OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module 164 done
165 done
166 )
167 fi 165 fi
168fi 166fi
169 167
diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index e046bff33589..e046bff33589 100644..100755
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index 13957602f7ca..d9ab94b17de0 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -117,6 +117,7 @@ echo 'mv vmlinux.bz2 $RPM_BUILD_ROOT'"/boot/vmlinux-$KERNELRELEASE.bz2"
117echo 'mv vmlinux.orig vmlinux' 117echo 'mv vmlinux.orig vmlinux'
118echo "%endif" 118echo "%endif"
119 119
120if ! $PREBUILT; then
120echo 'rm -f $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE/{build,source}" 121echo 'rm -f $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE/{build,source}"
121echo "mkdir -p "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE" 122echo "mkdir -p "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE"
122echo "EXCLUDES=\"$RCS_TAR_IGNORE --exclude .tmp_versions --exclude=*vmlinux* --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation --exclude=firmware --exclude .config.old --exclude .missing-syscalls.d\"" 123echo "EXCLUDES=\"$RCS_TAR_IGNORE --exclude .tmp_versions --exclude=*vmlinux* --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation --exclude=firmware --exclude .config.old --exclude .missing-syscalls.d\""
@@ -124,6 +125,7 @@ echo "tar "'$EXCLUDES'" -cf- . | (cd "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNEL
124echo 'cd $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE" 125echo 'cd $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE"
125echo "ln -sf /usr/src/kernels/$KERNELRELEASE build" 126echo "ln -sf /usr/src/kernels/$KERNELRELEASE build"
126echo "ln -sf /usr/src/kernels/$KERNELRELEASE source" 127echo "ln -sf /usr/src/kernels/$KERNELRELEASE source"
128fi
127 129
128echo "" 130echo ""
129echo "%clean" 131echo "%clean"
@@ -151,9 +153,11 @@ echo "%files headers"
151echo '%defattr (-, root, root)' 153echo '%defattr (-, root, root)'
152echo "/usr/include" 154echo "/usr/include"
153echo "" 155echo ""
156if ! $PREBUILT; then
154echo "%files devel" 157echo "%files devel"
155echo '%defattr (-, root, root)' 158echo '%defattr (-, root, root)'
156echo "/usr/src/kernels/$KERNELRELEASE" 159echo "/usr/src/kernels/$KERNELRELEASE"
157echo "/lib/modules/$KERNELRELEASE/build" 160echo "/lib/modules/$KERNELRELEASE/build"
158echo "/lib/modules/$KERNELRELEASE/source" 161echo "/lib/modules/$KERNELRELEASE/source"
159echo "" 162echo ""
163fi
diff --git a/scripts/profile2linkerlist.pl b/scripts/profile2linkerlist.pl
index 6943fa7cc95b..6943fa7cc95b 100644..100755
--- a/scripts/profile2linkerlist.pl
+++ b/scripts/profile2linkerlist.pl
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index 650ecc83d7d7..3d1984e59a30 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -388,10 +388,6 @@ do_file(char const *const fname)
388 "unrecognized ET_REL file: %s\n", fname); 388 "unrecognized ET_REL file: %s\n", fname);
389 fail_file(); 389 fail_file();
390 } 390 }
391 if (w2(ehdr->e_machine) == EM_S390) {
392 reltype = R_390_32;
393 mcount_adjust_32 = -4;
394 }
395 if (w2(ehdr->e_machine) == EM_MIPS) { 391 if (w2(ehdr->e_machine) == EM_MIPS) {
396 reltype = R_MIPS_32; 392 reltype = R_MIPS_32;
397 is_fake_mcount32 = MIPS32_is_fake_mcount; 393 is_fake_mcount32 = MIPS32_is_fake_mcount;
@@ -408,7 +404,7 @@ do_file(char const *const fname)
408 } 404 }
409 if (w2(ghdr->e_machine) == EM_S390) { 405 if (w2(ghdr->e_machine) == EM_S390) {
410 reltype = R_390_64; 406 reltype = R_390_64;
411 mcount_adjust_64 = -8; 407 mcount_adjust_64 = -14;
412 } 408 }
413 if (w2(ghdr->e_machine) == EM_MIPS) { 409 if (w2(ghdr->e_machine) == EM_MIPS) {
414 reltype = R_MIPS_64; 410 reltype = R_MIPS_64;
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 397b6b84e8c5..56ea99a12ab7 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -241,16 +241,9 @@ if ($arch eq "x86_64") {
241 $objcopy .= " -O elf32-i386"; 241 $objcopy .= " -O elf32-i386";
242 $cc .= " -m32"; 242 $cc .= " -m32";
243 243
244} elsif ($arch eq "s390" && $bits == 32) {
245 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$";
246 $mcount_adjust = -4;
247 $alignment = 4;
248 $ld .= " -m elf_s390";
249 $cc .= " -m31";
250
251} elsif ($arch eq "s390" && $bits == 64) { 244} elsif ($arch eq "s390" && $bits == 64) {
252 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$"; 245 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
253 $mcount_adjust = -8; 246 $mcount_adjust = -14;
254 $alignment = 8; 247 $alignment = 8;
255 $type = ".quad"; 248 $type = ".quad";
256 $ld .= " -m elf64_s390"; 249 $ld .= " -m elf64_s390";
diff --git a/scripts/rt-tester/rt-tester.py b/scripts/rt-tester/rt-tester.py
index 6d916c2a45a5..6d916c2a45a5 100644..100755
--- a/scripts/rt-tester/rt-tester.py
+++ b/scripts/rt-tester/rt-tester.py
diff --git a/scripts/selinux/install_policy.sh b/scripts/selinux/install_policy.sh
index f6a0ce71015f..f6a0ce71015f 100644..100755
--- a/scripts/selinux/install_policy.sh
+++ b/scripts/selinux/install_policy.sh
diff --git a/scripts/sign-file b/scripts/sign-file
index 2b7c4484d46c..3906ee1e2f76 100755
--- a/scripts/sign-file
+++ b/scripts/sign-file
@@ -398,7 +398,7 @@ if ($verbose) {
398 print "Size of signer's name : ", length($signers_name), "\n"; 398 print "Size of signer's name : ", length($signers_name), "\n";
399 print "Size of key identifier : ", length($key_identifier), "\n"; 399 print "Size of key identifier : ", length($key_identifier), "\n";
400 print "Size of signature : ", length($signature), "\n"; 400 print "Size of signature : ", length($signature), "\n";
401 print "Size of informaton : ", length($info), "\n"; 401 print "Size of information : ", length($info), "\n";
402 print "Size of magic number : ", length($magic_number), "\n"; 402 print "Size of magic number : ", length($magic_number), "\n";
403 print "Signer's name : '", $signers_name, "'\n"; 403 print "Signer's name : '", $signers_name, "'\n";
404 print "Digest : $dgst\n"; 404 print "Digest : $dgst\n";
diff --git a/scripts/sortextable.h b/scripts/sortextable.h
index 8fac3fd697a6..ba8700428e21 100644
--- a/scripts/sortextable.h
+++ b/scripts/sortextable.h
@@ -103,7 +103,7 @@ do_func(Elf_Ehdr *ehdr, char const *const fname, table_sort_t custom_sort)
103 Elf_Sym *sort_needed_sym; 103 Elf_Sym *sort_needed_sym;
104 Elf_Shdr *sort_needed_sec; 104 Elf_Shdr *sort_needed_sec;
105 Elf_Rel *relocs = NULL; 105 Elf_Rel *relocs = NULL;
106 int relocs_size; 106 int relocs_size = 0;
107 uint32_t *sort_done_location; 107 uint32_t *sort_done_location;
108 const char *secstrtab; 108 const char *secstrtab;
109 const char *strtab; 109 const char *strtab;
diff --git a/scripts/spelling.txt b/scripts/spelling.txt
new file mode 100644
index 000000000000..fc7fd52b5e03
--- /dev/null
+++ b/scripts/spelling.txt
@@ -0,0 +1,1042 @@
1# Originally from Debian's Lintian tool. Various false positives have been
2# removed, and various additions have been made as they've been discovered
3# in the kernel source.
4#
5# License: GPLv2
6#
7# The format of each line is:
8# mistake||correction
9#
10abandonning||abandoning
11abigious||ambiguous
12abitrate||arbitrate
13abov||above
14abreviated||abbreviated
15absense||absence
16absolut||absolute
17absoulte||absolute
18acccess||access
19acceleratoin||acceleration
20accelleration||acceleration
21accesing||accessing
22accesnt||accent
23accessable||accessible
24accesss||access
25accidentaly||accidentally
26accidentually||accidentally
27accoding||according
28accomodate||accommodate
29accomodates||accommodates
30accordign||according
31accoring||according
32accout||account
33accquire||acquire
34accquired||acquired
35acessable||accessible
36acess||access
37achitecture||architecture
38acient||ancient
39acitions||actions
40acitve||active
41acknowldegement||acknowldegement
42acknowledgement||acknowledgment
43ackowledge||acknowledge
44ackowledged||acknowledged
45acording||according
46activete||activate
47acumulating||accumulating
48adapater||adapter
49addional||additional
50additionaly||additionally
51addres||address
52addreses||addresses
53addresss||address
54aditional||additional
55aditionally||additionally
56aditionaly||additionally
57adminstrative||administrative
58adress||address
59adresses||addresses
60adviced||advised
61afecting||affecting
62agaist||against
63albumns||albums
64alegorical||allegorical
65algorith||algorithm
66algorithmical||algorithmically
67algoritm||algorithm
68algoritms||algorithms
69algorrithm||algorithm
70algorritm||algorithm
71allign||align
72allocatrd||allocated
73allocte||allocate
74allpication||application
75alocate||allocate
76alogirhtms||algorithms
77alogrithm||algorithm
78alot||a lot
79alow||allow
80alows||allows
81altough||although
82alue||value
83ambigious||ambiguous
84amoung||among
85amout||amount
86analysator||analyzer
87ang||and
88anniversery||anniversary
89annoucement||announcement
90anomolies||anomalies
91anomoly||anomaly
92anway||anyway
93aplication||application
94appearence||appearance
95applicaion||application
96appliction||application
97applictions||applications
98appplications||applications
99appropiate||appropriate
100appropriatly||appropriately
101approriate||appropriate
102approriately||appropriately
103aquainted||acquainted
104aquired||acquired
105arbitary||arbitrary
106architechture||architecture
107arguement||argument
108arguements||arguments
109aritmetic||arithmetic
110arne't||aren't
111arraival||arrival
112artifical||artificial
113artillary||artillery
114assiged||assigned
115assigment||assignment
116assigments||assignments
117assistent||assistant
118assocation||association
119associcated||associated
120assotiated||associated
121assum||assume
122assumtpion||assumption
123asuming||assuming
124asycronous||asynchronous
125asynchnous||asynchronous
126atomatically||automatically
127atomicly||atomically
128attachement||attachment
129attched||attached
130attemps||attempts
131attruibutes||attributes
132authentification||authentication
133automaticaly||automatically
134automaticly||automatically
135automatize||automate
136automatized||automated
137automatizes||automates
138autonymous||autonomous
139auxilliary||auxiliary
140avaiable||available
141avaible||available
142availabe||available
143availabled||available
144availablity||availability
145availale||available
146availavility||availability
147availble||available
148availiable||available
149avalable||available
150avaliable||available
151aysnc||async
152backgroud||background
153backword||backward
154backwords||backwards
155bahavior||behavior
156bakup||backup
157baloon||balloon
158baloons||balloons
159bandwith||bandwidth
160batery||battery
161beacuse||because
162becasue||because
163becomming||becoming
164becuase||because
165beeing||being
166befor||before
167begining||beginning
168beter||better
169betweeen||between
170bianries||binaries
171bitmast||bitmask
172boardcast||broadcast
173borad||board
174boundry||boundary
175brievely||briefly
176broadcat||broadcast
177cacluated||calculated
178caculation||calculation
179calender||calendar
180calle||called
181calucate||calculate
182calulate||calculate
183cancelation||cancellation
184capabilites||capabilities
185capabitilies||capabilities
186capatibilities||capabilities
187carefuly||carefully
188cariage||carriage
189catagory||category
190challange||challenge
191challanges||challenges
192chanell||channel
193changable||changeable
194channle||channel
195channnel||channel
196charachter||character
197charachters||characters
198charactor||character
199charater||character
200charaters||characters
201charcter||character
202checksuming||checksumming
203childern||children
204childs||children
205chiled||child
206chked||checked
207chnage||change
208chnages||changes
209chnnel||channel
210choosen||chosen
211chouse||chose
212circumvernt||circumvent
213claread||cleared
214clared||cleared
215closeing||closing
216clustred||clustered
217collapsable||collapsible
218colorfull||colorful
219comand||command
220comit||commit
221commerical||commercial
222comming||coming
223comminucation||communication
224commited||committed
225commiting||committing
226committ||commit
227commoditiy||commodity
228compability||compatibility
229compaibility||compatibility
230compatability||compatibility
231compatable||compatible
232compatibiliy||compatibility
233compatibilty||compatibility
234compilant||compliant
235compleatly||completely
236completly||completely
237complient||compliant
238componnents||components
239compres||compress
240compresion||compression
241comression||compression
242comunication||communication
243conbination||combination
244conditionaly||conditionally
245conected||connected
246configuratoin||configuration
247configuraton||configuration
248configuretion||configuration
249conider||consider
250conjuction||conjunction
251connectinos||connections
252connnection||connection
253connnections||connections
254consistancy||consistency
255consistant||consistent
256containes||contains
257containts||contains
258contaisn||contains
259contant||contact
260contence||contents
261continous||continuous
262continously||continuously
263continueing||continuing
264contraints||constraints
265controled||controlled
266controler||controller
267controll||control
268contruction||construction
269contry||country
270convertion||conversion
271convertor||converter
272convienient||convenient
273convinient||convenient
274corected||corrected
275correponding||corresponding
276correponds||corresponds
277correspoding||corresponding
278cotrol||control
279couter||counter
280coutner||counter
281cryptocraphic||cryptographic
282cunter||counter
283curently||currently
284dafault||default
285deafult||default
286deamon||daemon
287decompres||decompress
288decription||description
289defailt||default
290defferred||deferred
291definate||definite
292definately||definitely
293defintion||definition
294defualt||default
295defult||default
296deivce||device
297delared||declared
298delare||declare
299delares||declares
300delaring||declaring
301delemiter||delimiter
302dependancies||dependencies
303dependancy||dependency
304dependant||dependent
305depreacted||deprecated
306depreacte||deprecate
307desactivate||deactivate
308desciptors||descriptors
309descrition||description
310descritptor||descriptor
311desctiptor||descriptor
312desriptor||descriptor
313desriptors||descriptors
314destory||destroy
315destoryed||destroyed
316destorys||destroys
317destroied||destroyed
318detabase||database
319develope||develop
320developement||development
321developped||developed
322developpement||development
323developper||developer
324developpment||development
325deveolpment||development
326devided||divided
327deviece||device
328diable||disable
329dictionnary||dictionary
330diferent||different
331differrence||difference
332difinition||definition
333diplay||display
334direectly||directly
335disapear||disappear
336disapeared||disappeared
337disappared||disappeared
338disconnet||disconnect
339discontinous||discontinuous
340dispertion||dispersion
341dissapears||disappears
342distiction||distinction
343docuentation||documentation
344documantation||documentation
345documentaion||documentation
346documment||document
347dorp||drop
348dosen||doesn
349downlad||download
350downlads||downloads
351druing||during
352dynmaic||dynamic
353easilly||easily
354ecspecially||especially
355edditable||editable
356editting||editing
357efficently||efficiently
358ehther||ether
359eigth||eight
360eletronic||electronic
361enabledi||enabled
362enchanced||enhanced
363encorporating||incorporating
364encrupted||encrypted
365encrypiton||encryption
366endianess||endianness
367enhaced||enhanced
368enlightnment||enlightenment
369enocded||encoded
370enterily||entirely
371enviroiment||environment
372enviroment||environment
373environement||environment
374environent||environment
375eqivalent||equivalent
376equiped||equipped
377equivelant||equivalent
378equivilant||equivalent
379eror||error
380estbalishment||establishment
381etsablishment||establishment
382etsbalishment||establishment
383excecutable||executable
384exceded||exceeded
385excellant||excellent
386existance||existence
387existant||existent
388exixt||exist
389exlcude||exclude
390exlcusive||exclusive
391exmaple||example
392expecially||especially
393explicite||explicit
394explicitely||explicitly
395explict||explicit
396explictly||explicitly
397expresion||expression
398exprimental||experimental
399extened||extended
400extensability||extensibility
401extention||extension
402extracter||extractor
403faild||failed
404faill||fail
405failue||failure
406failuer||failure
407faireness||fairness
408faliure||failure
409familar||familiar
410fatser||faster
411feauture||feature
412feautures||features
413fetaure||feature
414fetaures||features
415fileystem||filesystem
416finanize||finalize
417findn||find
418finilizes||finalizes
419finsih||finish
420flusing||flushing
421folloing||following
422followign||following
423follwing||following
424forseeable||foreseeable
425forse||force
426fortan||fortran
427forwardig||forwarding
428framwork||framework
429frequncy||frequency
430frome||from
431fucntion||function
432fuction||function
433fuctions||functions
434funcion||function
435functionallity||functionality
436functionaly||functionally
437functionnality||functionality
438functonality||functionality
439funtion||function
440funtions||functions
441furthur||further
442futhermore||furthermore
443futrue||future
444gaurenteed||guaranteed
445generiously||generously
446genric||generic
447globel||global
448grabing||grabbing
449grahical||graphical
450grahpical||graphical
451grapic||graphic
452guage||gauge
453guarentee||guarantee
454halfs||halves
455hander||handler
456handfull||handful
457hanled||handled
458harware||hardware
459heirarchically||hierarchically
460helpfull||helpful
461hierachy||hierarchy
462hierarchie||hierarchy
463howver||however
464hsould||should
465hypter||hyper
466identidier||identifier
467imblance||imbalance
468immeadiately||immediately
469immedaite||immediate
470immediatelly||immediately
471immediatly||immediately
472immidiate||immediate
473impelentation||implementation
474impementated||implemented
475implemantation||implementation
476implemenation||implementation
477implementaiton||implementation
478implementated||implemented
479implemention||implementation
480implemetation||implementation
481implemntation||implementation
482implentation||implementation
483implmentation||implementation
484implmenting||implementing
485incomming||incoming
486incompatabilities||incompatibilities
487incompatable||incompatible
488inconsistant||inconsistent
489increas||increase
490incrment||increment
491indendation||indentation
492indended||intended
493independant||independent
494independantly||independently
495independed||independent
496indiate||indicate
497inexpect||inexpected
498infomation||information
499informatiom||information
500informations||information
501informtion||information
502infromation||information
503ingore||ignore
504inital||initial
505initalised||initialized
506initalise||initialize
507initalize||initialize
508initation||initiation
509initators||initiators
510initializiation||initialization
511initialzed||initialized
512initilization||initialization
513initilize||initialize
514inofficial||unofficial
515instal||install
516inteface||interface
517integreated||integrated
518integrety||integrity
519integrey||integrity
520intendet||intended
521intented||intended
522interanl||internal
523interchangable||interchangeable
524interferring||interfering
525interger||integer
526intermittant||intermittent
527internel||internal
528interoprability||interoperability
529interrface||interface
530interrrupt||interrupt
531interrup||interrupt
532interrups||interrupts
533interruptted||interrupted
534interupted||interrupted
535interupt||interrupt
536intial||initial
537intialized||initialized
538intialize||initialize
539intregral||integral
540intrrupt||interrupt
541intuative||intuitive
542invaid||invalid
543invalde||invald
544invalide||invalid
545invididual||individual
546invokation||invocation
547invokations||invocations
548irrelevent||irrelevant
549isssue||issue
550itslef||itself
551jave||java
552jeffies||jiffies
553juse||just
554jus||just
555kown||known
556langage||language
557langauage||language
558langauge||language
559langugage||language
560lauch||launch
561leightweight||lightweight
562lengh||length
563lenght||length
564lenth||length
565lesstiff||lesstif
566libaries||libraries
567libary||library
568librairies||libraries
569libraris||libraries
570licenceing||licencing
571loggging||logging
572loggin||login
573logile||logfile
574loosing||losing
575losted||lost
576machinary||machinery
577maintainance||maintenance
578maintainence||maintenance
579maintan||maintain
580makeing||making
581malplaced||misplaced
582malplace||misplace
583managable||manageable
584managment||management
585mangement||management
586manoeuvering||maneuvering
587mappping||mapping
588mathimatical||mathematical
589mathimatic||mathematic
590mathimatics||mathematics
591maxium||maximum
592mechamism||mechanism
593meetign||meeting
594ment||meant
595mergable||mergeable
596mesage||message
597messags||messages
598messgaes||messages
599messsage||message
600messsages||messages
601microprocesspr||microprocessor
602milliseonds||milliseconds
603minumum||minimum
604miscelleneous||miscellaneous
605misformed||malformed
606mispelled||misspelled
607mispelt||misspelt
608miximum||maximum
609mmnemonic||mnemonic
610mnay||many
611modeled||modelled
612modulues||modules
613monochorome||monochrome
614monochromo||monochrome
615monocrome||monochrome
616mopdule||module
617mroe||more
618mulitplied||multiplied
619multidimensionnal||multidimensional
620multple||multiple
621mumber||number
622muticast||multicast
623mutiple||multiple
624mutli||multi
625nams||names
626navagating||navigating
627nead||need
628neccecary||necessary
629neccesary||necessary
630neccessary||necessary
631necesary||necessary
632negaive||negative
633negoitation||negotiation
634negotation||negotiation
635nerver||never
636nescessary||necessary
637nessessary||necessary
638noticable||noticeable
639notications||notifications
640notifed||notified
641numebr||number
642numner||number
643obtaion||obtain
644occassionally||occasionally
645occationally||occasionally
646occurance||occurrence
647occurances||occurrences
648occured||occurred
649occurence||occurrence
650occure||occurred
651occuring||occurring
652offet||offset
653omitt||omit
654ommiting||omitting
655ommitted||omitted
656onself||oneself
657ony||only
658operatione||operation
659opertaions||operations
660optionnal||optional
661optmizations||optimizations
662orientatied||orientated
663orientied||oriented
664otherise||otherwise
665ouput||output
666overaall||overall
667overhread||overhead
668overlaping||overlapping
669overriden||overridden
670overun||overrun
671pacakge||package
672pachage||package
673packacge||package
674packege||package
675packge||package
676packtes||packets
677pakage||package
678pallette||palette
679paln||plan
680paramameters||parameters
681paramater||parameter
682parametes||parameters
683parametised||parametrised
684paramter||parameter
685paramters||parameters
686particuarly||particularly
687particularily||particularly
688pased||passed
689passin||passing
690pathes||paths
691pecularities||peculiarities
692peformance||performance
693peice||piece
694pendantic||pedantic
695peprocessor||preprocessor
696perfoming||performing
697permissons||permissions
698peroid||period
699persistance||persistence
700persistant||persistent
701platfrom||platform
702plattform||platform
703pleaes||please
704ploting||plotting
705plugable||pluggable
706poinnter||pointer
707poiter||pointer
708posible||possible
709positon||position
710possibilites||possibilities
711powerfull||powerful
712preceeded||preceded
713preceeding||preceding
714preceed||precede
715precendence||precedence
716precission||precision
717prefered||preferred
718prefferably||preferably
719premption||preemption
720prepaired||prepared
721pressre||pressure
722primative||primitive
723princliple||principle
724priorty||priority
725privilaged||privileged
726privilage||privilege
727priviledge||privilege
728priviledges||privileges
729probaly||probably
730procceed||proceed
731proccesors||processors
732procesed||processed
733proces||process
734processessing||processing
735processess||processes
736processpr||processor
737processsed||processed
738processsing||processing
739procteted||protected
740prodecure||procedure
741progams||programs
742progess||progress
743programers||programmers
744programm||program
745programms||programs
746progresss||progress
747promps||prompts
748pronnounced||pronounced
749prononciation||pronunciation
750pronouce||pronounce
751pronunce||pronounce
752propery||property
753propigate||propagate
754propigation||propagation
755propogate||propagate
756prosess||process
757protable||portable
758protcol||protocol
759protecion||protection
760protocoll||protocol
761psudo||pseudo
762psuedo||pseudo
763psychadelic||psychedelic
764pwoer||power
765quering||querying
766raoming||roaming
767reasearcher||researcher
768reasearchers||researchers
769reasearch||research
770recepient||recipient
771receving||receiving
772recieved||received
773recieve||receive
774reciever||receiver
775recieves||receives
776recogniced||recognised
777recognizeable||recognizable
778recommanded||recommended
779recyle||recycle
780redircet||redirect
781redirectrion||redirection
782refcounf||refcount
783refence||reference
784refered||referred
785referenace||reference
786refering||referring
787refernces||references
788refernnce||reference
789refrence||reference
790registerd||registered
791registeresd||registered
792registes||registers
793registraration||registration
794regster||register
795regualar||regular
796reguator||regulator
797regulamentations||regulations
798reigstration||registration
799releated||related
800relevent||relevant
801remoote||remote
802remore||remote
803removeable||removable
804repectively||respectively
805replacable||replaceable
806replacments||replacements
807replys||replies
808reponse||response
809representaion||representation
810reqeust||request
811requiere||require
812requirment||requirement
813requred||required
814requried||required
815requst||request
816reseting||resetting
817resizeable||resizable
818resouces||resources
819resoures||resources
820ressizes||resizes
821ressource||resource
822ressources||resources
823retransmited||retransmitted
824retreived||retrieved
825retreive||retrieve
826retrive||retrieve
827retuned||returned
828reuest||request
829reuqest||request
830reutnred||returned
831rmeoved||removed
832rmeove||remove
833rmeoves||removes
834rountine||routine
835routins||routines
836rquest||request
837runing||running
838runned||ran
839runnning||running
840runtine||runtime
841sacrifying||sacrificing
842safly||safely
843safty||safety
844savable||saveable
845scaned||scanned
846scaning||scanning
847scarch||search
848seach||search
849searchs||searches
850secquence||sequence
851secund||second
852segement||segment
853senarios||scenarios
854sentivite||sensitive
855separatly||separately
856sepcify||specify
857sepc||spec
858seperated||separated
859seperately||separately
860seperate||separate
861seperatly||separately
862seperator||separator
863sepperate||separate
864sequece||sequence
865sequencial||sequential
866serveral||several
867setts||sets
868settting||setting
869shotdown||shutdown
870shoud||should
871shoule||should
872shrinked||shrunk
873siginificantly||significantly
874signabl||signal
875similary||similarly
876similiar||similar
877simlar||similar
878simliar||similar
879simpified||simplified
880singaled||signaled
881singal||signal
882singed||signed
883sleeped||slept
884softwares||software
885speach||speech
886specfic||specific
887speciefied||specified
888specifc||specific
889specifed||specified
890specificatin||specification
891specificaton||specification
892specifing||specifying
893specifiying||specifying
894speficied||specified
895speicify||specify
896speling||spelling
897spinlcok||spinlock
898spinock||spinlock
899splitted||split
900spreaded||spread
901sructure||structure
902stablilization||stabilization
903staically||statically
904staion||station
905standardss||standards
906standartization||standardization
907standart||standard
908staticly||statically
909stoped||stopped
910stoppped||stopped
911straming||streaming
912struc||struct
913structres||structures
914stuct||struct
915sturcture||structure
916subdirectoires||subdirectories
917suble||subtle
918succesfully||successfully
919succesful||successful
920successfull||successful
921sucessfully||successfully
922sucess||success
923superflous||superfluous
924superseeded||superseded
925suplied||supplied
926suported||supported
927suport||support
928suppored||supported
929supportin||supporting
930suppoted||supported
931suppported||supported
932suppport||support
933supress||suppress
934surpresses||suppresses
935susbsystem||subsystem
936suspicously||suspiciously
937swaping||swapping
938switchs||switches
939symetric||symmetric
940synax||syntax
941synchonized||synchronized
942syncronize||synchronize
943syncronizing||synchronizing
944syncronus||synchronous
945syste||system
946sytem||system
947sythesis||synthesis
948taht||that
949targetted||targeted
950targetting||targeting
951teh||the
952temorary||temporary
953temproarily||temporarily
954thier||their
955threds||threads
956threshhold||threshold
957throught||through
958thses||these
959tiggered||triggered
960tipically||typically
961tmis||this
962torerable||tolerable
963tramsmitted||transmitted
964tramsmit||transmit
965tranfer||transfer
966transciever||transceiver
967transferd||transferrd
968transfered||transferred
969transfering||transferring
970transision||transition
971transmittd||transmitted
972transormed||transformed
973trasmission||transmission
974treshold||threshold
975trigerring||triggering
976trun||turn
977ture||true
978tyep||type
979udpate||update
980uesd||used
981unconditionaly||unconditionally
982underun||underrun
983unecessary||unnecessary
984unexecpted||unexpected
985unexpectd||unexpected
986unexpeted||unexpected
987unfortunatelly||unfortunately
988unifiy||unify
989unknonw||unknown
990unknow||unknown
991unkown||unknown
992unneedingly||unnecessarily
993unresgister||unregister
994unsinged||unsigned
995unstabel||unstable
996unsuccessfull||unsuccessful
997unsuported||unsupported
998untill||until
999unuseful||useless
1000upate||update
1001usefule||useful
1002usefull||useful
1003usege||usage
1004usera||users
1005usualy||usually
1006utilites||utilities
1007utillities||utilities
1008utilties||utilities
1009utiltity||utility
1010utitity||utility
1011utitlty||utility
1012vaid||valid
1013vaild||valid
1014valide||valid
1015variantions||variations
1016varient||variant
1017vaule||value
1018verbse||verbose
1019verisons||versions
1020verison||version
1021verson||version
1022vicefersa||vice-versa
1023virtal||virtual
1024virtaul||virtual
1025virtiual||virtual
1026visiters||visitors
1027vitual||virtual
1028wating||waiting
1029whataver||whatever
1030whenver||whenever
1031wheter||whether
1032whe||when
1033wierd||weird
1034wiil||will
1035wirte||write
1036withing||within
1037wnat||want
1038workarould||workaround
1039writeing||writing
1040writting||writing
1041zombe||zombie
1042zomebie||zombie
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 293828bfd4ac..cdb491d84503 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -193,10 +193,6 @@ exuberant()
193 --regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \ 193 --regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
194 --regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \ 194 --regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \
195 --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \ 195 --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \
196 --regex-c++='/TESTPCGFLAG\(([^,)]*).*/PageCgroup\1/' \
197 --regex-c++='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/' \
198 --regex-c++='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/' \
199 --regex-c++='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \
200 --regex-c++='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \ 196 --regex-c++='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \
201 --regex-c++='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \ 197 --regex-c++='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \
202 --regex-c++='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/'\ 198 --regex-c++='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/'\
@@ -259,17 +255,13 @@ emacs()
259 --regex='/__CLEARPAGEFLAG_NOOP(\([^,)]*\).*/__ClearPage\1/' \ 255 --regex='/__CLEARPAGEFLAG_NOOP(\([^,)]*\).*/__ClearPage\1/' \
260 --regex='/TESTCLEARFLAG_FALSE(\([^,)]*\).*/TestClearPage\1/' \ 256 --regex='/TESTCLEARFLAG_FALSE(\([^,)]*\).*/TestClearPage\1/' \
261 --regex='/__TESTCLEARFLAG_FALSE(\([^,)]*\).*/__TestClearPage\1/' \ 257 --regex='/__TESTCLEARFLAG_FALSE(\([^,)]*\).*/__TestClearPage\1/' \
262 --regex='/TESTPCGFLAG\(([^,)]*).*/PageCgroup\1/' \
263 --regex='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/' \
264 --regex='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/' \
265 --regex='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \
266 --regex='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \ 258 --regex='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \
267 --regex='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \ 259 --regex='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \
268 --regex='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/' \ 260 --regex='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/' \
269 --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' \ 261 --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' \
270 --regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \ 262 --regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \
271 --regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'\ 263 --regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'\
272 --regex='/DEFINE_HASHTABLE\((\w*)/\1/v/' 264 --regex='/[^#]*DEFINE_HASHTABLE(\([^,)]*\)/\1/'
273 265
274 all_kconfigs | xargs $1 -a \ 266 all_kconfigs | xargs $1 -a \
275 --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/' 267 --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'
diff --git a/scripts/tracing/draw_functrace.py b/scripts/tracing/draw_functrace.py
index db40fa04cd51..db40fa04cd51 100644..100755
--- a/scripts/tracing/draw_functrace.py
+++ b/scripts/tracing/draw_functrace.py
diff --git a/scripts/xz_wrap.sh b/scripts/xz_wrap.sh
index 7a2d372f4885..7a2d372f4885 100644..100755
--- a/scripts/xz_wrap.sh
+++ b/scripts/xz_wrap.sh