The documentation for trace events says that every subdirectory which
has trace events should have a trace.h header, whose only content is
an include of the trace/trace-<subdir>.h file.

Due to that, we should skip it in the checkpatch license check.
I'm adding it as an exception to the check instead of its own if so it
still throws the warning on all new files instead of ignoring it.

Change-Id: Ic2dae14f8cded0dd02d5b231588bd38d8a00e40d
Signed-off-by: Nabih Estefan <nabiheste...@google.com>
---
 scripts/checkpatch.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 365892de04..b2c6ac2477 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1685,7 +1685,9 @@ sub process {
                if ($line =~ /^new file mode\s*\d+\s*$/) {
                    if ($expect_spdx) {
                        if ($expect_spdx_file =~
-                           /\.(c|h|py|pl|sh|json|inc|Makefile)$/) {
+                           /\.(c|h|py|pl|sh|json|inc|Makefile)$/
+                               and not $expect_spdx_file =~ /(trace\.h)$/) {
+                               # Files to include auto-generated files don't 
require a license
                            # source code files MUST have SPDX license declared
                            ERROR("New file '$expect_spdx_file' requires " .
                                  "'SPDX-License-Identifier'");
-- 
2.49.0.805.g082f7c87e0-goog


Reply via email to