aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl15
-rwxr-xr-xscripts/kernel-doc15
-rw-r--r--scripts/package/builddeb14
-rw-r--r--scripts/package/buildtar3
-rw-r--r--scripts/recordmcount.h4
5 files changed, 33 insertions, 18 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 010b18ef4ea0..182be0f12407 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3476,12 +3476,17 @@ sub process {
3476 } 3476 }
3477 } 3477 }
3478 3478
3479# unnecessary return in a void function? (a single leading tab, then return;) 3479# unnecessary return in a void function
3480 if ($sline =~ /^\+\treturn\s*;\s*$/ && 3480# at end-of-function, with the previous line a single leading tab, then return;
3481 $prevline =~ /^\+/) { 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*:/) {
3482 WARN("RETURN_VOID", 3487 WARN("RETURN_VOID",
3483 "void function return statements are not generally useful\n" . $herecurr); 3488 "void function return statements are not generally useful\n" . $hereprev);
3484 } 3489 }
3485 3490
3486# if statements using unnecessary parentheses - ie: if ((foo == bar)) 3491# if statements using unnecessary parentheses - ie: if ((foo == bar))
3487 if ($^V && $^V ge 5.10.0 && 3492 if ($^V && $^V ge 5.10.0 &&
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/package/builddeb b/scripts/package/builddeb
index b5f08f727868..35d5a5877d04 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -289,14 +289,16 @@ EOF
289 289
290fi 290fi
291 291
292# Build header package 292# Build kernel header package
293(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"
294(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"
295(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"
296destdir=$kernel_headers_dir/usr/src/linux-headers-$version 298destdir=$kernel_headers_dir/usr/src/linux-headers-$version
297mkdir -p "$destdir" 299mkdir -p "$destdir"
298(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 -)
299(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 -)
300(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
301ln -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"
302rm -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 995c1eafaff6..e046bff33589 100644
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -125,12 +125,11 @@ 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}"
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