aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:47 -0400
commit8065be8d032f38da25b54bf077a05a30d9ce9f2a (patch)
tree32a7baf4b40e0240ab4b9dd6f2bbe6129929bb66 /scripts
parent27d438c56009e5ae632de36fe70985d1aab5e344 (diff)
parentecc265fe9e09e32a3573b2ba26e79b2099eb8bbb (diff)
Merge branch 'akpm' (second patchbomb from Andrew Morton)
Merge more incoming from Andrew Morton: "Two new syscalls: memfd_create in "shm: add memfd_create() syscall" kexec_file_load in "kexec: implementation of new syscall kexec_file_load" And: - Most (all?) of the rest of MM - Lots of the usual misc bits - fs/autofs4 - drivers/rtc - fs/nilfs - procfs - fork.c, exec.c - more in lib/ - rapidio - Janitorial work in filesystems: fs/ufs, fs/reiserfs, fs/adfs, fs/cramfs, fs/romfs, fs/qnx6. - initrd/initramfs work - "file sealing" and the memfd_create() syscall, in tmpfs - add pci_zalloc_consistent, use it in lots of places - MAINTAINERS maintenance - kexec feature work" * emailed patches from Andrew Morton <akpm@linux-foundation.org: (193 commits) MAINTAINERS: update nomadik patterns MAINTAINERS: update usb/gadget patterns MAINTAINERS: update DMA BUFFER SHARING patterns kexec: verify the signature of signed PE bzImage kexec: support kexec/kdump on EFI systems kexec: support for kexec on panic using new system call kexec-bzImage64: support for loading bzImage using 64bit entry kexec: load and relocate purgatory at kernel load time purgatory: core purgatory functionality purgatory/sha256: provide implementation of sha256 in purgaotory context kexec: implementation of new syscall kexec_file_load kexec: new syscall kexec_file_load() declaration kexec: make kexec_segment user buffer pointer a union resource: provide new functions to walk through resources kexec: use common function for kimage_normal_alloc() and kimage_crash_alloc() kexec: move segment verification code in a separate function kexec: rename unusebale_pages to unusable_pages kernel: build bin2c based on config option CONFIG_BUILD_BIN2C bin2c: move bin2c in scripts/basic shm: wait for pins to be released when sealing ...
Diffstat (limited to 'scripts')
-rw-r--r--scripts/.gitignore1
-rw-r--r--scripts/Makefile1
-rw-r--r--scripts/basic/.gitignore1
-rw-r--r--scripts/basic/Makefile1
-rw-r--r--scripts/basic/bin2c.c (renamed from scripts/bin2c.c)7
-rwxr-xr-xscripts/checkstack.pl12
-rw-r--r--scripts/coccinelle/free/ifnullfree.cocci53
-rwxr-xr-xscripts/tags.sh2
8 files changed, 65 insertions, 13 deletions
diff --git a/scripts/.gitignore b/scripts/.gitignore
index fb070fa1038f..5ecfe93f2028 100644
--- a/scripts/.gitignore
+++ b/scripts/.gitignore
@@ -4,7 +4,6 @@
4conmakehash 4conmakehash
5kallsyms 5kallsyms
6pnmtologo 6pnmtologo
7bin2c
8unifdef 7unifdef
9ihex2fw 8ihex2fw
10recordmcount 9recordmcount
diff --git a/scripts/Makefile b/scripts/Makefile
index 890df5c6adfb..72902b5f2721 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -13,7 +13,6 @@ HOST_EXTRACFLAGS += -I$(srctree)/tools/include
13hostprogs-$(CONFIG_KALLSYMS) += kallsyms 13hostprogs-$(CONFIG_KALLSYMS) += kallsyms
14hostprogs-$(CONFIG_LOGO) += pnmtologo 14hostprogs-$(CONFIG_LOGO) += pnmtologo
15hostprogs-$(CONFIG_VT) += conmakehash 15hostprogs-$(CONFIG_VT) += conmakehash
16hostprogs-$(CONFIG_IKCONFIG) += bin2c
17hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount 16hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount
18hostprogs-$(CONFIG_BUILDTIME_EXTABLE_SORT) += sortextable 17hostprogs-$(CONFIG_BUILDTIME_EXTABLE_SORT) += sortextable
19hostprogs-$(CONFIG_ASN1) += asn1_compiler 18hostprogs-$(CONFIG_ASN1) += asn1_compiler
diff --git a/scripts/basic/.gitignore b/scripts/basic/.gitignore
index a776371a3502..9528ec9e5adc 100644
--- a/scripts/basic/.gitignore
+++ b/scripts/basic/.gitignore
@@ -1 +1,2 @@
1fixdep 1fixdep
2bin2c
diff --git a/scripts/basic/Makefile b/scripts/basic/Makefile
index 4fcef87bb875..ec10d9345bc2 100644
--- a/scripts/basic/Makefile
+++ b/scripts/basic/Makefile
@@ -9,6 +9,7 @@
9# fixdep: Used to generate dependency information during build process 9# fixdep: Used to generate dependency information during build process
10 10
11hostprogs-y := fixdep 11hostprogs-y := fixdep
12hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c
12always := $(hostprogs-y) 13always := $(hostprogs-y)
13 14
14# fixdep is needed to compile other host programs 15# fixdep is needed to compile other host programs
diff --git a/scripts/bin2c.c b/scripts/basic/bin2c.c
index 96dd2bcbb407..af187e695345 100644
--- a/scripts/bin2c.c
+++ b/scripts/basic/bin2c.c
@@ -11,7 +11,7 @@
11 11
12int main(int argc, char *argv[]) 12int main(int argc, char *argv[])
13{ 13{
14 int ch, total=0; 14 int ch, total = 0;
15 15
16 if (argc > 1) 16 if (argc > 1)
17 printf("const char %s[] %s=\n", 17 printf("const char %s[] %s=\n",
@@ -19,10 +19,9 @@ int main(int argc, char *argv[])
19 19
20 do { 20 do {
21 printf("\t\""); 21 printf("\t\"");
22 while ((ch = getchar()) != EOF) 22 while ((ch = getchar()) != EOF) {
23 {
24 total++; 23 total++;
25 printf("\\x%02x",ch); 24 printf("\\x%02x", ch);
26 if (total % 16 == 0) 25 if (total % 16 == 0)
27 break; 26 break;
28 } 27 }
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index c05d586b1fee..899b4230320e 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -52,14 +52,12 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
52 #8000008a: 20 1d sub sp,4 52 #8000008a: 20 1d sub sp,4
53 #80000ca8: fa cd 05 b0 sub sp,sp,1456 53 #80000ca8: fa cd 05 b0 sub sp,sp,1456
54 $re = qr/^.*sub.*sp.*,([0-9]{1,8})/o; 54 $re = qr/^.*sub.*sp.*,([0-9]{1,8})/o;
55 } elsif ($arch =~ /^i[3456]86$/) { 55 } elsif ($arch =~ /^x86(_64)?$/ || $arch =~ /^i[3456]86$/) {
56 #c0105234: 81 ec ac 05 00 00 sub $0x5ac,%esp 56 #c0105234: 81 ec ac 05 00 00 sub $0x5ac,%esp
57 $re = qr/^.*[as][du][db] \$(0x$x{1,8}),\%esp$/o; 57 # or
58 $dre = qr/^.*[as][du][db] (%.*),\%esp$/o; 58 # 2f60: 48 81 ec e8 05 00 00 sub $0x5e8,%rsp
59 } elsif ($arch eq 'x86_64') { 59 $re = qr/^.*[as][du][db] \$(0x$x{1,8}),\%(e|r)sp$/o;
60 # 2f60: 48 81 ec e8 05 00 00 sub $0x5e8,%rsp 60 $dre = qr/^.*[as][du][db] (%.*),\%(e|r)sp$/o;
61 $re = qr/^.*[as][du][db] \$(0x$x{1,8}),\%rsp$/o;
62 $dre = qr/^.*[as][du][db] (\%.*),\%rsp$/o;
63 } elsif ($arch eq 'ia64') { 61 } elsif ($arch eq 'ia64') {
64 #e0000000044011fc: 01 0f fc 8c adds r12=-384,r12 62 #e0000000044011fc: 01 0f fc 8c adds r12=-384,r12
65 $re = qr/.*adds.*r12=-(([0-9]{2}|[3-9])[0-9]{2}),r12/o; 63 $re = qr/.*adds.*r12=-(([0-9]{2}|[3-9])[0-9]{2}),r12/o;
diff --git a/scripts/coccinelle/free/ifnullfree.cocci b/scripts/coccinelle/free/ifnullfree.cocci
new file mode 100644
index 000000000000..a42d70bf88b3
--- /dev/null
+++ b/scripts/coccinelle/free/ifnullfree.cocci
@@ -0,0 +1,53 @@
1/// NULL check before some freeing functions is not needed.
2///
3/// Based on checkpatch warning
4/// "kfree(NULL) is safe this check is probably not required"
5/// and kfreeaddr.cocci by Julia Lawall.
6///
7// Copyright: (C) 2014 Fabian Frederick. GPLv2.
8// Comments: -
9// Options: --no-includes --include-headers
10
11virtual patch
12virtual org
13virtual report
14virtual context
15
16@r2 depends on patch@
17expression E;
18@@
19- if (E)
20(
21- kfree(E);
22+ kfree(E);
23|
24- debugfs_remove(E);
25+ debugfs_remove(E);
26|
27- debugfs_remove_recursive(E);
28+ debugfs_remove_recursive(E);
29|
30- usb_free_urb(E);
31+ usb_free_urb(E);
32)
33
34@r depends on context || report || org @
35expression E;
36position p;
37@@
38
39* if (E)
40* \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb\)(E);
41
42@script:python depends on org@
43p << r.p;
44@@
45
46cocci.print_main("NULL check before that freeing function is not needed", p)
47
48@script:python depends on report@
49p << r.p;
50@@
51
52msg = "WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values."
53coccilib.report.print_report(p[0], msg)
diff --git a/scripts/tags.sh b/scripts/tags.sh
index e6b011fe1d0d..cbfd269a6011 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -168,6 +168,7 @@ exuberant()
168 --extra=+f --c-kinds=+px \ 168 --extra=+f --c-kinds=+px \
169 --regex-asm='/^(ENTRY|_GLOBAL)\(([^)]*)\).*/\2/' \ 169 --regex-asm='/^(ENTRY|_GLOBAL)\(([^)]*)\).*/\2/' \
170 --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \ 170 --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
171 --regex-c='/^COMPAT_SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/compat_sys_\1/' \
171 --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \ 172 --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \
172 --regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1/' \ 173 --regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1/' \
173 --regex-c++='/PAGEFLAG\(([^,)]*).*/Page\1/' \ 174 --regex-c++='/PAGEFLAG\(([^,)]*).*/Page\1/' \
@@ -231,6 +232,7 @@ emacs()
231 all_target_sources | xargs $1 -a \ 232 all_target_sources | xargs $1 -a \
232 --regex='/^\(ENTRY\|_GLOBAL\)(\([^)]*\)).*/\2/' \ 233 --regex='/^\(ENTRY\|_GLOBAL\)(\([^)]*\)).*/\2/' \
233 --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' \ 234 --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' \
235 --regex='/^COMPAT_SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/compat_sys_\1/' \
234 --regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \ 236 --regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \
235 --regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1/' \ 237 --regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1/' \
236 --regex='/PAGEFLAG(\([^,)]*\).*/Page\1/' \ 238 --regex='/PAGEFLAG(\([^,)]*\).*/Page\1/' \