aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2014-07-24 15:36:56 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-07-24 15:36:56 -0400
commitb9f12a5d97f652c77ef6803dccd0d40d1290f5be (patch)
tree8f58c8620ffef0d350a5ec022feda492a96b179a /scripts
parent9d8dc3e529a19e427fd379118acd132520935c5d (diff)
parent9a3c4145af32125c5ee39c0272662b47307a8323 (diff)
Merge tag 'v3.16-rc6' into next
Merge with mainline to bring in changes to MFD to allow merging ipaq-micro-ts driver.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile2
-rw-r--r--scripts/Makefile.asm-generic1
-rw-r--r--scripts/Makefile.build65
-rw-r--r--scripts/Makefile.extrawarn67
-rw-r--r--scripts/Makefile.fwinst26
-rw-r--r--scripts/Makefile.host3
-rw-r--r--scripts/Makefile.lib10
-rw-r--r--scripts/basic/fixdep.c8
-rwxr-xr-xscripts/checkpatch.pl141
-rwxr-xr-xscripts/checkstack.pl1
-rwxr-xr-xscripts/checksyscalls.sh5
-rw-r--r--scripts/coccinelle/misc/of_table.cocci62
-rw-r--r--scripts/coccinelle/misc/returnvar.cocci66
-rwxr-xr-xscripts/config1
-rw-r--r--scripts/conmakehash.c12
-rwxr-xr-xscripts/decode_stacktrace.sh126
-rw-r--r--scripts/docproc.c56
-rw-r--r--scripts/dtc/.gitignore1
-rw-r--r--scripts/dtc/fstree.c1
-rw-r--r--scripts/dtc/libfdt/fdt_empty_tree.c1
-rw-r--r--scripts/dtc/treesource.c1
-rwxr-xr-xscripts/headers.sh2
-rw-r--r--scripts/kallsyms.c2
-rw-r--r--scripts/kconfig/Makefile5
-rwxr-xr-xscripts/kconfig/check.sh1
-rw-r--r--scripts/kconfig/conf.c2
-rw-r--r--scripts/kconfig/gconf.c2
-rw-r--r--scripts/kconfig/lxdialog/checklist.c4
-rw-r--r--scripts/kconfig/lxdialog/inputbox.c2
-rw-r--r--scripts/kconfig/lxdialog/menubox.c4
-rw-r--r--scripts/kconfig/lxdialog/util.c2
-rw-r--r--scripts/kconfig/mconf.c3
-rw-r--r--scripts/kconfig/menu.c6
-rw-r--r--scripts/kconfig/nconf.c1
-rw-r--r--scripts/kconfig/streamline_config.pl2
-rw-r--r--scripts/kconfig/util.c2
-rw-r--r--scripts/kconfig/zconf.l4
-rw-r--r--scripts/kconfig/zconf.lex.c_shipped4
-rw-r--r--scripts/kconfig/zconf.tab.c_shipped2
-rw-r--r--scripts/kconfig/zconf.y2
-rwxr-xr-xscripts/kernel-doc15
-rw-r--r--scripts/markup_oops.pl1
-rwxr-xr-xscripts/mkcompile_h4
-rw-r--r--scripts/mkmakefile15
-rw-r--r--scripts/mksysmap1
-rw-r--r--scripts/mod/.gitignore1
-rw-r--r--scripts/mod/file2alias.c42
-rw-r--r--scripts/mod/mk_elfconfig.c1
-rw-r--r--scripts/mod/modpost.c34
-rw-r--r--scripts/mod/sumversion.c4
-rwxr-xr-xscripts/objdiff74
-rw-r--r--scripts/package/Makefile1
-rw-r--r--scripts/package/builddeb26
-rw-r--r--scripts/package/buildtar4
-rwxr-xr-xscripts/patch-kernel4
-rw-r--r--scripts/pnmtologo.c1
-rw-r--r--scripts/recordmcount.c9
-rw-r--r--scripts/recordmcount.h4
-rwxr-xr-xscripts/recordmcount.pl5
-rw-r--r--scripts/rt-tester/check-all.sh1
-rw-r--r--scripts/rt-tester/rt-tester.py2
-rw-r--r--scripts/selinux/install_policy.sh1
-rwxr-xr-xscripts/show_delta1
-rwxr-xr-xscripts/tags.sh29
64 files changed, 691 insertions, 297 deletions
diff --git a/scripts/Makefile b/scripts/Makefile
index 1d07860f6c42..890df5c6adfb 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -39,4 +39,4 @@ subdir-$(CONFIG_SECURITY_SELINUX) += selinux
39subdir-$(CONFIG_DTC) += dtc 39subdir-$(CONFIG_DTC) += dtc
40 40
41# Let clean descend into subdirs 41# Let clean descend into subdirs
42subdir- += basic kconfig package selinux 42subdir- += basic kconfig package
diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic
index d17e0ea911ed..045e0098e962 100644
--- a/scripts/Makefile.asm-generic
+++ b/scripts/Makefile.asm-generic
@@ -21,4 +21,3 @@ all: $(patsubst %, $(obj)/%, $(generic-y))
21 21
22$(obj)/%.h: 22$(obj)/%.h:
23 $(call cmd,wrap) 23 $(call cmd,wrap)
24
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 003bc263105a..bf3e6778cd71 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -50,67 +50,6 @@ ifeq ($(KBUILD_NOPEDANTIC),)
50 endif 50 endif
51endif 51endif
52 52
53#
54# make W=... settings
55#
56# W=1 - warnings that may be relevant and does not occur too often
57# W=2 - warnings that occur quite often but may still be relevant
58# W=3 - the more obscure warnings, can most likely be ignored
59#
60# $(call cc-option, -W...) handles gcc -W.. options which
61# are not supported by all versions of the compiler
62ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS
63warning- := $(empty)
64
65warning-1 := -Wextra -Wunused -Wno-unused-parameter
66warning-1 += -Wmissing-declarations
67warning-1 += -Wmissing-format-attribute
68warning-1 += $(call cc-option, -Wmissing-prototypes)
69warning-1 += -Wold-style-definition
70warning-1 += $(call cc-option, -Wmissing-include-dirs)
71warning-1 += $(call cc-option, -Wunused-but-set-variable)
72warning-1 += $(call cc-disable-warning, missing-field-initializers)
73
74# Clang
75warning-1 += $(call cc-disable-warning, initializer-overrides)
76warning-1 += $(call cc-disable-warning, unused-value)
77warning-1 += $(call cc-disable-warning, format)
78warning-1 += $(call cc-disable-warning, unknown-warning-option)
79warning-1 += $(call cc-disable-warning, sign-compare)
80warning-1 += $(call cc-disable-warning, format-zero-length)
81warning-1 += $(call cc-disable-warning, uninitialized)
82warning-1 += $(call cc-option, -fcatch-undefined-behavior)
83
84warning-2 := -Waggregate-return
85warning-2 += -Wcast-align
86warning-2 += -Wdisabled-optimization
87warning-2 += -Wnested-externs
88warning-2 += -Wshadow
89warning-2 += $(call cc-option, -Wlogical-op)
90warning-2 += $(call cc-option, -Wmissing-field-initializers)
91
92warning-3 := -Wbad-function-cast
93warning-3 += -Wcast-qual
94warning-3 += -Wconversion
95warning-3 += -Wpacked
96warning-3 += -Wpadded
97warning-3 += -Wpointer-arith
98warning-3 += -Wredundant-decls
99warning-3 += -Wswitch-default
100warning-3 += $(call cc-option, -Wpacked-bitfield-compat)
101warning-3 += $(call cc-option, -Wvla)
102
103warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
104warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
105warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
106
107ifeq ("$(strip $(warning))","")
108 $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
109endif
110
111KBUILD_CFLAGS += $(warning)
112endif
113
114include scripts/Makefile.lib 53include scripts/Makefile.lib
115 54
116ifdef host-progs 55ifdef host-progs
@@ -342,7 +281,7 @@ $(real-objs-m) : modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
342$(real-objs-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) 281$(real-objs-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
343 282
344quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ 283quiet_cmd_as_s_S = CPP $(quiet_modtag) $@
345cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< 284cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
346 285
347$(obj)/%.s: $(src)/%.S FORCE 286$(obj)/%.s: $(src)/%.S FORCE
348 $(call if_changed_dep,as_s_S) 287 $(call if_changed_dep,as_s_S)
@@ -436,7 +375,7 @@ link_multi_deps = \
436$(filter $(addprefix $(obj)/, \ 375$(filter $(addprefix $(obj)/, \
437$($(subst $(obj)/,,$(@:.o=-objs))) \ 376$($(subst $(obj)/,,$(@:.o=-objs))) \
438$($(subst $(obj)/,,$(@:.o=-y)))), $^) 377$($(subst $(obj)/,,$(@:.o=-y)))), $^)
439 378
440quiet_cmd_link_multi-y = LD $@ 379quiet_cmd_link_multi-y = LD $@
441cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis) 380cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
442 381
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
new file mode 100644
index 000000000000..65643506c71c
--- /dev/null
+++ b/scripts/Makefile.extrawarn
@@ -0,0 +1,67 @@
1# ==========================================================================
2#
3# make W=... settings
4#
5# W=1 - warnings that may be relevant and does not occur too often
6# W=2 - warnings that occur quite often but may still be relevant
7# W=3 - the more obscure warnings, can most likely be ignored
8#
9# $(call cc-option, -W...) handles gcc -W.. options which
10# are not supported by all versions of the compiler
11# ==========================================================================
12
13ifeq ("$(origin W)", "command line")
14 export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W)
15endif
16
17ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS
18warning- := $(empty)
19
20warning-1 := -Wextra -Wunused -Wno-unused-parameter
21warning-1 += -Wmissing-declarations
22warning-1 += -Wmissing-format-attribute
23warning-1 += $(call cc-option, -Wmissing-prototypes)
24warning-1 += -Wold-style-definition
25warning-1 += $(call cc-option, -Wmissing-include-dirs)
26warning-1 += $(call cc-option, -Wunused-but-set-variable)
27warning-1 += $(call cc-disable-warning, missing-field-initializers)
28
29# Clang
30warning-1 += $(call cc-disable-warning, initializer-overrides)
31warning-1 += $(call cc-disable-warning, unused-value)
32warning-1 += $(call cc-disable-warning, format)
33warning-1 += $(call cc-disable-warning, unknown-warning-option)
34warning-1 += $(call cc-disable-warning, sign-compare)
35warning-1 += $(call cc-disable-warning, format-zero-length)
36warning-1 += $(call cc-disable-warning, uninitialized)
37warning-1 += $(call cc-option, -fcatch-undefined-behavior)
38
39warning-2 := -Waggregate-return
40warning-2 += -Wcast-align
41warning-2 += -Wdisabled-optimization
42warning-2 += -Wnested-externs
43warning-2 += -Wshadow
44warning-2 += $(call cc-option, -Wlogical-op)
45warning-2 += $(call cc-option, -Wmissing-field-initializers)
46
47warning-3 := -Wbad-function-cast
48warning-3 += -Wcast-qual
49warning-3 += -Wconversion
50warning-3 += -Wpacked
51warning-3 += -Wpadded
52warning-3 += -Wpointer-arith
53warning-3 += -Wredundant-decls
54warning-3 += -Wswitch-default
55warning-3 += $(call cc-option, -Wpacked-bitfield-compat)
56warning-3 += $(call cc-option, -Wvla)
57
58warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
59warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
60warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
61
62ifeq ("$(strip $(warning))","")
63 $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
64endif
65
66KBUILD_CFLAGS += $(warning)
67endif
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst
index 4d908d16c035..d8e335eed226 100644
--- a/scripts/Makefile.fwinst
+++ b/scripts/Makefile.fwinst
@@ -18,31 +18,29 @@ include $(srctree)/$(obj)/Makefile
18include scripts/Makefile.host 18include scripts/Makefile.host
19 19
20mod-fw := $(fw-shipped-m) 20mod-fw := $(fw-shipped-m)
21# If CONFIG_FIRMWARE_IN_KERNEL isn't set, then install the 21# If CONFIG_FIRMWARE_IN_KERNEL isn't set, then install the
22# firmware for in-kernel drivers too. 22# firmware for in-kernel drivers too.
23ifndef CONFIG_FIRMWARE_IN_KERNEL 23ifndef CONFIG_FIRMWARE_IN_KERNEL
24mod-fw += $(fw-shipped-y) 24mod-fw += $(fw-shipped-y)
25endif 25endif
26 26
27ifneq ($(KBUILD_SRC),)
28# Create output directory if not already present
29_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
30
31firmware-dirs := $(sort $(addprefix $(objtree)/$(obj)/,$(dir $(fw-external-y) $(fw-shipped-all))))
32# Create directories for firmware in subdirectories
33_dummy := $(foreach d,$(firmware-dirs), $(shell [ -d $(d) ] || mkdir -p $(d)))
34endif
35
27installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) 36installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw))
28 37
29installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) 38installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all))
30installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./
31
32# Workaround for make < 3.81, where .SECONDEXPANSION doesn't work.
33PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs
34$(INSTALL_FW_PATH)/$$(%): install-all-dirs
35 @true
36install-all-dirs: $(installed-fw-dirs)
37 @true
38 39
39quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@) 40quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@)
40 cmd_install = $(INSTALL) -m0644 $< $@ 41 cmd_install = mkdir -p $(@D); $(INSTALL) -m0644 $< $@
41
42$(installed-fw-dirs):
43 $(call cmd,mkdir)
44 42
45$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %) 43$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/%
46 $(call cmd,install) 44 $(call cmd,install)
47 45
48PHONY += __fw_install __fw_modinst FORCE 46PHONY += __fw_install __fw_modinst FORCE
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 1ac414fd5030..66893643fd7d 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -166,5 +166,4 @@ $(host-cshlib): $(obj)/%: $(host-cshobjs) FORCE
166 $(call if_changed,host-cshlib) 166 $(call if_changed,host-cshlib)
167 167
168targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\ 168targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\
169 $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) 169 $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs)
170
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 6a5b0decb797..260bf8acfce9 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -27,7 +27,7 @@ lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m)))
27# --------------------------------------------------------------------------- 27# ---------------------------------------------------------------------------
28# o if we encounter foo/ in $(obj-y), replace it by foo/built-in.o 28# o if we encounter foo/ in $(obj-y), replace it by foo/built-in.o
29# and add the directory to the list of dirs to descend into: $(subdir-y) 29# and add the directory to the list of dirs to descend into: $(subdir-y)
30# o if we encounter foo/ in $(obj-m), remove it from $(obj-m) 30# o if we encounter foo/ in $(obj-m), remove it from $(obj-m)
31# and add the directory to the list of dirs to descend into: $(subdir-m) 31# and add the directory to the list of dirs to descend into: $(subdir-m)
32 32
33# Determine modorder. 33# Determine modorder.
@@ -46,7 +46,7 @@ obj-m := $(filter-out %/, $(obj-m))
46 46
47subdir-ym := $(sort $(subdir-y) $(subdir-m)) 47subdir-ym := $(sort $(subdir-y) $(subdir-m))
48 48
49# if $(foo-objs) exists, foo.o is a composite object 49# if $(foo-objs) exists, foo.o is a composite object
50multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) 50multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
51multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) 51multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
52multi-used := $(multi-used-y) $(multi-used-m) 52multi-used := $(multi-used-y) $(multi-used-m)
@@ -91,7 +91,7 @@ obj-dirs := $(addprefix $(obj)/,$(obj-dirs))
91 91
92# These flags are needed for modversions and compiling, so we define them here 92# These flags are needed for modversions and compiling, so we define them here
93# already 93# already
94# $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will 94# $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will
95# end up in (or would, if it gets compiled in) 95# end up in (or would, if it gets compiled in)
96# Note: Files that end up in two or more modules are compiled without the 96# Note: Files that end up in two or more modules are compiled without the
97# KBUILD_MODNAME definition. The reason is that any made-up name would 97# KBUILD_MODNAME definition. The reason is that any made-up name would
@@ -212,7 +212,7 @@ $(obj)/%: $(src)/%_shipped
212 212
213# Commands useful for building a boot image 213# Commands useful for building a boot image
214# =========================================================================== 214# ===========================================================================
215# 215#
216# Use as following: 216# Use as following:
217# 217#
218# target: source(s) FORCE 218# target: source(s) FORCE
@@ -226,7 +226,7 @@ $(obj)/%: $(src)/%_shipped
226 226
227quiet_cmd_ld = LD $@ 227quiet_cmd_ld = LD $@
228cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \ 228cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \
229 $(filter-out FORCE,$^) -o $@ 229 $(filter-out FORCE,$^) -o $@
230 230
231# Objcopy 231# Objcopy
232# --------------------------------------------------------------------------- 232# ---------------------------------------------------------------------------
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 078fe1d64e7d..b30406860b73 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -409,10 +409,10 @@ static void print_deps(void)
409 exit(2); 409 exit(2);
410 } 410 }
411 if (fstat(fd, &st) < 0) { 411 if (fstat(fd, &st) < 0) {
412 fprintf(stderr, "fixdep: error fstat'ing depfile: "); 412 fprintf(stderr, "fixdep: error fstat'ing depfile: ");
413 perror(depfile); 413 perror(depfile);
414 exit(2); 414 exit(2);
415 } 415 }
416 if (st.st_size == 0) { 416 if (st.st_size == 0) {
417 fprintf(stderr,"fixdep: %s is empty\n",depfile); 417 fprintf(stderr,"fixdep: %s is empty\n",depfile);
418 close(fd); 418 close(fd);
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 34eb2160489d..182be0f12407 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -24,6 +24,7 @@ my $emacs = 0;
24my $terse = 0; 24my $terse = 0;
25my $file = 0; 25my $file = 0;
26my $check = 0; 26my $check = 0;
27my $check_orig = 0;
27my $summary = 1; 28my $summary = 1;
28my $mailback = 0; 29my $mailback = 0;
29my $summary_file = 0; 30my $summary_file = 0;
@@ -146,6 +147,7 @@ GetOptions(
146help(0) if ($help); 147help(0) if ($help);
147 148
148$fix = 1 if ($fix_inplace); 149$fix = 1 if ($fix_inplace);
150$check_orig = $check;
149 151
150my $exit = 0; 152my $exit = 0;
151 153
@@ -397,6 +399,11 @@ foreach my $entry (@mode_permission_funcs) {
397 $mode_perms_search .= $entry->[0]; 399 $mode_perms_search .= $entry->[0];
398} 400}
399 401
402our $declaration_macros = qr{(?x:
403 (?:$Storage\s+)?(?:DECLARE|DEFINE)_[A-Z]+\s*\(|
404 (?:$Storage\s+)?LIST_HEAD\s*\(
405)};
406
400our $allowed_asm_includes = qr{(?x: 407our $allowed_asm_includes = qr{(?x:
401 irq| 408 irq|
402 memory 409 memory
@@ -1808,11 +1815,13 @@ sub process {
1808 $here = "#$linenr: " if (!$file); 1815 $here = "#$linenr: " if (!$file);
1809 $here = "#$realline: " if ($file); 1816 $here = "#$realline: " if ($file);
1810 1817
1818 my $found_file = 0;
1811 # extract the filename as it passes 1819 # extract the filename as it passes
1812 if ($line =~ /^diff --git.*?(\S+)$/) { 1820 if ($line =~ /^diff --git.*?(\S+)$/) {
1813 $realfile = $1; 1821 $realfile = $1;
1814 $realfile =~ s@^([^/]*)/@@ if (!$file); 1822 $realfile =~ s@^([^/]*)/@@ if (!$file);
1815 $in_commit_log = 0; 1823 $in_commit_log = 0;
1824 $found_file = 1;
1816 } elsif ($line =~ /^\+\+\+\s+(\S+)/) { 1825 } elsif ($line =~ /^\+\+\+\s+(\S+)/) {
1817 $realfile = $1; 1826 $realfile = $1;
1818 $realfile =~ s@^([^/]*)/@@ if (!$file); 1827 $realfile =~ s@^([^/]*)/@@ if (!$file);
@@ -1829,6 +1838,15 @@ sub process {
1829 ERROR("MODIFIED_INCLUDE_ASM", 1838 ERROR("MODIFIED_INCLUDE_ASM",
1830 "do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n"); 1839 "do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n");
1831 } 1840 }
1841 $found_file = 1;
1842 }
1843
1844 if ($found_file) {
1845 if ($realfile =~ m@^(drivers/net/|net/)@) {
1846 $check = 1;
1847 } else {
1848 $check = $check_orig;
1849 }
1832 next; 1850 next;
1833 } 1851 }
1834 1852
@@ -1926,6 +1944,12 @@ sub process {
1926 } 1944 }
1927 } 1945 }
1928 1946
1947# Check for old stable address
1948 if ($line =~ /^\s*cc:\s*.*<?\bstable\@kernel\.org\b>?.*$/i) {
1949 ERROR("STABLE_ADDRESS",
1950 "The 'stable' address should be 'stable\@vger.kernel.org'\n" . $herecurr);
1951 }
1952
1929# Check for unwanted Gerrit info 1953# Check for unwanted Gerrit info
1930 if ($in_commit_log && $line =~ /^\s*change-id:/i) { 1954 if ($in_commit_log && $line =~ /^\s*change-id:/i) {
1931 ERROR("GERRIT_CHANGE_ID", 1955 ERROR("GERRIT_CHANGE_ID",
@@ -2093,8 +2117,10 @@ sub process {
2093 2117
2094 foreach my $compat (@compats) { 2118 foreach my $compat (@compats) {
2095 my $compat2 = $compat; 2119 my $compat2 = $compat;
2096 $compat2 =~ s/\,[a-z]*\-/\,<\.\*>\-/; 2120 $compat2 =~ s/\,[a-zA-Z0-9]*\-/\,<\.\*>\-/;
2097 `grep -Erq "$compat|$compat2" $dt_path`; 2121 my $compat3 = $compat;
2122 $compat3 =~ s/\,([a-z]*)[0-9]*\-/\,$1<\.\*>\-/;
2123 `grep -Erq "$compat|$compat2|$compat3" $dt_path`;
2098 if ( $? >> 8 ) { 2124 if ( $? >> 8 ) {
2099 WARN("UNDOCUMENTED_DT_STRING", 2125 WARN("UNDOCUMENTED_DT_STRING",
2100 "DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr); 2126 "DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr);
@@ -2266,18 +2292,37 @@ sub process {
2266 } 2292 }
2267 2293
2268# check for missing blank lines after declarations 2294# check for missing blank lines after declarations
2269 if ($realfile =~ m@^(drivers/net/|net/)@ && 2295 if ($sline =~ /^\+\s+\S/ && #Not at char 1
2270 $prevline =~ /^\+\s+$Declare\s+$Ident/ && 2296 # actual declarations
2271 !($prevline =~ /(?:$Compare|$Assignment|$Operators)\s*$/ || 2297 ($prevline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ ||
2272 $prevline =~ /(?:\{\s*|\\)$/) && #extended lines 2298 # foo bar; where foo is some local typedef or #define
2273 $sline =~ /^\+\s+/ && #Not at char 1 2299 $prevline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ ||
2274 !($sline =~ /^\+\s+$Declare/ || 2300 # known declaration macros
2275 $sline =~ /^\+\s+$Ident\s+$Ident/ || #eg: typedef foo 2301 $prevline =~ /^\+\s+$declaration_macros/) &&
2302 # for "else if" which can look like "$Ident $Ident"
2303 !($prevline =~ /^\+\s+$c90_Keywords\b/ ||
2304 # other possible extensions of declaration lines
2305 $prevline =~ /(?:$Compare|$Assignment|$Operators)\s*$/ ||
2306 # not starting a section or a macro "\" extended line
2307 $prevline =~ /(?:\{\s*|\\)$/) &&
2308 # looks like a declaration
2309 !($sline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ ||
2310 # foo bar; where foo is some local typedef or #define
2311 $sline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ ||
2312 # known declaration macros
2313 $sline =~ /^\+\s+$declaration_macros/ ||
2314 # start of struct or union or enum
2276 $sline =~ /^\+\s+(?:union|struct|enum|typedef)\b/ || 2315 $sline =~ /^\+\s+(?:union|struct|enum|typedef)\b/ ||
2277 $sline =~ /^\+\s+(?:$|[\{\}\.\#\"\?\:\(])/ || 2316 # start or end of block or continuation of declaration
2278 $sline =~ /^\+\s+\(?\s*(?:$Compare|$Assignment|$Operators)/)) { 2317 $sline =~ /^\+\s+(?:$|[\{\}\.\#\"\?\:\(\[])/ ||
2318 # bitfield continuation
2319 $sline =~ /^\+\s+$Ident\s*:\s*\d+\s*[,;]/ ||
2320 # other possible extensions of declaration lines
2321 $sline =~ /^\+\s+\(?\s*(?:$Compare|$Assignment|$Operators)/) &&
2322 # indentation of previous and current line are the same
2323 (($prevline =~ /\+(\s+)\S/) && $sline =~ /^\+$1\S/)) {
2279 WARN("SPACING", 2324 WARN("SPACING",
2280 "networking uses a blank line after declarations\n" . $hereprev); 2325 "Missing a blank line after declarations\n" . $hereprev);
2281 } 2326 }
2282 2327
2283# check for spaces at the beginning of a line. 2328# check for spaces at the beginning of a line.
@@ -3431,6 +3476,18 @@ sub process {
3431 } 3476 }
3432 } 3477 }
3433 3478
3479# unnecessary return in a void function
3480# at end-of-function, with the previous line a single leading tab, then return;
3481# and the line before that not a goto label target like "out:"
3482 if ($sline =~ /^[ \+]}\s*$/ &&
3483 $prevline =~ /^\+\treturn\s*;\s*$/ &&
3484 $linenr >= 3 &&
3485 $lines[$linenr - 3] =~ /^[ +]/ &&
3486 $lines[$linenr - 3] !~ /^[ +]\s*$Ident\s*:/) {
3487 WARN("RETURN_VOID",
3488 "void function return statements are not generally useful\n" . $hereprev);
3489 }
3490
3434# if statements using unnecessary parentheses - ie: if ((foo == bar)) 3491# if statements using unnecessary parentheses - ie: if ((foo == bar))
3435 if ($^V && $^V ge 5.10.0 && 3492 if ($^V && $^V ge 5.10.0 &&
3436 $line =~ /\bif\s*((?:\(\s*){2,})/) { 3493 $line =~ /\bif\s*((?:\(\s*){2,})/) {
@@ -3782,6 +3839,17 @@ sub process {
3782 WARN("DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON", 3839 WARN("DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON",
3783 "do {} while (0) macros should not be semicolon terminated\n" . "$herectx"); 3840 "do {} while (0) macros should not be semicolon terminated\n" . "$herectx");
3784 } 3841 }
3842 } elsif ($dstat =~ /^\+\s*#\s*define\s+$Ident.*;\s*$/) {
3843 $ctx =~ s/\n*$//;
3844 my $cnt = statement_rawlines($ctx);
3845 my $herectx = $here . "\n";
3846
3847 for (my $n = 0; $n < $cnt; $n++) {
3848 $herectx .= raw_line($linenr, $n) . "\n";
3849 }
3850
3851 WARN("TRAILING_SEMICOLON",
3852 "macros should not use a trailing semicolon\n" . "$herectx");
3785 } 3853 }
3786 } 3854 }
3787 3855
@@ -4264,6 +4332,27 @@ sub process {
4264 "unchecked sscanf return value\n" . "$here\n$stat_real\n"); 4332 "unchecked sscanf return value\n" . "$here\n$stat_real\n");
4265 } 4333 }
4266 4334
4335# check for simple sscanf that should be kstrto<foo>
4336 if ($^V && $^V ge 5.10.0 &&
4337 defined $stat &&
4338 $line =~ /\bsscanf\b/) {
4339 my $lc = $stat =~ tr@\n@@;
4340 $lc = $lc + $linenr;
4341 my $stat_real = raw_line($linenr, 0);
4342 for (my $count = $linenr + 1; $count <= $lc; $count++) {
4343 $stat_real = $stat_real . "\n" . raw_line($count, 0);
4344 }
4345 if ($stat_real =~ /\bsscanf\b\s*\(\s*$FuncArg\s*,\s*("[^"]+")/) {
4346 my $format = $6;
4347 my $count = $format =~ tr@%@%@;
4348 if ($count == 1 &&
4349 $format =~ /^"\%(?i:ll[udxi]|[udxi]ll|ll|[hl]h?[udxi]|[udxi][hl]h?|[hl]h?|[udxi])"$/) {
4350 WARN("SSCANF_TO_KSTRTO",
4351 "Prefer kstrto<type> to single variable sscanf\n" . "$here\n$stat_real\n");
4352 }
4353 }
4354 }
4355
4267# check for new externs in .h files. 4356# check for new externs in .h files.
4268 if ($realfile =~ /\.h$/ && 4357 if ($realfile =~ /\.h$/ &&
4269 $line =~ /^\+\s*(extern\s+)$Type\s*$Ident\s*\(/s) { 4358 $line =~ /^\+\s*(extern\s+)$Type\s*$Ident\s*\(/s) {
@@ -4328,6 +4417,30 @@ sub process {
4328 "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr); 4417 "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr);
4329 } 4418 }
4330 4419
4420# check for k[mz]alloc with multiplies that could be kmalloc_array/kcalloc
4421 if ($^V && $^V ge 5.10.0 &&
4422 $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*(k[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)/) {
4423 my $oldfunc = $3;
4424 my $a1 = $4;
4425 my $a2 = $10;
4426 my $newfunc = "kmalloc_array";
4427 $newfunc = "kcalloc" if ($oldfunc eq "kzalloc");
4428 if ($a1 =~ /^sizeof\s*\S/ || $a2 =~ /^sizeof\s*\S/) {
4429 if (WARN("ALLOC_WITH_MULTIPLY",
4430 "Prefer $newfunc over $oldfunc with multiply\n" . $herecurr) &&
4431 $fix) {
4432 my $r1 = $a1;
4433 my $r2 = $a2;
4434 if ($a1 =~ /^sizeof\s*\S/) {
4435 $r1 = $a2;
4436 $r2 = $a1;
4437 }
4438 $fixed[$linenr - 1] =~ s/\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*(k[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)/$1 . ' = ' . "$newfunc(" . trim($r1) . ', ' . trim($r2)/e;
4439
4440 }
4441 }
4442 }
4443
4331# check for krealloc arg reuse 4444# check for krealloc arg reuse
4332 if ($^V && $^V ge 5.10.0 && 4445 if ($^V && $^V ge 5.10.0 &&
4333 $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*krealloc\s*\(\s*\1\s*,/) { 4446 $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*krealloc\s*\(\s*\1\s*,/) {
@@ -4443,10 +4556,10 @@ sub process {
4443 "$1 is obsolete, use k$3 instead\n" . $herecurr); 4556 "$1 is obsolete, use k$3 instead\n" . $herecurr);
4444 } 4557 }
4445 4558
4446# check for __initcall(), use device_initcall() explicitly please 4559# check for __initcall(), use device_initcall() explicitly or more appropriate function please
4447 if ($line =~ /^.\s*__initcall\s*\(/) { 4560 if ($line =~ /^.\s*__initcall\s*\(/) {
4448 WARN("USE_DEVICE_INITCALL", 4561 WARN("USE_DEVICE_INITCALL",
4449 "please use device_initcall() instead of __initcall()\n" . $herecurr); 4562 "please use device_initcall() or more appropriate function instead of __initcall() (see include/linux/init.h)\n" . $herecurr);
4450 } 4563 }
4451 4564
4452# check for various ops structs, ensure they are const. 4565# check for various ops structs, ensure they are const.
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index 544aa56b6200..c05d586b1fee 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -173,4 +173,3 @@ while (my $line = <STDIN>) {
173 173
174# Sort output by size (last field) 174# Sort output by size (last field)
175print sort { ($b =~ /:\t*(\d+)$/)[0] <=> ($a =~ /:\t*(\d+)$/)[0] } @stack; 175print sort { ($b =~ /:\t*(\d+)$/)[0] <=> ($a =~ /:\t*(\d+)$/)[0] } @stack;
176
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh
index fd8fa9aa7c4e..5b3add31f9f1 100755
--- a/scripts/checksyscalls.sh
+++ b/scripts/checksyscalls.sh
@@ -25,7 +25,7 @@ cat << EOF
25#define __IGNORE_rmdir /* unlinkat */ 25#define __IGNORE_rmdir /* unlinkat */
26#define __IGNORE_lchown /* fchownat */ 26#define __IGNORE_lchown /* fchownat */
27#define __IGNORE_access /* faccessat */ 27#define __IGNORE_access /* faccessat */
28#define __IGNORE_rename /* renameat */ 28#define __IGNORE_rename /* renameat2 */
29#define __IGNORE_readlink /* readlinkat */ 29#define __IGNORE_readlink /* readlinkat */
30#define __IGNORE_symlink /* symlinkat */ 30#define __IGNORE_symlink /* symlinkat */
31#define __IGNORE_utimes /* futimesat */ 31#define __IGNORE_utimes /* futimesat */
@@ -37,6 +37,9 @@ cat << EOF
37#define __IGNORE_lstat64 /* fstatat64 */ 37#define __IGNORE_lstat64 /* fstatat64 */
38#endif 38#endif
39 39
40/* Missing flags argument */
41#define __IGNORE_renameat /* renameat2 */
42
40/* CLOEXEC flag */ 43/* CLOEXEC flag */
41#define __IGNORE_pipe /* pipe2 */ 44#define __IGNORE_pipe /* pipe2 */
42#define __IGNORE_dup2 /* dup3 */ 45#define __IGNORE_dup2 /* dup3 */
diff --git a/scripts/coccinelle/misc/of_table.cocci b/scripts/coccinelle/misc/of_table.cocci
new file mode 100644
index 000000000000..3c934046a060
--- /dev/null
+++ b/scripts/coccinelle/misc/of_table.cocci
@@ -0,0 +1,62 @@
1/// Make sure of_device_id tables are NULL terminated
2//
3// Keywords: of_table
4// Confidence: Medium
5// Options: --include-headers
6
7virtual patch
8virtual context
9virtual org
10virtual report
11
12@depends on context@
13identifier var, arr;
14expression E;
15@@
16struct of_device_id arr[] = {
17 ...,
18 {
19 .var = E,
20* }
21};
22
23@depends on patch@
24identifier var, arr;
25expression E;
26@@
27struct of_device_id arr[] = {
28 ...,
29 {
30 .var = E,
31- }
32+ },
33+ { }
34};
35
36@r depends on org || report@
37position p1;
38identifier var, arr;
39expression E;
40@@
41struct of_device_id arr[] = {
42 ...,
43 {
44 .var = E,
45 }
46 @p1
47};
48
49@script:python depends on org@
50p1 << r.p1;
51arr << r.arr;
52@@
53
54cocci.print_main(arr,p1)
55
56@script:python depends on report@
57p1 << r.p1;
58arr << r.arr;
59@@
60
61msg = "%s is not NULL terminated at line %s" % (arr, p1[0].line)
62coccilib.report.print_report(p1[0],msg)
diff --git a/scripts/coccinelle/misc/returnvar.cocci b/scripts/coccinelle/misc/returnvar.cocci
new file mode 100644
index 000000000000..605955a91c44
--- /dev/null
+++ b/scripts/coccinelle/misc/returnvar.cocci
@@ -0,0 +1,66 @@
1///
2/// Removes unneeded variable used to store return value.
3///
4// Confidence: Moderate
5// Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6. GPLv2.
6// URL: http://coccinelle.lip6.fr/
7// Comments: Comments on code can be deleted if near code that is removed.
8// "when strict" can be removed to get more hits, but adds false
9// positives
10// Options: --no-includes --include-headers
11
12virtual patch
13virtual report
14virtual context
15virtual org
16
17@depends on patch@
18type T;
19constant C;
20identifier ret;
21@@
22- T ret = C;
23... when != ret
24 when strict
25return
26- ret
27+ C
28;
29
30@depends on context@
31type T;
32constant C;
33identifier ret;
34@@
35* T ret = C;
36... when != ret
37 when strict
38* return ret;
39
40@r1 depends on report || org@
41type T;
42constant C;
43identifier ret;
44position p1, p2;
45@@
46T ret@p1 = C;
47... when != ret
48 when strict
49return ret@p2;
50
51@script:python depends on report@
52p1 << r1.p1;
53p2 << r1.p2;
54C << r1.C;
55ret << r1.ret;
56@@
57coccilib.report.print_report(p1[0], "Unneeded variable: \"" + ret + "\". Return \"" + C + "\" on line " + p2[0].line)
58
59@script:python depends on org@
60p1 << r1.p1;
61p2 << r1.p2;
62C << r1.C;
63ret << r1.ret;
64@@
65cocci.print_main("unneeded \"" + ret + "\" variable", p1)
66cocci.print_sec("return " + C + " here", p2)
diff --git a/scripts/config b/scripts/config
index 68041793698c..026aeb4f32ee 100755
--- a/scripts/config
+++ b/scripts/config
@@ -223,4 +223,3 @@ while [ "$1" != "" ] ; do
223 ;; 223 ;;
224 esac 224 esac
225done 225done
226
diff --git a/scripts/conmakehash.c b/scripts/conmakehash.c
index 263a44d57fa9..61bbda54cf13 100644
--- a/scripts/conmakehash.c
+++ b/scripts/conmakehash.c
@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
104 } 104 }
105 } 105 }
106 106
107 /* For now we assume the default font is always 256 characters. */ 107 /* For now we assume the default font is always 256 characters. */
108 fontlen = 256; 108 fontlen = 256;
109 109
110 /* Initialize table */ 110 /* Initialize table */
@@ -236,15 +236,15 @@ int main(int argc, char *argv[])
236 } 236 }
237 237
238 /* Okay, we hit EOF, now output hash table */ 238 /* Okay, we hit EOF, now output hash table */
239 239
240 fclose(ctbl); 240 fclose(ctbl);
241 241
242 242
243 /* Compute total size of Unicode list */ 243 /* Compute total size of Unicode list */
244 nuni = 0; 244 nuni = 0;
245 for ( i = 0 ; i < fontlen ; i++ ) 245 for ( i = 0 ; i < fontlen ; i++ )
246 nuni += unicount[i]; 246 nuni += unicount[i];
247 247
248 printf("\ 248 printf("\
249/*\n\ 249/*\n\
250 * Do not edit this file; it was automatically generated by\n\ 250 * Do not edit this file; it was automatically generated by\n\
@@ -268,9 +268,9 @@ u8 dfont_unicount[%d] = \n\
268 else 268 else
269 printf(", "); 269 printf(", ");
270 } 270 }
271 271
272 printf("\nu16 dfont_unitable[%d] = \n{\n\t", nuni); 272 printf("\nu16 dfont_unitable[%d] = \n{\n\t", nuni);
273 273
274 fp0 = 0; 274 fp0 = 0;
275 nent = 0; 275 nent = 0;
276 for ( i = 0 ; i < nuni ; i++ ) 276 for ( i = 0 ; i < nuni ; i++ )
diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
new file mode 100755
index 000000000000..515c4c00e957
--- /dev/null
+++ b/scripts/decode_stacktrace.sh
@@ -0,0 +1,126 @@
1#!/bin/bash
2# (c) 2014, Sasha Levin <sasha.levin@oracle.com>
3#set -x
4
5if [[ $# != 2 ]]; then
6 echo "Usage:"
7 echo " $0 [vmlinux] [base path]"
8 exit 1
9fi
10
11vmlinux=$1
12basepath=$2
13declare -A cache
14
15parse_symbol() {
16 # The structure of symbol at this point is:
17 # [name]+[offset]/[total length]
18 #
19 # For example:
20 # do_basic_setup+0x9c/0xbf
21
22
23 # Strip the symbol name so that we could look it up
24 local name=${symbol%+*}
25
26 # Use 'nm vmlinux' to figure out the base address of said symbol.
27 # It's actually faster to call it every time than to load it
28 # all into bash.
29 if [[ "${cache[$name]+isset}" == "isset" ]]; then
30 local base_addr=${cache[$name]}
31 else
32 local base_addr=$(nm "$vmlinux" | grep -i ' t ' | awk "/ $name\$/ {print \$1}" | head -n1)
33 cache["$name"]="$base_addr"
34 fi
35 # Let's start doing the math to get the exact address into the
36 # symbol. First, strip out the symbol total length.
37 local expr=${symbol%/*}
38
39 # Now, replace the symbol name with the base address we found
40 # before.
41 expr=${expr/$name/0x$base_addr}
42
43 # Evaluate it to find the actual address
44 expr=$((expr))
45 local address=$(printf "%x\n" "$expr")
46
47 # Pass it to addr2line to get filename and line number
48 # Could get more than one result
49 if [[ "${cache[$address]+isset}" == "isset" ]]; then
50 local code=${cache[$address]}
51 else
52 local code=$(addr2line -i -e "$vmlinux" "$address")
53 cache[$address]=$code
54 fi
55
56 # addr2line doesn't return a proper error code if it fails, so
57 # we detect it using the value it prints so that we could preserve
58 # the offset/size into the function and bail out
59 if [[ $code == "??:0" ]]; then
60 return
61 fi
62
63 # Strip out the base of the path
64 code=${code//$basepath/""}
65
66 # In the case of inlines, move everything to same line
67 code=${code//$'\n'/' '}
68
69 # Replace old address with pretty line numbers
70 symbol="$name ($code)"
71}
72
73decode_code() {
74 local scripts=`dirname "${BASH_SOURCE[0]}"`
75
76 echo "$1" | $scripts/decodecode
77}
78
79handle_line() {
80 local words
81
82 # Tokenize
83 read -a words <<<"$1"
84
85 # Remove hex numbers. Do it ourselves until it happens in the
86 # kernel
87
88 # We need to know the index of the last element before we
89 # remove elements because arrays are sparse
90 local last=$(( ${#words[@]} - 1 ))
91
92 for i in "${!words[@]}"; do
93 # Remove the address
94 if [[ ${words[$i]} =~ \[\<([^]]+)\>\] ]]; then
95 unset words[$i]
96 fi
97
98 # Format timestamps with tabs
99 if [[ ${words[$i]} == \[ && ${words[$i+1]} == *\] ]]; then
100 unset words[$i]
101 words[$i+1]=$(printf "[%13s\n" "${words[$i+1]}")
102 fi
103 done
104
105 # The symbol is the last element, process it
106 symbol=${words[$last]}
107 unset words[$last]
108 parse_symbol # modifies $symbol
109
110 # Add up the line number to the symbol
111 echo "${words[@]}" "$symbol"
112}
113
114while read line; do
115 # Let's see if we have an address in the line
116 if [[ $line =~ \[\<([^]]+)\>\] ]]; then
117 # Translate address to line numbers
118 handle_line "$line"
119 # Is it a code line?
120 elif [[ $line == *Code:* ]]; then
121 decode_code "$line"
122 else
123 # Nothing special in this line, show it as is
124 echo "$line"
125 fi
126done
diff --git a/scripts/docproc.c b/scripts/docproc.c
index 2b69eaf5b646..e267e621431a 100644
--- a/scripts/docproc.c
+++ b/scripts/docproc.c
@@ -154,7 +154,7 @@ int symfilecnt = 0;
154static void add_new_symbol(struct symfile *sym, char * symname) 154static void add_new_symbol(struct symfile *sym, char * symname)
155{ 155{
156 sym->symbollist = 156 sym->symbollist =
157 realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *)); 157 realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *));
158 sym->symbollist[sym->symbolcnt++].name = strdup(symname); 158 sym->symbollist[sym->symbolcnt++].name = strdup(symname);
159} 159}
160 160
@@ -215,7 +215,7 @@ static void find_export_symbols(char * filename)
215 char *p; 215 char *p;
216 char *e; 216 char *e;
217 if (((p = strstr(line, "EXPORT_SYMBOL_GPL")) != NULL) || 217 if (((p = strstr(line, "EXPORT_SYMBOL_GPL")) != NULL) ||
218 ((p = strstr(line, "EXPORT_SYMBOL")) != NULL)) { 218 ((p = strstr(line, "EXPORT_SYMBOL")) != NULL)) {
219 /* Skip EXPORT_SYMBOL{_GPL} */ 219 /* Skip EXPORT_SYMBOL{_GPL} */
220 while (isalnum(*p) || *p == '_') 220 while (isalnum(*p) || *p == '_')
221 p++; 221 p++;
@@ -291,28 +291,28 @@ static void extfunc(char * filename) { docfunctions(filename, FUNCTION); }
291static void singfunc(char * filename, char * line) 291static void singfunc(char * filename, char * line)
292{ 292{
293 char *vec[200]; /* Enough for specific functions */ 293 char *vec[200]; /* Enough for specific functions */
294 int i, idx = 0; 294 int i, idx = 0;
295 int startofsym = 1; 295 int startofsym = 1;
296 vec[idx++] = KERNELDOC; 296 vec[idx++] = KERNELDOC;
297 vec[idx++] = DOCBOOK; 297 vec[idx++] = DOCBOOK;
298 vec[idx++] = SHOWNOTFOUND; 298 vec[idx++] = SHOWNOTFOUND;
299 299
300 /* Split line up in individual parameters preceded by FUNCTION */ 300 /* Split line up in individual parameters preceded by FUNCTION */
301 for (i=0; line[i]; i++) { 301 for (i=0; line[i]; i++) {
302 if (isspace(line[i])) { 302 if (isspace(line[i])) {
303 line[i] = '\0'; 303 line[i] = '\0';
304 startofsym = 1; 304 startofsym = 1;
305 continue; 305 continue;
306 } 306 }
307 if (startofsym) { 307 if (startofsym) {
308 startofsym = 0; 308 startofsym = 0;
309 vec[idx++] = FUNCTION; 309 vec[idx++] = FUNCTION;
310 vec[idx++] = &line[i]; 310 vec[idx++] = &line[i];
311 } 311 }
312 } 312 }
313 for (i = 0; i < idx; i++) { 313 for (i = 0; i < idx; i++) {
314 if (strcmp(vec[i], FUNCTION)) 314 if (strcmp(vec[i], FUNCTION))
315 continue; 315 continue;
316 consume_symbol(vec[i + 1]); 316 consume_symbol(vec[i + 1]);
317 } 317 }
318 vec[idx++] = filename; 318 vec[idx++] = filename;
@@ -460,14 +460,14 @@ static void parse_file(FILE *infile)
460 break; 460 break;
461 case 'D': 461 case 'D':
462 while (*s && !isspace(*s)) s++; 462 while (*s && !isspace(*s)) s++;
463 *s = '\0'; 463 *s = '\0';
464 symbolsonly(line+2); 464 symbolsonly(line+2);
465 break; 465 break;
466 case 'F': 466 case 'F':
467 /* filename */ 467 /* filename */
468 while (*s && !isspace(*s)) s++; 468 while (*s && !isspace(*s)) s++;
469 *s++ = '\0'; 469 *s++ = '\0';
470 /* function names */ 470 /* function names */
471 while (isspace(*s)) 471 while (isspace(*s))
472 s++; 472 s++;
473 singlefunctions(line +2, s); 473 singlefunctions(line +2, s);
@@ -515,11 +515,11 @@ int main(int argc, char *argv[])
515 } 515 }
516 /* Open file, exit on error */ 516 /* Open file, exit on error */
517 infile = fopen(argv[2], "r"); 517 infile = fopen(argv[2], "r");
518 if (infile == NULL) { 518 if (infile == NULL) {
519 fprintf(stderr, "docproc: "); 519 fprintf(stderr, "docproc: ");
520 perror(argv[2]); 520 perror(argv[2]);
521 exit(2); 521 exit(2);
522 } 522 }
523 523
524 if (strcmp("doc", argv[1]) == 0) { 524 if (strcmp("doc", argv[1]) == 0) {
525 /* Need to do this in two passes. 525 /* Need to do this in two passes.
diff --git a/scripts/dtc/.gitignore b/scripts/dtc/.gitignore
index 095acb49a374..cdabdc95a6e7 100644
--- a/scripts/dtc/.gitignore
+++ b/scripts/dtc/.gitignore
@@ -2,4 +2,3 @@ dtc
2dtc-lexer.lex.c 2dtc-lexer.lex.c
3dtc-parser.tab.c 3dtc-parser.tab.c
4dtc-parser.tab.h 4dtc-parser.tab.h
5
diff --git a/scripts/dtc/fstree.c b/scripts/dtc/fstree.c
index f3774530170a..e464727c8808 100644
--- a/scripts/dtc/fstree.c
+++ b/scripts/dtc/fstree.c
@@ -88,4 +88,3 @@ struct boot_info *dt_from_fs(const char *dirname)
88 88
89 return build_boot_info(NULL, tree, guess_boot_cpuid(tree)); 89 return build_boot_info(NULL, tree, guess_boot_cpuid(tree));
90} 90}
91
diff --git a/scripts/dtc/libfdt/fdt_empty_tree.c b/scripts/dtc/libfdt/fdt_empty_tree.c
index f72d13b1d19c..f2ae9b77c285 100644
--- a/scripts/dtc/libfdt/fdt_empty_tree.c
+++ b/scripts/dtc/libfdt/fdt_empty_tree.c
@@ -81,4 +81,3 @@ int fdt_create_empty_tree(void *buf, int bufsize)
81 81
82 return fdt_open_into(buf, buf, bufsize); 82 return fdt_open_into(buf, buf, bufsize);
83} 83}
84
diff --git a/scripts/dtc/treesource.c b/scripts/dtc/treesource.c
index 33eeba55fb4d..5740e6992d37 100644
--- a/scripts/dtc/treesource.c
+++ b/scripts/dtc/treesource.c
@@ -281,4 +281,3 @@ void dt_to_source(FILE *f, struct boot_info *bi)
281 281
282 write_tree_source_node(f, bi->dt, 0); 282 write_tree_source_node(f, bi->dt, 0);
283} 283}
284
diff --git a/scripts/headers.sh b/scripts/headers.sh
index 978b42b3acd7..95ece06599a5 100755
--- a/scripts/headers.sh
+++ b/scripts/headers.sh
@@ -28,5 +28,3 @@ for arch in ${archs}; do
28 ;; 28 ;;
29 esac 29 esac
30done 30done
31
32
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 1237dd7fb4ca..dc7aa45e80ce 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -123,7 +123,7 @@ static int read_symbol(FILE *in, struct sym_entry *s)
123 } 123 }
124 if (strlen(str) > KSYM_NAME_LEN) { 124 if (strlen(str) > KSYM_NAME_LEN) {
125 fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n" 125 fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n"
126 "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n", 126 "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
127 str, strlen(str), KSYM_NAME_LEN); 127 str, strlen(str), KSYM_NAME_LEN);
128 return -1; 128 return -1;
129 } 129 }
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 844bc9da08da..9c4d2412fb72 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -33,11 +33,11 @@ oldconfig: $(obj)/conf
33 $< --$@ $(Kconfig) 33 $< --$@ $(Kconfig)
34 34
35silentoldconfig: $(obj)/conf 35silentoldconfig: $(obj)/conf
36 $(Q)mkdir -p include/generated 36 $(Q)mkdir -p include/config include/generated
37 $< --$@ $(Kconfig) 37 $< --$@ $(Kconfig)
38 38
39localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf 39localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
40 $(Q)mkdir -p include/generated 40 $(Q)mkdir -p include/config include/generated
41 $(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config 41 $(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config
42 $(Q)if [ -f .config ]; then \ 42 $(Q)if [ -f .config ]; then \
43 cmp -s .tmp.config .config || \ 43 cmp -s .tmp.config .config || \
@@ -319,4 +319,3 @@ $(obj)/%.moc: $(src)/%.h $(obj)/.tmp_qtcheck
319$(obj)/gconf.glade.h: $(obj)/gconf.glade 319$(obj)/gconf.glade.h: $(obj)/gconf.glade
320 $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \ 320 $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
321 $(obj)/gconf.glade 321 $(obj)/gconf.glade
322
diff --git a/scripts/kconfig/check.sh b/scripts/kconfig/check.sh
index 854d9c7c675c..55b79ba1ba2a 100755
--- a/scripts/kconfig/check.sh
+++ b/scripts/kconfig/check.sh
@@ -11,4 +11,3 @@ EOF
11if [ ! "$?" -eq "0" ]; then 11if [ ! "$?" -eq "0" ]; then
12 echo -DKBUILD_NO_NLS; 12 echo -DKBUILD_NO_NLS;
13fi 13fi
14
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index d19944f9c3ac..fef75fc756f4 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -696,7 +696,7 @@ int main(int ac, char **av)
696 } else if (input_mode == savedefconfig) { 696 } else if (input_mode == savedefconfig) {
697 if (conf_write_defconfig(defconfig_file)) { 697 if (conf_write_defconfig(defconfig_file)) {
698 fprintf(stderr, _("n*** Error while saving defconfig to: %s\n\n"), 698 fprintf(stderr, _("n*** Error while saving defconfig to: %s\n\n"),
699 defconfig_file); 699 defconfig_file);
700 return 1; 700 return 1;
701 } 701 }
702 } else if (input_mode != listnewconfig) { 702 } else if (input_mode != listnewconfig) {
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index f2bee70e26f4..d0a35b21f308 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -1404,7 +1404,7 @@ static void display_tree(struct menu *menu)
1404 && (tree == tree2)) 1404 && (tree == tree2))
1405 continue; 1405 continue;
1406/* 1406/*
1407 if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT)) 1407 if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT))
1408 || (view_mode == FULL_VIEW) 1408 || (view_mode == FULL_VIEW)
1409 || (view_mode == SPLIT_VIEW))*/ 1409 || (view_mode == SPLIT_VIEW))*/
1410 1410
diff --git a/scripts/kconfig/lxdialog/checklist.c b/scripts/kconfig/lxdialog/checklist.c
index 3b15c08ec1fa..8d016faa28d7 100644
--- a/scripts/kconfig/lxdialog/checklist.c
+++ b/scripts/kconfig/lxdialog/checklist.c
@@ -168,13 +168,13 @@ do_resize:
168 168
169 /* create new window for the list */ 169 /* create new window for the list */
170 list = subwin(dialog, list_height, list_width, y + box_y + 1, 170 list = subwin(dialog, list_height, list_width, y + box_y + 1,
171 x + box_x + 1); 171 x + box_x + 1);
172 172
173 keypad(list, TRUE); 173 keypad(list, TRUE);
174 174
175 /* draw a box around the list items */ 175 /* draw a box around the list items */
176 draw_box(dialog, box_y, box_x, list_height + 2, list_width + 2, 176 draw_box(dialog, box_y, box_x, list_height + 2, list_width + 2,
177 dlg.menubox_border.atr, dlg.menubox.atr); 177 dlg.menubox_border.atr, dlg.menubox.atr);
178 178
179 /* Find length of longest item in order to center checklist */ 179 /* Find length of longest item in order to center checklist */
180 check_x = 0; 180 check_x = 0;
diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c
index 447a582198c9..d58de1dc5360 100644
--- a/scripts/kconfig/lxdialog/inputbox.c
+++ b/scripts/kconfig/lxdialog/inputbox.c
@@ -42,7 +42,7 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
42 * Display a dialog box for inputing a string 42 * Display a dialog box for inputing a string
43 */ 43 */
44int dialog_inputbox(const char *title, const char *prompt, int height, int width, 44int dialog_inputbox(const char *title, const char *prompt, int height, int width,
45 const char *init) 45 const char *init)
46{ 46{
47 int i, x, y, box_y, box_x, box_width; 47 int i, x, y, box_y, box_x, box_width;
48 int input_x = 0, key = 0, button = -1; 48 int input_x = 0, key = 0, button = -1;
diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
index c93de0b2faca..11ae9ad7ac7b 100644
--- a/scripts/kconfig/lxdialog/menubox.c
+++ b/scripts/kconfig/lxdialog/menubox.c
@@ -64,7 +64,7 @@ static int menu_width, item_x;
64 * Print menu item 64 * Print menu item
65 */ 65 */
66static void do_print_item(WINDOW * win, const char *item, int line_y, 66static void do_print_item(WINDOW * win, const char *item, int line_y,
67 int selected, int hotkey) 67 int selected, int hotkey)
68{ 68{
69 int j; 69 int j;
70 char *menu_item = malloc(menu_width + 1); 70 char *menu_item = malloc(menu_width + 1);
@@ -182,7 +182,7 @@ static void do_scroll(WINDOW *win, int *scroll, int n)
182 * Display a menu for choosing among a number of options 182 * Display a menu for choosing among a number of options
183 */ 183 */
184int dialog_menu(const char *title, const char *prompt, 184int dialog_menu(const char *title, const char *prompt,
185 const void *selected, int *s_scroll) 185 const void *selected, int *s_scroll)
186{ 186{
187 int i, j, x, y, box_x, box_y; 187 int i, j, x, y, box_x, box_y;
188 int height, width, menu_height; 188 int height, width, menu_height;
diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c
index 58a8289dd650..f7abdeb92af0 100644
--- a/scripts/kconfig/lxdialog/util.c
+++ b/scripts/kconfig/lxdialog/util.c
@@ -623,7 +623,7 @@ void item_make(const char *fmt, ...)
623void item_add_str(const char *fmt, ...) 623void item_add_str(const char *fmt, ...)
624{ 624{
625 va_list ap; 625 va_list ap;
626 size_t avail; 626 size_t avail;
627 627
628 avail = sizeof(item_cur->node.str) - strlen(item_cur->node.str); 628 avail = sizeof(item_cur->node.str) - strlen(item_cur->node.str);
629 629
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 59184bb41ef8..14cea7463a62 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -299,7 +299,7 @@ static void set_config_filename(const char *config_filename)
299 int size; 299 int size;
300 300
301 size = snprintf(menu_backtitle, sizeof(menu_backtitle), 301 size = snprintf(menu_backtitle, sizeof(menu_backtitle),
302 "%s - %s", config_filename, rootmenu.prompt->text); 302 "%s - %s", config_filename, rootmenu.prompt->text);
303 if (size >= sizeof(menu_backtitle)) 303 if (size >= sizeof(menu_backtitle))
304 menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; 304 menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
305 set_dialog_backtitle(menu_backtitle); 305 set_dialog_backtitle(menu_backtitle);
@@ -1034,4 +1034,3 @@ int main(int ac, char **av)
1034 1034
1035 return res; 1035 return res;
1036} 1036}
1037
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 3ac2c9c6e280..a26cc5d2a9b0 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -258,8 +258,8 @@ static void sym_check_prop(struct symbol *sym)
258 "config symbol '%s' uses select, but is " 258 "config symbol '%s' uses select, but is "
259 "not boolean or tristate", sym->name); 259 "not boolean or tristate", sym->name);
260 else if (sym2->type != S_UNKNOWN && 260 else if (sym2->type != S_UNKNOWN &&
261 sym2->type != S_BOOLEAN && 261 sym2->type != S_BOOLEAN &&
262 sym2->type != S_TRISTATE) 262 sym2->type != S_TRISTATE)
263 prop_warn(prop, 263 prop_warn(prop,
264 "'%s' has wrong type. 'select' only " 264 "'%s' has wrong type. 'select' only "
265 "accept arguments of boolean and " 265 "accept arguments of boolean and "
@@ -268,7 +268,7 @@ static void sym_check_prop(struct symbol *sym)
268 case P_RANGE: 268 case P_RANGE:
269 if (sym->type != S_INT && sym->type != S_HEX) 269 if (sym->type != S_INT && sym->type != S_HEX)
270 prop_warn(prop, "range is only allowed " 270 prop_warn(prop, "range is only allowed "
271 "for int or hex symbols"); 271 "for int or hex symbols");
272 if (!menu_validate_number(sym, prop->expr->left.sym) || 272 if (!menu_validate_number(sym, prop->expr->left.sym) ||
273 !menu_validate_number(sym, prop->expr->right.sym)) 273 !menu_validate_number(sym, prop->expr->right.sym))
274 prop_warn(prop, "range is invalid"); 274 prop_warn(prop, "range is invalid");
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index 4fbecd2473bc..984489ef2b46 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -1554,4 +1554,3 @@ int main(int ac, char **av)
1554 endwin(); 1554 endwin();
1555 return 0; 1555 return 0;
1556} 1556}
1557
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 31331723e810..9cb8522d8d22 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -589,7 +589,7 @@ while ($repeat) {
589 589
590 # Now we need to see if we have to check selects; 590 # Now we need to see if we have to check selects;
591 loop_select; 591 loop_select;
592} 592}
593 593
594my %setconfigs; 594my %setconfigs;
595 595
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index 6e7fbf196809..94f9c83e324f 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -155,5 +155,3 @@ void *xcalloc(size_t nmemb, size_t size)
155 fprintf(stderr, "Out of memory.\n"); 155 fprintf(stderr, "Out of memory.\n");
156 exit(1); 156 exit(1);
157} 157}
158
159
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 1a9f53e535ca..6c62d93b4ffb 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -27,8 +27,8 @@ static char *text;
27static int text_size, text_asize; 27static int text_size, text_asize;
28 28
29struct buffer { 29struct buffer {
30 struct buffer *parent; 30 struct buffer *parent;
31 YY_BUFFER_STATE state; 31 YY_BUFFER_STATE state;
32}; 32};
33 33
34struct buffer *current_buf; 34struct buffer *current_buf;
diff --git a/scripts/kconfig/zconf.lex.c_shipped b/scripts/kconfig/zconf.lex.c_shipped
index a0521aa5974b..349a7f24315b 100644
--- a/scripts/kconfig/zconf.lex.c_shipped
+++ b/scripts/kconfig/zconf.lex.c_shipped
@@ -789,8 +789,8 @@ static char *text;
789static int text_size, text_asize; 789static int text_size, text_asize;
790 790
791struct buffer { 791struct buffer {
792 struct buffer *parent; 792 struct buffer *parent;
793 YY_BUFFER_STATE state; 793 YY_BUFFER_STATE state;
794}; 794};
795 795
796struct buffer *current_buf; 796struct buffer *current_buf;
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped
index 25ae16ac75c8..de5e84ed3f96 100644
--- a/scripts/kconfig/zconf.tab.c_shipped
+++ b/scripts/kconfig/zconf.tab.c_shipped
@@ -2314,7 +2314,7 @@ void conf_parse(const char *name)
2314 for_all_symbols(i, sym) { 2314 for_all_symbols(i, sym) {
2315 if (sym_check_deps(sym)) 2315 if (sym_check_deps(sym))
2316 zconfnerrs++; 2316 zconfnerrs++;
2317 } 2317 }
2318 if (zconfnerrs) 2318 if (zconfnerrs)
2319 exit(1); 2319 exit(1);
2320 sym_set_change_count(1); 2320 sym_set_change_count(1);
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 0653886fac48..0f683cfa53e9 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -510,7 +510,7 @@ void conf_parse(const char *name)
510 for_all_symbols(i, sym) { 510 for_all_symbols(i, sym) {
511 if (sym_check_deps(sym)) 511 if (sym_check_deps(sym))
512 zconfnerrs++; 512 zconfnerrs++;
513 } 513 }
514 if (zconfnerrs) 514 if (zconfnerrs)
515 exit(1); 515 exit(1);
516 sym_set_change_count(1); 516 sym_set_change_count(1);
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index da058da413e7..16a07cfa4d34 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -2073,6 +2073,7 @@ sub check_return_section {
2073sub dump_function($$) { 2073sub dump_function($$) {
2074 my $prototype = shift; 2074 my $prototype = shift;
2075 my $file = shift; 2075 my $file = shift;
2076 my $noret = 0;
2076 2077
2077 $prototype =~ s/^static +//; 2078 $prototype =~ s/^static +//;
2078 $prototype =~ s/^extern +//; 2079 $prototype =~ s/^extern +//;
@@ -2086,7 +2087,7 @@ sub dump_function($$) {
2086 $prototype =~ s/__init_or_module +//; 2087 $prototype =~ s/__init_or_module +//;
2087 $prototype =~ s/__must_check +//; 2088 $prototype =~ s/__must_check +//;
2088 $prototype =~ s/__weak +//; 2089 $prototype =~ s/__weak +//;
2089 $prototype =~ s/^#\s*define\s+//; #ak added 2090 my $define = $prototype =~ s/^#\s*define\s+//; #ak added
2090 $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; 2091 $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//;
2091 2092
2092 # Yes, this truly is vile. We are looking for: 2093 # Yes, this truly is vile. We are looking for:
@@ -2105,7 +2106,15 @@ sub dump_function($$) {
2105 # - atomic_set (macro) 2106 # - atomic_set (macro)
2106 # - pci_match_device, __copy_to_user (long return type) 2107 # - pci_match_device, __copy_to_user (long return type)
2107 2108
2108 if ($prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || 2109 if ($define && $prototype =~ m/^()([a-zA-Z0-9_~:]+)\s+/) {
2110 # This is an object-like macro, it has no return type and no parameter
2111 # list.
2112 # Function-like macros are not allowed to have spaces between
2113 # declaration_name and opening parenthesis (notice the \s+).
2114 $return_type = $1;
2115 $declaration_name = $2;
2116 $noret = 1;
2117 } elsif ($prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
2109 $prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || 2118 $prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
2110 $prototype =~ m/^(\w+\s*\*)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || 2119 $prototype =~ m/^(\w+\s*\*)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
2111 $prototype =~ m/^(\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || 2120 $prototype =~ m/^(\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
@@ -2140,7 +2149,7 @@ sub dump_function($$) {
2140 # of warnings goes sufficiently down, the check is only performed in 2149 # of warnings goes sufficiently down, the check is only performed in
2141 # verbose mode. 2150 # verbose mode.
2142 # TODO: always perform the check. 2151 # TODO: always perform the check.
2143 if ($verbose) { 2152 if ($verbose && !$noret) {
2144 check_return_section($file, $declaration_name, $return_type); 2153 check_return_section($file, $declaration_name, $return_type);
2145 } 2154 }
2146 2155
diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl
index 827896f56501..c21d16328d3f 100644
--- a/scripts/markup_oops.pl
+++ b/scripts/markup_oops.pl
@@ -367,4 +367,3 @@ OPTION:
367EOT 367EOT
368 exit; 368 exit;
369} 369}
370
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index cfb8440cc0b2..6fdc97ef6023 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -68,7 +68,7 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
68 68
69( echo /\* This file is auto generated, version $VERSION \*/ 69( echo /\* This file is auto generated, version $VERSION \*/
70 if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi 70 if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi
71 71
72 echo \#define UTS_MACHINE \"$ARCH\" 72 echo \#define UTS_MACHINE \"$ARCH\"
73 73
74 echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\" 74 echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
@@ -84,7 +84,7 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
84# recompilations. 84# recompilations.
85# We don't consider the file changed if only the date/time changed. 85# We don't consider the file changed if only the date/time changed.
86# A kernel config change will increase the generation number, thus 86# A kernel config change will increase the generation number, thus
87# causing compile.h to be updated (including date/time) due to the 87# causing compile.h to be updated (including date/time) due to the
88# changed comment in the 88# changed comment in the
89# first line. 89# first line.
90 90
diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index 0cc044260744..84af27bf0f99 100644
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -42,18 +42,11 @@ MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$
42 42
43MAKEFLAGS += --no-print-directory 43MAKEFLAGS += --no-print-directory
44 44
45.PHONY: all \$(MAKECMDGOALS) 45.PHONY: __sub-make \$(MAKECMDGOALS)
46 46
47all := \$(filter-out all Makefile,\$(MAKECMDGOALS)) 47__sub-make:
48 \$(Q)\$(MAKE) \$(MAKEARGS) \$(MAKECMDGOALS)
48 49
49all: 50\$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make
50 \$(Q)\$(MAKE) \$(MAKEARGS) \$(all)
51
52Makefile:;
53
54\$(all): all
55 @:
56
57%/: all
58 @: 51 @:
59EOF 52EOF
diff --git a/scripts/mksysmap b/scripts/mksysmap
index c1b6191ef879..7ada35a0f478 100644
--- a/scripts/mksysmap
+++ b/scripts/mksysmap
@@ -42,4 +42,3 @@
42# (At least sparc64 has __crc_ in the middle). 42# (At least sparc64 has __crc_ in the middle).
43 43
44$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)' > $2 44$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)' > $2
45
diff --git a/scripts/mod/.gitignore b/scripts/mod/.gitignore
index 33bae0df4de5..3bd11b603173 100644
--- a/scripts/mod/.gitignore
+++ b/scripts/mod/.gitignore
@@ -2,4 +2,3 @@ elfconfig.h
2mk_elfconfig 2mk_elfconfig
3modpost 3modpost
4devicetable-offsets.h 4devicetable-offsets.h
5
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 1924990a737f..e614ef689eee 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -644,28 +644,26 @@ ADD_TO_DEVTABLE("pcmcia", pcmcia_device_id, do_pcmcia_entry);
644 644
645static int do_of_entry (const char *filename, void *symval, char *alias) 645static int do_of_entry (const char *filename, void *symval, char *alias)
646{ 646{
647 int len; 647 int len;
648 char *tmp; 648 char *tmp;
649 DEF_FIELD_ADDR(symval, of_device_id, name); 649 DEF_FIELD_ADDR(symval, of_device_id, name);
650 DEF_FIELD_ADDR(symval, of_device_id, type); 650 DEF_FIELD_ADDR(symval, of_device_id, type);
651 DEF_FIELD_ADDR(symval, of_device_id, compatible); 651 DEF_FIELD_ADDR(symval, of_device_id, compatible);
652 652
653 len = sprintf (alias, "of:N%sT%s", 653 len = sprintf(alias, "of:N%sT%s", (*name)[0] ? *name : "*",
654 (*name)[0] ? *name : "*", 654 (*type)[0] ? *type : "*");
655 (*type)[0] ? *type : "*"); 655
656 656 if (compatible[0])
657 if (compatible[0]) 657 sprintf(&alias[len], "%sC%s", (*type)[0] ? "*" : "",
658 sprintf (&alias[len], "%sC%s", 658 *compatible);
659 (*type)[0] ? "*" : "", 659
660 *compatible); 660 /* Replace all whitespace with underscores */
661 661 for (tmp = alias; tmp && *tmp; tmp++)
662 /* Replace all whitespace with underscores */ 662 if (isspace (*tmp))
663 for (tmp = alias; tmp && *tmp; tmp++) 663 *tmp = '_';
664 if (isspace (*tmp)) 664
665 *tmp = '_'; 665 add_wildcard(alias);
666 666 return 1;
667 add_wildcard(alias);
668 return 1;
669} 667}
670ADD_TO_DEVTABLE("of", of_device_id, do_of_entry); 668ADD_TO_DEVTABLE("of", of_device_id, do_of_entry);
671 669
diff --git a/scripts/mod/mk_elfconfig.c b/scripts/mod/mk_elfconfig.c
index 639bca7ba559..a4fd71d71d65 100644
--- a/scripts/mod/mk_elfconfig.c
+++ b/scripts/mod/mk_elfconfig.c
@@ -54,4 +54,3 @@ main(int argc, char **argv)
54 54
55 return 0; 55 return 0;
56} 56}
57
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 066355673930..9d9c5b905b35 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -316,7 +316,7 @@ static struct symbol *sym_add_exported(const char *name, struct module *mod,
316 s->module->name, 316 s->module->name,
317 is_vmlinux(s->module->name) ?"":".ko"); 317 is_vmlinux(s->module->name) ?"":".ko");
318 } else { 318 } else {
319 /* In case Modules.symvers was out of date */ 319 /* In case Module.symvers was out of date */
320 s->module = mod; 320 s->module = mod;
321 } 321 }
322 } 322 }
@@ -862,7 +862,7 @@ static const char *section_white_list[] =
862 * without "ax" / "aw". 862 * without "ax" / "aw".
863 */ 863 */
864static void check_section(const char *modname, struct elf_info *elf, 864static void check_section(const char *modname, struct elf_info *elf,
865 Elf_Shdr *sechdr) 865 Elf_Shdr *sechdr)
866{ 866{
867 const char *sec = sech_name(elf, sechdr); 867 const char *sec = sech_name(elf, sechdr);
868 868
@@ -1296,12 +1296,12 @@ static void print_section_list(const char * const list[20])
1296 */ 1296 */
1297static void report_sec_mismatch(const char *modname, 1297static void report_sec_mismatch(const char *modname,
1298 const struct sectioncheck *mismatch, 1298 const struct sectioncheck *mismatch,
1299 const char *fromsec, 1299 const char *fromsec,
1300 unsigned long long fromaddr, 1300 unsigned long long fromaddr,
1301 const char *fromsym, 1301 const char *fromsym,
1302 int from_is_func, 1302 int from_is_func,
1303 const char *tosec, const char *tosym, 1303 const char *tosec, const char *tosym,
1304 int to_is_func) 1304 int to_is_func)
1305{ 1305{
1306 const char *from, *from_p; 1306 const char *from, *from_p;
1307 const char *to, *to_p; 1307 const char *to, *to_p;
@@ -1441,7 +1441,7 @@ static void report_sec_mismatch(const char *modname,
1441} 1441}
1442 1442
1443static void check_section_mismatch(const char *modname, struct elf_info *elf, 1443static void check_section_mismatch(const char *modname, struct elf_info *elf,
1444 Elf_Rela *r, Elf_Sym *sym, const char *fromsec) 1444 Elf_Rela *r, Elf_Sym *sym, const char *fromsec)
1445{ 1445{
1446 const char *tosec; 1446 const char *tosec;
1447 const struct sectioncheck *mismatch; 1447 const struct sectioncheck *mismatch;
@@ -1528,7 +1528,7 @@ static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
1528 case R_ARM_ABS32: 1528 case R_ARM_ABS32:
1529 /* From ARM ABI: (S + A) | T */ 1529 /* From ARM ABI: (S + A) | T */
1530 r->r_addend = (int)(long) 1530 r->r_addend = (int)(long)
1531 (elf->symtab_start + ELF_R_SYM(r->r_info)); 1531 (elf->symtab_start + ELF_R_SYM(r->r_info));
1532 break; 1532 break;
1533 case R_ARM_PC24: 1533 case R_ARM_PC24:
1534 case R_ARM_CALL: 1534 case R_ARM_CALL:
@@ -1538,8 +1538,8 @@ static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
1538 case R_ARM_THM_JUMP19: 1538 case R_ARM_THM_JUMP19:
1539 /* From ARM ABI: ((S + A) | T) - P */ 1539 /* From ARM ABI: ((S + A) | T) - P */
1540 r->r_addend = (int)(long)(elf->hdr + 1540 r->r_addend = (int)(long)(elf->hdr +
1541 sechdr->sh_offset + 1541 sechdr->sh_offset +
1542 (r->r_offset - sechdr->sh_addr)); 1542 (r->r_offset - sechdr->sh_addr));
1543 break; 1543 break;
1544 default: 1544 default:
1545 return 1; 1545 return 1;
@@ -1571,7 +1571,7 @@ static int addend_mips_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
1571} 1571}
1572 1572
1573static void section_rela(const char *modname, struct elf_info *elf, 1573static void section_rela(const char *modname, struct elf_info *elf,
1574 Elf_Shdr *sechdr) 1574 Elf_Shdr *sechdr)
1575{ 1575{
1576 Elf_Sym *sym; 1576 Elf_Sym *sym;
1577 Elf_Rela *rela; 1577 Elf_Rela *rela;
@@ -1615,7 +1615,7 @@ static void section_rela(const char *modname, struct elf_info *elf,
1615} 1615}
1616 1616
1617static void section_rel(const char *modname, struct elf_info *elf, 1617static void section_rel(const char *modname, struct elf_info *elf,
1618 Elf_Shdr *sechdr) 1618 Elf_Shdr *sechdr)
1619{ 1619{
1620 Elf_Sym *sym; 1620 Elf_Sym *sym;
1621 Elf_Rel *rel; 1621 Elf_Rel *rel;
@@ -1685,7 +1685,7 @@ static void section_rel(const char *modname, struct elf_info *elf,
1685 * be discarded and warns about it. 1685 * be discarded and warns about it.
1686 **/ 1686 **/
1687static void check_sec_ref(struct module *mod, const char *modname, 1687static void check_sec_ref(struct module *mod, const char *modname,
1688 struct elf_info *elf) 1688 struct elf_info *elf)
1689{ 1689{
1690 int i; 1690 int i;
1691 Elf_Shdr *sechdrs = elf->sechdrs; 1691 Elf_Shdr *sechdrs = elf->sechdrs;
@@ -1945,7 +1945,7 @@ static int add_versions(struct buffer *b, struct module *mod)
1945 s->name, mod->name); 1945 s->name, mod->name);
1946 } else { 1946 } else {
1947 merror("\"%s\" [%s.ko] undefined!\n", 1947 merror("\"%s\" [%s.ko] undefined!\n",
1948 s->name, mod->name); 1948 s->name, mod->name);
1949 err = 1; 1949 err = 1;
1950 } 1950 }
1951 } 1951 }
@@ -2113,8 +2113,10 @@ static void read_dump(const char *fname, unsigned int kernel)
2113 s->preloaded = 1; 2113 s->preloaded = 1;
2114 sym_update_crc(symname, mod, crc, export_no(export)); 2114 sym_update_crc(symname, mod, crc, export_no(export));
2115 } 2115 }
2116 release_file(file, size);
2116 return; 2117 return;
2117fail: 2118fail:
2119 release_file(file, size);
2118 fatal("parse error in symbol dump file\n"); 2120 fatal("parse error in symbol dump file\n");
2119} 2121}
2120 2122
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c
index deb2994b04c4..944418da9fe3 100644
--- a/scripts/mod/sumversion.c
+++ b/scripts/mod/sumversion.c
@@ -214,7 +214,7 @@ static void md4_final_ascii(struct md4_ctx *mctx, char *out, unsigned int len)
214 mctx->block[14] = mctx->byte_count << 3; 214 mctx->block[14] = mctx->byte_count << 3;
215 mctx->block[15] = mctx->byte_count >> 29; 215 mctx->block[15] = mctx->byte_count >> 29;
216 le32_to_cpu_array(mctx->block, (sizeof(mctx->block) - 216 le32_to_cpu_array(mctx->block, (sizeof(mctx->block) -
217 sizeof(uint64_t)) / sizeof(uint32_t)); 217 sizeof(uint64_t)) / sizeof(uint32_t));
218 md4_transform(mctx->hash, mctx->block); 218 md4_transform(mctx->hash, mctx->block);
219 cpu_to_le32_array(mctx->hash, sizeof(mctx->hash) / sizeof(uint32_t)); 219 cpu_to_le32_array(mctx->hash, sizeof(mctx->hash) / sizeof(uint32_t));
220 220
@@ -367,7 +367,7 @@ static int parse_source_files(const char *objfile, struct md4_ctx *md)
367 break; 367 break;
368 /* Terminate line at first space, to get rid of final ' \' */ 368 /* Terminate line at first space, to get rid of final ' \' */
369 while (*p) { 369 while (*p) {
370 if (isspace(*p)) { 370 if (isspace(*p)) {
371 *p = '\0'; 371 *p = '\0';
372 break; 372 break;
373 } 373 }
diff --git a/scripts/objdiff b/scripts/objdiff
index b3e4f10bfc3e..62e51dae2138 100755
--- a/scripts/objdiff
+++ b/scripts/objdiff
@@ -25,25 +25,47 @@
25# 25#
26# Note: 'make mrproper' will also remove .tmp_objdiff 26# Note: 'make mrproper' will also remove .tmp_objdiff
27 27
28GIT_DIR="`git rev-parse --git-dir`" 28SRCTREE=$(cd $(git rev-parse --show-toplevel 2>/dev/null); pwd)
29 29
30if [ -d "$GIT_DIR" ]; then 30if [ -z "$SRCTREE" ]; then
31 TMPD="${GIT_DIR%git}tmp_objdiff" 31 echo >&2 "ERROR: Not a git repository."
32
33 [ -d "$TMPD" ] || mkdir "$TMPD"
34else
35 echo "ERROR: git directory not found."
36 exit 1 32 exit 1
37fi 33fi
38 34
35TMPD=$SRCTREE/.tmp_objdiff
36
39usage() { 37usage() {
40 echo "Usage: $0 <command> <args>" 38 echo >&2 "Usage: $0 <command> <args>"
41 echo " record <list of object files>" 39 echo >&2 " record <list of object files or directories>"
42 echo " diff <commitA> <commitB>" 40 echo >&2 " diff <commitA> <commitB>"
43 echo " clean all | <commit>" 41 echo >&2 " clean all | <commit>"
44 exit 1 42 exit 1
45} 43}
46 44
45get_output_dir() {
46 dir=${1%/*}
47
48 if [ "$dir" = "$1" ]; then
49 dir=.
50 fi
51
52 dir=$(cd $dir; pwd)
53
54 echo $TMPD/$CMT${dir#$SRCTREE}
55}
56
57do_objdump() {
58 dir=$(get_output_dir $1)
59 base=${1##*/}
60 dis=$dir/${base%.o}.dis
61
62 [ ! -d "$dir" ] && mkdir -p $dir
63
64 # remove addresses for a cleaner diff
65 # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and
66 $OBJDUMP -D $1 | sed "s/^[[:space:]]\+[0-9a-f]\+//" > $dis
67}
68
47dorecord() { 69dorecord() {
48 [ $# -eq 0 ] && usage 70 [ $# -eq 0 ] && usage
49 71
@@ -52,20 +74,16 @@ dorecord() {
52 CMT="`git rev-parse --short HEAD`" 74 CMT="`git rev-parse --short HEAD`"
53 75
54 OBJDUMP="${CROSS_COMPILE}objdump" 76 OBJDUMP="${CROSS_COMPILE}objdump"
55 OBJDIFFD="$TMPD/$CMT"
56
57 [ ! -d "$OBJDIFFD" ] && mkdir -p "$OBJDIFFD"
58 77
59 for f in $FILES; do 78 for d in $FILES; do
60 dn="${f%/*}" 79 if [ -d "$d" ]; then
61 bn="${f##*/}" 80 for f in $(find $d -name '*.o')
62 81 do
63 [ ! -d "$OBJDIFFD/$dn" ] && mkdir -p "$OBJDIFFD/$dn" 82 do_objdump $f
64 83 done
65 # remove addresses for a more clear diff 84 else
66 # http://dummdida.tumblr.com/post/60924060451/binary-diff-between-libc-from-scientificlinux-and 85 do_objdump $d
67 $OBJDUMP -D "$f" | sed "s/^[[:space:]]\+[0-9a-f]\+//" \ 86 fi
68 >"$OBJDIFFD/$dn/$bn"
69 done 87 done
70} 88}
71 89
@@ -90,12 +108,12 @@ dodiff() {
90 DSTD="$TMPD/$DST" 108 DSTD="$TMPD/$DST"
91 109
92 if [ ! -d "$SRCD" ]; then 110 if [ ! -d "$SRCD" ]; then
93 echo "ERROR: $SRCD doesn't exist" 111 echo >&2 "ERROR: $SRCD doesn't exist"
94 exit 1 112 exit 1
95 fi 113 fi
96 114
97 if [ ! -d "$DSTD" ]; then 115 if [ ! -d "$DSTD" ]; then
98 echo "ERROR: $DSTD doesn't exist" 116 echo >&2 "ERROR: $DSTD doesn't exist"
99 exit 1 117 exit 1
100 fi 118 fi
101 119
@@ -114,7 +132,7 @@ doclean() {
114 if [ -d "$TMPD/$CMT" ]; then 132 if [ -d "$TMPD/$CMT" ]; then
115 rm -rf $TMPD/$CMT 133 rm -rf $TMPD/$CMT
116 else 134 else
117 echo "$CMT not found" 135 echo >&2 "$CMT not found"
118 fi 136 fi
119 fi 137 fi
120} 138}
@@ -135,7 +153,7 @@ case "$1" in
135 doclean $* 153 doclean $*
136 ;; 154 ;;
137 *) 155 *)
138 echo "Unrecognized command '$1'" 156 echo >&2 "Unrecognized command '$1'"
139 exit 1 157 exit 1
140 ;; 158 ;;
141esac 159esac
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index c5d473393816..99ca6e76eb0a 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -143,4 +143,3 @@ help: FORCE
143 @echo ' perf-targz-src-pkg - Build $(perf-tar).tar.gz source tarball' 143 @echo ' perf-targz-src-pkg - Build $(perf-tar).tar.gz source tarball'
144 @echo ' perf-tarbz2-src-pkg - Build $(perf-tar).tar.bz2 source tarball' 144 @echo ' perf-tarbz2-src-pkg - Build $(perf-tar).tar.bz2 source tarball'
145 @echo ' perf-tarxz-src-pkg - Build $(perf-tar).tar.xz source tarball' 145 @echo ' perf-tarxz-src-pkg - Build $(perf-tar).tar.xz source tarball'
146
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index f46e4dd0558d..35d5a5877d04 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -35,13 +35,15 @@ create_package() {
35 sparc*) 35 sparc*)
36 debarch=sparc ;; 36 debarch=sparc ;;
37 s390*) 37 s390*)
38 debarch=s390 ;; 38 debarch=s390$(grep -q CONFIG_64BIT=y $KCONFIG_CONFIG && echo x || true) ;;
39 ppc*) 39 ppc*)
40 debarch=powerpc ;; 40 debarch=powerpc ;;
41 parisc*) 41 parisc*)
42 debarch=hppa ;; 42 debarch=hppa ;;
43 mips*) 43 mips*)
44 debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;; 44 debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
45 arm64)
46 debarch=arm64 ;;
45 arm*) 47 arm*)
46 debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el || true) ;; 48 debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el || true) ;;
47 *) 49 *)
@@ -130,7 +132,7 @@ if [ "$ARCH" = "um" ] ; then
130 cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map" 132 cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map"
131 cp $KCONFIG_CONFIG "$tmpdir/usr/share/doc/$packagename/config" 133 cp $KCONFIG_CONFIG "$tmpdir/usr/share/doc/$packagename/config"
132 gzip "$tmpdir/usr/share/doc/$packagename/config" 134 gzip "$tmpdir/usr/share/doc/$packagename/config"
133else 135else
134 cp System.map "$tmpdir/boot/System.map-$version" 136 cp System.map "$tmpdir/boot/System.map-$version"
135 cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version" 137 cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version"
136fi 138fi
@@ -155,11 +157,11 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
155 for module in $(find lib/modules/ -name *.ko); do 157 for module in $(find lib/modules/ -name *.ko); do
156 mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module) 158 mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
157 # only keep debug symbols in the debug file 159 # only keep debug symbols in the debug file
158 objcopy --only-keep-debug $module $dbg_dir/usr/lib/debug/$module 160 $OBJCOPY --only-keep-debug $module $dbg_dir/usr/lib/debug/$module
159 # strip original module from debug symbols 161 # strip original module from debug symbols
160 objcopy --strip-debug $module 162 $OBJCOPY --strip-debug $module
161 # then add a link to those 163 # then add a link to those
162 objcopy --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module 164 $OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
163 done 165 done
164 ) 166 )
165 fi 167 fi
@@ -287,14 +289,16 @@ EOF
287 289
288fi 290fi
289 291
290# Build header package 292# Build kernel header package
291(cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles") 293(cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl) > "$objtree/debian/hdrsrcfiles"
292(cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles") 294(cd $srctree; find arch/$SRCARCH/include include scripts -type f) >> "$objtree/debian/hdrsrcfiles"
293(cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles") 295(cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> "$objtree/debian/hdrsrcfiles"
296(cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> "$objtree/debian/hdrsrcfiles"
297(cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles"
294destdir=$kernel_headers_dir/usr/src/linux-headers-$version 298destdir=$kernel_headers_dir/usr/src/linux-headers-$version
295mkdir -p "$destdir" 299mkdir -p "$destdir"
296(cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -) 300(cd $srctree; tar -c -f - -T -) < "$objtree/debian/hdrsrcfiles" | (cd $destdir; tar -xf -)
297(cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -) 301(cd $objtree; tar -c -f - -T -) < "$objtree/debian/hdrobjfiles" | (cd $destdir; tar -xf -)
298(cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be 302(cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be
299ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build" 303ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build"
300rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles" 304rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index aa22f9447ddc..e046bff33589 100644
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -125,15 +125,13 @@ esac
125# Create the tarball 125# Create the tarball
126# 126#
127( 127(
128 cd "${tmpdir}"
129 opts= 128 opts=
130 if tar --owner=root --group=root --help >/dev/null 2>&1; then 129 if tar --owner=root --group=root --help >/dev/null 2>&1; then
131 opts="--owner=root --group=root" 130 opts="--owner=root --group=root"
132 fi 131 fi
133 tar cf - boot/* lib/* $opts | ${compress} > "${tarball}${file_ext}" 132 tar cf - -C "$tmpdir" boot/ lib/ $opts | ${compress} > "${tarball}${file_ext}"
134) 133)
135 134
136echo "Tarball successfully created in ${tarball}${file_ext}" 135echo "Tarball successfully created in ${tarball}${file_ext}"
137 136
138exit 0 137exit 0
139
diff --git a/scripts/patch-kernel b/scripts/patch-kernel
index d000ea3a41fd..49b4241e814a 100755
--- a/scripts/patch-kernel
+++ b/scripts/patch-kernel
@@ -27,7 +27,7 @@
27# Nick Holloway <Nick.Holloway@alfie.demon.co.uk>, 2nd January 1995. 27# Nick Holloway <Nick.Holloway@alfie.demon.co.uk>, 2nd January 1995.
28# 28#
29# Added support for handling multiple types of compression. What includes 29# Added support for handling multiple types of compression. What includes
30# gzip, bzip, bzip2, zip, compress, and plaintext. 30# gzip, bzip, bzip2, zip, compress, and plaintext.
31# 31#
32# Adam Sulmicki <adam@cfar.umd.edu>, 1st January 1997. 32# Adam Sulmicki <adam@cfar.umd.edu>, 1st January 1997.
33# 33#
@@ -159,7 +159,7 @@ applyPatch () {
159 fi 159 fi
160 # Remove backup files 160 # Remove backup files
161 find $sourcedir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \; 161 find $sourcedir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \;
162 162
163 return 0; 163 return 0;
164} 164}
165 165
diff --git a/scripts/pnmtologo.c b/scripts/pnmtologo.c
index 68bb4efc5af4..4718d7895f0b 100644
--- a/scripts/pnmtologo.c
+++ b/scripts/pnmtologo.c
@@ -512,4 +512,3 @@ int main(int argc, char *argv[])
512 } 512 }
513 exit(0); 513 exit(0);
514} 514}
515
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index 9c22317778eb..650ecc83d7d7 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -40,6 +40,11 @@
40#define R_METAG_NONE 3 40#define R_METAG_NONE 3
41#endif 41#endif
42 42
43#ifndef EM_AARCH64
44#define EM_AARCH64 183
45#define R_AARCH64_ABS64 257
46#endif
47
43static int fd_map; /* File descriptor for file being modified. */ 48static int fd_map; /* File descriptor for file being modified. */
44static int mmap_failed; /* Boolean flag. */ 49static int mmap_failed; /* Boolean flag. */
45static void *ehdr_curr; /* current ElfXX_Ehdr * for resource cleanup */ 50static void *ehdr_curr; /* current ElfXX_Ehdr * for resource cleanup */
@@ -347,6 +352,8 @@ do_file(char const *const fname)
347 case EM_ARM: reltype = R_ARM_ABS32; 352 case EM_ARM: reltype = R_ARM_ABS32;
348 altmcount = "__gnu_mcount_nc"; 353 altmcount = "__gnu_mcount_nc";
349 break; 354 break;
355 case EM_AARCH64:
356 reltype = R_AARCH64_ABS64; gpfx = '_'; break;
350 case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break; 357 case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break;
351 case EM_METAG: reltype = R_METAG_ADDR32; 358 case EM_METAG: reltype = R_METAG_ADDR32;
352 altmcount = "_mcount_wrapper"; 359 altmcount = "_mcount_wrapper";
@@ -480,5 +487,3 @@ main(int argc, char *argv[])
480 } 487 }
481 return !!n_error; 488 return !!n_error;
482} 489}
483
484
diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h
index 9d1421e63ff8..49b582a225b0 100644
--- a/scripts/recordmcount.h
+++ b/scripts/recordmcount.h
@@ -163,11 +163,11 @@ static int mcount_adjust = 0;
163 163
164static int MIPS_is_fake_mcount(Elf_Rel const *rp) 164static int MIPS_is_fake_mcount(Elf_Rel const *rp)
165{ 165{
166 static Elf_Addr old_r_offset; 166 static Elf_Addr old_r_offset = ~(Elf_Addr)0;
167 Elf_Addr current_r_offset = _w(rp->r_offset); 167 Elf_Addr current_r_offset = _w(rp->r_offset);
168 int is_fake; 168 int is_fake;
169 169
170 is_fake = old_r_offset && 170 is_fake = (old_r_offset != ~(Elf_Addr)0) &&
171 (current_r_offset - old_r_offset == MIPS_FAKEMCOUNT_OFFSET); 171 (current_r_offset - old_r_offset == MIPS_FAKEMCOUNT_OFFSET);
172 old_r_offset = current_r_offset; 172 old_r_offset = current_r_offset;
173 173
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 91280b82da08..397b6b84e8c5 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -279,6 +279,11 @@ if ($arch eq "x86_64") {
279 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_ARM_(CALL|PC24|THM_CALL)" . 279 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_ARM_(CALL|PC24|THM_CALL)" .
280 "\\s+(__gnu_mcount_nc|mcount)\$"; 280 "\\s+(__gnu_mcount_nc|mcount)\$";
281 281
282} elsif ($arch eq "arm64") {
283 $alignment = 3;
284 $section_type = '%progbits';
285 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_AARCH64_CALL26\\s+_mcount\$";
286 $type = ".quad";
282} elsif ($arch eq "ia64") { 287} elsif ($arch eq "ia64") {
283 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$"; 288 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";
284 $type = "data8"; 289 $type = "data8";
diff --git a/scripts/rt-tester/check-all.sh b/scripts/rt-tester/check-all.sh
index 43098afe7431..6b5c83baf148 100644
--- a/scripts/rt-tester/check-all.sh
+++ b/scripts/rt-tester/check-all.sh
@@ -19,4 +19,3 @@ testit t3-l2-pi.tst
19testit t4-l2-pi-deboost.tst 19testit t4-l2-pi-deboost.tst
20testit t5-l4-pi-boost-deboost.tst 20testit t5-l4-pi-boost-deboost.tst
21testit t5-l4-pi-boost-deboost-setsched.tst 21testit t5-l4-pi-boost-deboost-setsched.tst
22
diff --git a/scripts/rt-tester/rt-tester.py b/scripts/rt-tester/rt-tester.py
index 34186cac1d2f..6d916c2a45a5 100644
--- a/scripts/rt-tester/rt-tester.py
+++ b/scripts/rt-tester/rt-tester.py
@@ -216,5 +216,3 @@ while 1:
216# Normal exit pass 216# Normal exit pass
217print "Pass" 217print "Pass"
218sys.exit(0) 218sys.exit(0)
219
220
diff --git a/scripts/selinux/install_policy.sh b/scripts/selinux/install_policy.sh
index 7b9ccf61f8f9..f6a0ce71015f 100644
--- a/scripts/selinux/install_policy.sh
+++ b/scripts/selinux/install_policy.sh
@@ -66,4 +66,3 @@ if [ "eq$dodev" != "eq" ]; then
66 $SF file_contexts /dev 66 $SF file_contexts /dev
67 mount --move /mnt /dev 67 mount --move /mnt /dev
68fi 68fi
69
diff --git a/scripts/show_delta b/scripts/show_delta
index e25732b5d701..5b365009e6a3 100755
--- a/scripts/show_delta
+++ b/scripts/show_delta
@@ -126,4 +126,3 @@ def main():
126 print (convert_line(line, base_time),) 126 print (convert_line(line, base_time),)
127 127
128main() 128main()
129
diff --git a/scripts/tags.sh b/scripts/tags.sh
index f2c5b006a3d7..e6b011fe1d0d 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -25,6 +25,9 @@ else
25 tree=${srctree}/ 25 tree=${srctree}/
26fi 26fi
27 27
28# ignore userspace tools
29ignore="$ignore ( -path ${tree}tools ) -prune -o"
30
28# Find all available archs 31# Find all available archs
29find_all_archs() 32find_all_archs()
30{ 33{
@@ -47,7 +50,8 @@ find_arch_sources()
47 for i in $archincludedir; do 50 for i in $archincludedir; do
48 prune="$prune -wholename $i -prune -o" 51 prune="$prune -wholename $i -prune -o"
49 done 52 done
50 find ${tree}arch/$1 $ignore $subarchprune $prune -name "$2" -print; 53 find ${tree}arch/$1 $ignore $subarchprune $prune -name "$2" \
54 -not -type l -print;
51} 55}
52 56
53# find sources in arch/$1/include 57# find sources in arch/$1/include
@@ -57,14 +61,15 @@ find_arch_include_sources()
57 -name include -type d -print); 61 -name include -type d -print);
58 if [ -n "$include" ]; then 62 if [ -n "$include" ]; then
59 archincludedir="$archincludedir $include" 63 archincludedir="$archincludedir $include"
60 find $include $ignore -name "$2" -print; 64 find $include $ignore -name "$2" -not -type l -print;
61 fi 65 fi
62} 66}
63 67
64# find sources in include/ 68# find sources in include/
65find_include_sources() 69find_include_sources()
66{ 70{
67 find ${tree}include $ignore -name config -prune -o -name "$1" -print; 71 find ${tree}include $ignore -name config -prune -o -name "$1" \
72 -not -type l -print;
68} 73}
69 74
70# find sources in rest of tree 75# find sources in rest of tree
@@ -73,7 +78,7 @@ find_other_sources()
73{ 78{
74 find ${tree}* $ignore \ 79 find ${tree}* $ignore \
75 \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \ 80 \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
76 -name "$1" -print; 81 -name "$1" -not -type l -print;
77} 82}
78 83
79find_sources() 84find_sources()
@@ -187,6 +192,10 @@ exuberant()
187 --regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \ 192 --regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
188 --regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \ 193 --regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \
189 --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \ 194 --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \
195 --regex-c++='/TESTPCGFLAG\(([^,)]*).*/PageCgroup\1/' \
196 --regex-c++='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/' \
197 --regex-c++='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/' \
198 --regex-c++='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \
190 --regex-c='/PCI_OP_READ\((\w*).*[1-4]\)/pci_bus_read_config_\1/' \ 199 --regex-c='/PCI_OP_READ\((\w*).*[1-4]\)/pci_bus_read_config_\1/' \
191 --regex-c='/PCI_OP_WRITE\((\w*).*[1-4]\)/pci_bus_write_config_\1/' \ 200 --regex-c='/PCI_OP_WRITE\((\w*).*[1-4]\)/pci_bus_write_config_\1/' \
192 --regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/' \ 201 --regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/' \
@@ -201,7 +210,8 @@ exuberant()
201 --regex-c='/DECLARE_(TASKLET|WORK|DELAYED_WORK)\((\w*)/\2/v/' \ 210 --regex-c='/DECLARE_(TASKLET|WORK|DELAYED_WORK)\((\w*)/\2/v/' \
202 --regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/' \ 211 --regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/' \
203 --regex-c='/(^\s)OFFSET\((\w*)/\2/v/' \ 212 --regex-c='/(^\s)OFFSET\((\w*)/\2/v/' \
204 --regex-c='/(^\s)DEFINE\((\w*)/\2/v/' 213 --regex-c='/(^\s)DEFINE\((\w*)/\2/v/' \
214 --regex-c='/DEFINE_HASHTABLE\((\w*)/\1/v/'
205 215
206 all_kconfigs | xargs $1 -a \ 216 all_kconfigs | xargs $1 -a \
207 --langdef=kconfig --language-force=kconfig \ 217 --langdef=kconfig --language-force=kconfig \
@@ -244,9 +254,14 @@ emacs()
244 --regex='/__CLEARPAGEFLAG_NOOP(\([^,)]*\).*/__ClearPage\1/' \ 254 --regex='/__CLEARPAGEFLAG_NOOP(\([^,)]*\).*/__ClearPage\1/' \
245 --regex='/TESTCLEARFLAG_FALSE(\([^,)]*\).*/TestClearPage\1/' \ 255 --regex='/TESTCLEARFLAG_FALSE(\([^,)]*\).*/TestClearPage\1/' \
246 --regex='/__TESTCLEARFLAG_FALSE(\([^,)]*\).*/__TestClearPage\1/' \ 256 --regex='/__TESTCLEARFLAG_FALSE(\([^,)]*\).*/__TestClearPage\1/' \
257 --regex='/TESTPCGFLAG\(([^,)]*).*/PageCgroup\1/' \
258 --regex='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/' \
259 --regex='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/' \
260 --regex='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \
247 --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' \ 261 --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' \
248 --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/' \
249 --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/'\
264 --regex='/DEFINE_HASHTABLE\((\w*)/\1/v/'
250 265
251 all_kconfigs | xargs $1 -a \ 266 all_kconfigs | xargs $1 -a \
252 --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/' 267 --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'
@@ -266,7 +281,7 @@ xtags()
266 emacs $1 281 emacs $1
267 else 282 else
268 all_target_sources | xargs $1 -a 283 all_target_sources | xargs $1 -a
269 fi 284 fi
270} 285}
271 286
272# Support um (which uses SUBARCH) 287# Support um (which uses SUBARCH)