check patch: "top_of_sof_tree()" so it works out of the box

Adjust top_of_kernel_tree() function to SOF so invoking
./scripts/checkpatch.pl works out of the box and doesn't require
figuring what's going on and the existence of the --no-tree option which
sof-ci invokes "behind the scenes".

This instead of failing with:

  Must be run from the top-level dir. of a kernel tree

Compared to --no-tree, this is also enables a couple extra checks like:
WARNING: use relative pathname instead of absolute in changelog text

PS: the space between check and patch is here to... defeat checkpatch
itself. It apparently doesn't expect any change to itself.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2020-03-18 17:42:31 -07:00 committed by Janusz Jankowski
parent 0a1c8b65af
commit c84706e3f8
1 changed files with 8 additions and 0 deletions

View File

@ -1104,6 +1104,14 @@ sub top_of_kernel_tree {
"fs", "init", "ipc", "kernel", "lib", "scripts",
);
if ($SOF) {
@tree_check = (
"LICENCE", "README.md", "rimage", "tools",
"scripts", "doc", "src", "CODEOWNERS",
"CMakeLists.txt",
);
}
foreach my $check (@tree_check) {
if (! -e $root . '/' . $check) {
return 0;