public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] checkpatch: add missing bindings license check
@ 2023-03-20 20:33 Dmitry Rokosov
  2023-03-20 22:40 ` Joe Perches
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Dmitry Rokosov @ 2023-03-20 20:33 UTC (permalink / raw)
  To: krzysztof.kozlowski, robh, apw, joe, dwaipayanray1, lukas.bulwahn
  Cc: kernel, linux-kernel, rockosov, Dmitry Rokosov

All headers from 'include/dt-bindings/' must be verified by checkpatch
together with Documentation bindings, because all of them are part of
the whole DT bindings system.

The requirement is dual licensed and matching pattern:
    /GPL-2\.0(?:-only|-or-later|\+)? (?:OR|or) BSD-2-Clause/

The issue was found during patch review:
https://lore.kernel.org/all/20230313201259.19998-4-ddrokosov@sberdevices.ru/

Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
---
Changes v3 since v2 at [2]:
    - replace 'not =~' expression with '!~' to be aligned with other
      checkpatch lines

Changes v2 since v1 at [1]:
    - include/dt-bindings check is aligned to open parens
    - introduce more strict pattern for bindings license:
      /GPL-2\.0(?:-only|-or-later|\+)? (?:OR|or) BSD-2-Clause/

Links:
    [1] https://lore.kernel.org/all/20230317201621.15518-1-ddrokosov@sberdevices.ru/
    [2] https://lore.kernel.org/all/20230320100027.27788-1-ddrokosov@sberdevices.ru/
---
 scripts/checkpatch.pl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 78cc595b98ce..65db3d2518a7 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3709,8 +3709,9 @@ sub process {
 						WARN("SPDX_LICENSE_TAG",
 						     "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr);
 					}
-					if ($realfile =~ m@^Documentation/devicetree/bindings/@ &&
-					    not $spdx_license =~ /GPL-2\.0.*BSD-2-Clause/) {
+					if (($realfile =~ m@^Documentation/devicetree/bindings/@ ||
+					     $realfile =~ m@^include/dt-bindings/@) &&
+					    $spdx_license !~ /GPL-2\.0(?:-only|-or-later|\+)? (?:OR|or) BSD-2-Clause/) {
 						my $msg_level = \&WARN;
 						$msg_level = \&CHK if ($file);
 						if (&{$msg_level}("SPDX_LICENSE_TAG",
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-03-23  8:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-20 20:33 [PATCH v3] checkpatch: add missing bindings license check Dmitry Rokosov
2023-03-20 22:40 ` Joe Perches
2023-03-21  6:30 ` Krzysztof Kozlowski
2023-03-21 21:53 ` Rob Herring
2023-03-22 10:26   ` Dmitry Rokosov
2023-03-22 13:40     ` Rob Herring
2023-03-22 14:14       ` Dmitry Rokosov
2023-03-22 14:36         ` Rob Herring
2023-03-22 14:56           ` Dmitry Rokosov
2023-03-23  8:51             ` Dmitry Rokosov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox