Message ID | 20230317201621.15518-1-ddrokosov@sberdevices.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp543272wrt; Fri, 17 Mar 2023 13:21:52 -0700 (PDT) X-Google-Smtp-Source: AK7set9SL/Ibhj+v6LRyRlUdrettkehBxCNFmq7YdGHzd0aprz+XHc+phUwmMatCvDW8svU8w4VT X-Received: by 2002:a05:6a21:32a2:b0:d5:ac2b:7dfa with SMTP id yt34-20020a056a2132a200b000d5ac2b7dfamr13920238pzb.1.1679084512553; Fri, 17 Mar 2023 13:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679084512; cv=none; d=google.com; s=arc-20160816; b=Usf7MgXlbsPm7jdncIf1aSD8zk924J8Rt2qkxhijfo14J+IO9DhjhEZYFFgzOZ4R0w NCUNjxL0sZTbtwhzQDXVLxtjN45hBHrRJFaVmCMiPGoSH0qHp07c74FOpbBRr/azydLD l8/u8gxN7RCp0F06YLLip+Iw85PnExUra7GV39Vu5MRhK3dPV+nqcgW2mQYf6HMUN3J1 kZ09KIeSZMTW0D0VeM6S6/4FqltDxImwsqsZ0FzZkYYe3auOQzEGg/udDL8TXssZf9IH YjQ2vD0pJP9+T80K8A6HmVzHd//3THlh3BFFPOMJqfiNr4OxwBObh4WiM1X/eS6BuI/u eSRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=TyaOVLlVY2asue8yP9ZJWJeqyi9V7IO1gcIFeqpZ2sc=; b=d/kzzzHemBshuwfieRKJgY5HR8qgJ3RXErG9nZ05/aC1I5OQdifdHUy0SX3r/ZLu0R +0ig2oOf9rqfvaF96zeoWAyX3wekH9dFeoJnaw3sthnhfTOYz6GzuLtRfSbgoSLBVoYB YrBCPD3+rejL5gfZCXQggDMRkvfAxqSMLm1/YmbEs9bMMRa1nv/6ur+rp58iiPMKkbxH Wtr0Iebp8emyojvC06I3FsIpPVD2i4vjLM9xoKPIDq/R0biUIfe5W3zxjlLUYLDxFUKZ waQWuW7+nicBFP2936hzoYImj67CWGN4mH/mn2S1eD3CYoIFofQiEDNkH6ZVtk8mQK/1 Pyjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=de4bKrOh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t12-20020a63dd0c000000b0050b1994ef88si3347188pgg.344.2023.03.17.13.21.36; Fri, 17 Mar 2023 13:21:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=de4bKrOh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229765AbjCQUQl (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Fri, 17 Mar 2023 16:16:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229651AbjCQUQj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 17 Mar 2023 16:16:39 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CD8A618A for <linux-kernel@vger.kernel.org>; Fri, 17 Mar 2023 13:16:35 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 5C2195FD4F; Fri, 17 Mar 2023 23:16:33 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1679084193; bh=TyaOVLlVY2asue8yP9ZJWJeqyi9V7IO1gcIFeqpZ2sc=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=de4bKrOhQCOw+ptf3iKrNoZuUKSPs6n+YHVuzXAzEiUPX9J0b3mpgJ2WGaG5A+Qx6 0fPgP7O5NliAKZvwXWp45n4GTd2qVlOtphs//Ds80EAO9GR/sbsiYKV/fgy0xwd3+P A8C9Dfc45tQI3VCvB7t3M302KJXtBMSZmbw3hJtcHY00sM1b4QNwGoyfNv+RjgllNC h9vDqacdHaH0aSaI1XoSFG44HjWlOSGvVphZWKZdjb+wnmwqwjtU0eDtitT8pzTXub LwSh0HC0mJ7Tr98Ai6UncrGg/DdSM1LrZxffFSrW6zsjKfGhhVypN7L3M4TDMkGAPM OlFkpECcVbcHw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 17 Mar 2023 23:16:31 +0300 (MSK) From: Dmitry Rokosov <ddrokosov@sberdevices.ru> To: <krzysztof.kozlowski@linaro.org>, <robh@kernel.org>, <apw@canonical.com>, <joe@perches.com>, <dwaipayanray1@gmail.com>, <lukas.bulwahn@gmail.com> CC: <kernel@sberdevices.ru>, <linux-kernel@vger.kernel.org>, <rockosov@gmail.com>, Dmitry Rokosov <ddrokosov@sberdevices.ru> Subject: [PATCH v1] checkpatch: add missing bindings license check Date: Fri, 17 Mar 2023 23:16:21 +0300 Message-ID: <20230317201621.15518-1-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/03/17 17:26:00 #20964929 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760647721909291205?= X-GMAIL-MSGID: =?utf-8?q?1760647721909291205?= |
Series |
[v1] checkpatch: add missing bindings license check
|
|
Commit Message
Dmitry Rokosov
March 17, 2023, 8:16 p.m. UTC
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 string:
'GPL-2.0-only 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>
---
scripts/checkpatch.pl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Fri, 2023-03-17 at 23:16 +0300, Dmitry Rokosov wrote: > 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 string: > 'GPL-2.0-only 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> > --- > scripts/checkpatch.pl | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -3709,7 +3709,8 @@ sub process { > WARN("SPDX_LICENSE_TAG", > "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr); > } > - if ($realfile =~ m@^Documentation/devicetree/bindings/@ && > + if (($realfile =~ m@^Documentation/devicetree/bindings/@ || > + $realfile =~ m@^include/dt-bindings/@) && I prefer aligning to open parens > not $spdx_license =~ /GPL-2\.0.*BSD-2-Clause/) { And if it's really a strict bit about the required license, why not make it match exactly? $spdx_license !~ /GPL-2\.0(?:-only|-or-later|\+)? OR BSD-2-Clause/) { > my $msg_level = \&WARN; > $msg_level = \&CHK if ($file); $ git grep -oh 'SPDX-License.*$' -- Documentation/devicetree/bindings/ include/dt-bindings/ | \ sort | uniq -c | sort -rn 1597 SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 611 SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 540 SPDX-License-Identifier: GPL-2.0 355 SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 285 SPDX-License-Identifier: GPL-2.0 */ 179 SPDX-License-Identifier: GPL-2.0-only */ 102 SPDX-License-Identifier: GPL-2.0-only 93 SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 56 SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause 47 SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause 36 SPDX-License-Identifier: GPL-2.0+ */ 34 SPDX-License-Identifier: GPL-2.0-or-later */ 33 SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) 28 SPDX-License-Identifier: GPL-2.0+ 21 SPDX-License-Identifier: (GPL-2.0+ OR MIT) 19 SPDX-License-Identifier: (GPL-2.0+ or MIT) */ 17 SPDX-License-Identifier: (GPL-2.0 OR MIT) */ 12 SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause) 11 SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ 9 SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ 8 SPDX-License-Identifier: GPL-2.0 OR MIT */ 8 SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */ 7 SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause 7 SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) 7 SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ 6 SPDX-License-Identifier: (GPL-2.0) 5 SPDX-License-Identifier: GPL-2.0+ OR MIT */ 5 SPDX-License-Identifier: (GPL-2.0 OR MIT) 5 SPDX-License-Identifier: (GPL-2.0 or MIT) */ 4 SPDX-License-Identifier: GPL-2.0-or-later 3 SPDX-License-Identifier: (GPL-2.0+ OR X11) 3 SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */ 3 SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 3 SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */ 3 SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause) */ 3 SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */ 3 SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ 2 SPDX-License-Identifier: (GPL-2.0+ or MIT) 2 SPDX-License-Identifier: GPL-2.0-or-later OR MIT */ 2 SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) 2 SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */ 2 SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)*/ 1 SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) */ 1 SPDX-License-Identifier: (GPL-2.0-or-later or MIT) */ 1 SPDX-License-Identifier: GPL-2.0-or-later or BSD-2-Clause */ 1 SPDX-License-Identifier: (GPL-2.0-or-later) 1 SPDX-License-Identifier: GPL-2.0+ or BSD-3-Clause */ 1 SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ 1 SPDX-License-Identifier: GPL-2.0-only or X11 */ 1 SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ 1 SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause */ 1 SPDX-License-Identifier: (GPL-2.0-only) 1 SPDX-License-Identifier: BSD-2-Clause
Hello Joe, Thank you for quick review. Please find my comments below. On Fri, Mar 17, 2023 at 03:28:16PM -0700, Joe Perches wrote: > On Fri, 2023-03-17 at 23:16 +0300, Dmitry Rokosov wrote: > > 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 string: > > 'GPL-2.0-only 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> > > --- > > scripts/checkpatch.pl | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > [] > > @@ -3709,7 +3709,8 @@ sub process { > > WARN("SPDX_LICENSE_TAG", > > "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr); > > } > > - if ($realfile =~ m@^Documentation/devicetree/bindings/@ && > > + if (($realfile =~ m@^Documentation/devicetree/bindings/@ || > > + $realfile =~ m@^include/dt-bindings/@) && > > I prefer aligning to open parens > > > not $spdx_license =~ /GPL-2\.0.*BSD-2-Clause/) { Okay, no problem, will send new version today. > > And if it's really a strict bit about the required license, > why not make it match exactly? > > $spdx_license !~ /GPL-2\.0(?:-only|-or-later|\+)? OR BSD-2-Clause/) { > I think, it's a good idea. > > my $msg_level = \&WARN; > > $msg_level = \&CHK if ($file); > > $ git grep -oh 'SPDX-License.*$' -- Documentation/devicetree/bindings/ include/dt-bindings/ | \ > sort | uniq -c | sort -rn > 1597 SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > 611 SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > 540 SPDX-License-Identifier: GPL-2.0 > 355 SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause > 285 SPDX-License-Identifier: GPL-2.0 */ > 179 SPDX-License-Identifier: GPL-2.0-only */ > 102 SPDX-License-Identifier: GPL-2.0-only > 93 SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ > 56 SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause > 47 SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause > 36 SPDX-License-Identifier: GPL-2.0+ */ > 34 SPDX-License-Identifier: GPL-2.0-or-later */ > 33 SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) > 28 SPDX-License-Identifier: GPL-2.0+ > 21 SPDX-License-Identifier: (GPL-2.0+ OR MIT) > 19 SPDX-License-Identifier: (GPL-2.0+ or MIT) */ > 17 SPDX-License-Identifier: (GPL-2.0 OR MIT) */ > 12 SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause) > 11 SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ > 9 SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ > 8 SPDX-License-Identifier: GPL-2.0 OR MIT */ > 8 SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */ > 7 SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause > 7 SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) > 7 SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ > 6 SPDX-License-Identifier: (GPL-2.0) > 5 SPDX-License-Identifier: GPL-2.0+ OR MIT */ > 5 SPDX-License-Identifier: (GPL-2.0 OR MIT) > 5 SPDX-License-Identifier: (GPL-2.0 or MIT) */ > 4 SPDX-License-Identifier: GPL-2.0-or-later > 3 SPDX-License-Identifier: (GPL-2.0+ OR X11) > 3 SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */ > 3 SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ > 3 SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */ > 3 SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause) */ > 3 SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */ > 3 SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ > 2 SPDX-License-Identifier: (GPL-2.0+ or MIT) > 2 SPDX-License-Identifier: GPL-2.0-or-later OR MIT */ > 2 SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) > 2 SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */ > 2 SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)*/ > 1 SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) */ > 1 SPDX-License-Identifier: (GPL-2.0-or-later or MIT) */ > 1 SPDX-License-Identifier: GPL-2.0-or-later or BSD-2-Clause */ > 1 SPDX-License-Identifier: (GPL-2.0-or-later) > 1 SPDX-License-Identifier: GPL-2.0+ or BSD-3-Clause */ > 1 SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ > 1 SPDX-License-Identifier: GPL-2.0-only or X11 */ > 1 SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ > 1 SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause */ > 1 SPDX-License-Identifier: (GPL-2.0-only) > 1 SPDX-License-Identifier: BSD-2-Clause > I've noticed it too, asked Krzysztof about this situation in the below review: https://lore.kernel.org/all/9d176288-cd7c-7107-e180-761e372a2b6e@linaro.org/ Krzysztof mentioned, that he checked the purpose to have different license each time manually. But by default, it should be strict.
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 78cc595b98ce..2d12d39992cb 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3709,7 +3709,8 @@ sub process { WARN("SPDX_LICENSE_TAG", "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr); } - if ($realfile =~ m@^Documentation/devicetree/bindings/@ && + if (($realfile =~ m@^Documentation/devicetree/bindings/@ || + $realfile =~ m@^include/dt-bindings/@) && not $spdx_license =~ /GPL-2\.0.*BSD-2-Clause/) { my $msg_level = \&WARN; $msg_level = \&CHK if ($file);