X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=tools%2Fscripts%2Fcheckpatch.pl;h=4eb50c3cb0a9e50bc4f7f07a7d42ac30f9258bd9;hp=7a30ae7e3fbeb42294950a7cdfb982d1b8d717eb;hb=a9a5c17cf5e1f55310aa218f178997f090304172;hpb=75b4cbe356467e48182790e39254cae88d590883 diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index 7a30ae7e3f..4eb50c3cb0 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -43,7 +43,7 @@ Version: $V Options: -q, --quiet quiet - --no-tree run without a kernel tree + --no-tree run without a openocd tree --no-signoff do not check for 'Signed-off-by' line --patch treat FILE as patchfile (default) --emacs emacs compile window format @@ -52,7 +52,7 @@ Options: --subjective, --strict enable more subjective tests --ignore TYPE(,TYPE2...) ignore various comma separated message types --show-types show the message "types" in the output - --root=PATH PATH to the kernel tree root + --root=PATH PATH to the openocd tree root --no-summary suppress the per-file summary --mailback only produce a report in case of warnings/errors --summary-file include the filename in summary @@ -165,14 +165,14 @@ if ($tree) { } else { if (top_of_kernel_tree('.')) { $root = '.'; - } elsif ($0 =~ m@(.*)/scripts/[^/]*$@ && + } elsif ($0 =~ m@(.*)/tools/scripts/[^/]*$@ && top_of_kernel_tree($1)) { $root = $1; } } if (!defined $root) { - print "Must be run from the top-level dir. of a kernel tree\n"; + print "Must be run from the top-level dir. of a openocd tree\n"; exit(2); } } @@ -401,9 +401,8 @@ sub top_of_kernel_tree { my ($root) = @_; my @tree_check = ( - "COPYING", "CREDITS", "Kbuild", "MAINTAINERS", "Makefile", - "README", "Documentation", "arch", "include", "drivers", - "fs", "init", "ipc", "kernel", "lib", "scripts", + "AUTHORS", "BUGS", "COPYING", "HACKING", "Makefile.am", + "README", "contrib", "doc", "src", "tcl", "testing", "tools", ); foreach my $check (@tree_check) { @@ -1632,6 +1631,16 @@ sub process { $rpt_cleaners = 1; } + if ($rawline =~ /\bwrite to the Free/i || + $rawline =~ /\b59\s+Temple\s+Pl/i || + $rawline =~ /\b51\s+Franklin\s+St/i) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + ERROR("FSF_MAILING_ADDRESS", + "Do not include the paragraph about writing to the Free Software Foundation's mailing address " . + "from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. " . + "OpenOCD already includes a copy of the GPL.\n" . $herevet) + } + # check for Kconfig help text having a real description # Only applies when adding the entry originally, after that we do not have # sufficient context to determine whether it is indeed long enough. @@ -1724,6 +1733,9 @@ sub process { "please, no space before tabs\n" . $herevet); } +# check we are in a valid C source file if not then ignore this hunk + next if ($realfile !~ /\.(h|c)$/); + # check for spaces at the beginning of a line. # Exceptions: # 1) within comments @@ -1735,9 +1747,6 @@ sub process { "please, no spaces at the start of a line\n" . $herevet); } -# check we are in a valid C source file if not then ignore this hunk - next if ($realfile !~ /\.(h|c)$/); - # check for RCS/CVS revision markers if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) { WARN("CVS_KEYWORD",