aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAntony Pavlov <antonynpavlov@gmail.com>2019-04-10 14:53:56 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2022-09-18 08:18:37 +0000
commit20d4a58bd93aa17f8deb9ab6d310491f8fe9719b (patch)
tree1b7b835ba2f5489ae2d1fc4485708f2f18c75cb4 /tools
parentccdc51e2de9a5379e9aaa2ff15e0be3e73b265c1 (diff)
downloadriscv-openocd-20d4a58bd93aa17f8deb9ab6d310491f8fe9719b.zip
riscv-openocd-20d4a58bd93aa17f8deb9ab6d310491f8fe9719b.tar.gz
riscv-openocd-20d4a58bd93aa17f8deb9ab6d310491f8fe9719b.tar.bz2
checkpatch: check for OpenOCD tree, not for kernel tree
checkpatch.pl looks for Linux kernel specific paths and files to check source tree. As openocd misses kernel files it ends with this error message: Must be run from the top-level dir. of a kernel tree This patch also renames 'kernel' -> 'openocd' in source tree-related messages. This is the old commit c5d89883165e ("checkpatch.pl: check for openocd tree, not for kernel tree") re-applied. Also remove the flag "--no-tree" from .checkpatch.conf, not required anymore. Change-Id: I336a66558c75494b7ae339ea63559c31f23aad84 Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5122 Tested-by: jenkins
Diffstat (limited to 'tools')
-rwxr-xr-xtools/scripts/checkpatch.pl18
1 files changed, 14 insertions, 4 deletions
diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl
index aa3e637..07dca63 100755
--- a/tools/scripts/checkpatch.pl
+++ b/tools/scripts/checkpatch.pl
@@ -97,7 +97,7 @@ Version: $V
Options:
-q, --quiet quiet
-v, --verbose verbose mode
- --no-tree run without a kernel tree
+ --no-tree run without an OpenOCD tree
--no-signoff do not check for 'Signed-off-by' line
--patch treat FILE as patchfile (default)
--emacs emacs compile window format
@@ -124,7 +124,7 @@ Options:
requires --strict for use with --file
--min-conf-desc-length=n set the min description length, if shorter, warn
--tab-size=n set the number of spaces for tab (default $tabsize)
- --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
@@ -461,14 +461,16 @@ if ($tree) {
} else {
if (top_of_kernel_tree('.')) {
$root = '.';
- } elsif ($0 =~ m@(.*)/scripts/[^/]*$@ &&
+ # OpenOCD specific: Begin: replace s"/scripts/"/tools/scripts/"
+ } elsif ($0 =~ m@(.*)/tools/scripts/[^/]*$@ &&
top_of_kernel_tree($1)) {
$root = $1;
}
+ # OpenOCD specific: End
}
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 an OpenOCD tree\n";
exit(2);
}
}
@@ -1365,11 +1367,19 @@ exit($exit);
sub top_of_kernel_tree {
my ($root) = @_;
+ if (!$OpenOCD) {
my @tree_check = (
"COPYING", "CREDITS", "Kbuild", "MAINTAINERS", "Makefile",
"README", "Documentation", "arch", "include", "drivers",
"fs", "init", "ipc", "kernel", "lib", "scripts",
);
+ } # !$OpenOCD
+ # OpenOCD specific: Begin
+ my @tree_check = (
+ "AUTHORS", "BUGS", "COPYING", "HACKING", "Makefile.am",
+ "README", "contrib", "doc", "src", "tcl", "testing", "tools",
+ );
+ # OpenOCD specific: End
foreach my $check (@tree_check) {
if (! -e $root . '/' . $check) {