2021-06-10 21:47:04

by Tom Rix

[permalink] [raw]
Subject: [PATCH 1/7] checkpatch: check Makefiles and Kconfigs for SPDX tag

From: Tom Rix <[email protected]>

Both Makefiles and Kconfigs should carry an SPDX tag.
Something like
# SPDX-License-Identifier: GPL-2.0-only

Add a matcher to existing check

Signed-off-by: Tom Rix <[email protected]>
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index dad87c3686326..7fca3a7c38791 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3572,7 +3572,7 @@ sub process {
$comment = '/*';
} elsif ($realfile =~ /\.(c|dts|dtsi)$/) {
$comment = '//';
- } elsif (($checklicenseline == 2) || $realfile =~ /\.(sh|pl|py|awk|tc|yaml)$/) {
+ } elsif (($checklicenseline == 2) || $realfile =~ /\.(sh|pl|py|awk|tc|yaml)$|Kconfig|Makefile/) {
$comment = '#';
} elsif ($realfile =~ /\.rst$/) {
$comment = '..';
--
2.26.3


2021-06-10 22:19:30

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 1/7] checkpatch: check Makefiles and Kconfigs for SPDX tag

On Thu, 2021-06-10 at 14:44 -0700, [email protected] wrote:
> From: Tom Rix <[email protected]>
>
> Both Makefiles and Kconfigs should carry an SPDX tag.
> Something like
> ?# SPDX-License-Identifier: GPL-2.0-only
>
> Add a matcher to existing check
>
> Signed-off-by: Tom Rix <[email protected]>

Seems fine, thanks.

There's a Makefile with two tags that could be updated too.
---
drivers/staging/media/atomisp/Makefile | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/Makefile b/drivers/staging/media/atomisp/Makefile
index 51498b2e85b8f..cee03e31f420d 100644
--- a/drivers/staging/media/atomisp/Makefile
+++ b/drivers/staging/media/atomisp/Makefile
@@ -11,7 +11,6 @@ DEFINES += -DDEBUG

atomisp = $(srctree)/drivers/staging/media/atomisp/

-# SPDX-License-Identifier: GPL-2.0
atomisp-objs += \
pci/atomisp_acc.o \
pci/atomisp_cmd.o \