On Wed, Apr 23, 2025 at 06:37:27PM +0000, Nabih Estefan wrote: > 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.
Historically we have not bothered to add the license header to the trace.h files, primarily because its size would dwarf the actual content, and secondly because. the content can probably be sad to be not copyrightable. With SPDX-License-Identifier being so concise though, the main reason for omitting it goes away. So my feeling is that we should not exempt the trace.h files, and stick with our default rule that *ALL* source files must have SPDX-License-Identifier. > 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 > With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|