Message ID | 20230320100027.27788-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 j10csp1122912wrt; Mon, 20 Mar 2023 03:03:01 -0700 (PDT) X-Google-Smtp-Source: AK7set+U2Nqy/KlqlUjc9eWPn+eNfsIQv99sGEtwdz/+nHeQ0h7OmUj0mOo1G94q3m0tgXcOT8Hx X-Received: by 2002:a17:902:ea0a:b0:1a1:a68b:7255 with SMTP id s10-20020a170902ea0a00b001a1a68b7255mr12093499plg.67.1679306580743; Mon, 20 Mar 2023 03:03:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679306580; cv=none; d=google.com; s=arc-20160816; b=HZMUlD4G6Ribrlp4GSdNccLVCwCXB6bHb1amcAgQRTEzsh33QBacx3RD2dW4bdVAME xgFO3Fv8ULDR4s292GgXEnjIM/UD0MXKRgQm8akkBr23QRdzMXJSTpuXdt66ZOZ4kLkW q0iBOH5nliHq1U/dBcOkjpghpIizPOL2L+P68kN16Kdj0nZxdfNNuYQzBpOvx0cMR46R ZVujzUBl0baY3EeT2sV/rR/tDr35BFEViGM+KVNMJW19KSdowEZbBo2DXg3lZazSVuuy Di8qvhuVYj3/+SQAaaN5rK3HoLKV9D8B9aLUwYJ5MXg+JPpFOfkuHfQsD6s6rLXIgKN1 K7RQ== 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=+AlvPPz3WwkMxZ6jkBwUTQE4LbckvPytF6kchrIlEqA=; b=Wby0tpB9YKJiiS77HNjGDgdVvLngd3mC7v3kTJS74fu6hCz3mw1VJ6RaqvcFgC4uhv YXjmJ0qR3bBrYrr067Grv9/PA7bH0Kzi4jGwUAoBzqZ49a5+QlLdQ/1PB0Py6sLhOl7X d6kyCfCyeOH9k7L/+LTtswimpZ7Zd5UDE4WrrHawobgC5pqX90TQlaQFXp2ENq1YCv96 zbmq3EcTDX9rv60oUCnjYHiQqR/FzpJFTWtRz8vXSXJpj+geDxbJshR9PzzIGNjXMElN miR0m3p/8Lbjo7ZM7b85LpP15XmQPlzuuvZBOB/hBz2wd4ynblvjpKz6bKSaq3hslcF4 agrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=rGBce1Os; 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 d10-20020a170902aa8a00b00194dd9cb062si9751749plr.396.2023.03.20.03.02.48; Mon, 20 Mar 2023 03:03:00 -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=rGBce1Os; 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 S229588AbjCTKAr (ORCPT <rfc822;ezelljr.billy@gmail.com> + 99 others); Mon, 20 Mar 2023 06:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbjCTKAq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 20 Mar 2023 06:00:46 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A938446BB for <linux-kernel@vger.kernel.org>; Mon, 20 Mar 2023 03:00:39 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id E93D65FD16; Mon, 20 Mar 2023 13:00:36 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1679306436; bh=+AlvPPz3WwkMxZ6jkBwUTQE4LbckvPytF6kchrIlEqA=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=rGBce1OsE8g/ESJq9qPf09s/UcT7yJz220f2y91WnnltXq/b4OUr1VlJqK/LNjxe0 jtMP2rKi+nQTjnBkmkVdl1uYkYM26Y+7HVSjFGN/oGiiLsMXrjZBOsRHpPjLxVGflV xcgWK/lmdmMEkr1zk5Pl6uyH9zFxD9ye+wJ01GMJa3cTukyfIy4MK1AoTw6nOq8dow 8yqn4K7ypEMp6JyMUtgp4SAnBtFjCan8jHA+EcijnUQuA0iFY4AjAx6BVqiX+/itHz +gyGjOXcIMNUv/kh4JlJczlvdwBx0oUjgYII0Yxl0ovUYZeBBKS/sgwxmvlc+O6r+w WaclSE0Mu5bZw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Mon, 20 Mar 2023 13:00:35 +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 v2] checkpatch: add missing bindings license check Date: Mon, 20 Mar 2023 13:00:27 +0300 Message-ID: <20230320100027.27788-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-EXCH01.sberdevices.ru (172.16.1.4) 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/20 04:57:00 #20976224 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 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?1760880577286356353?= |
Series |
[v2] checkpatch: add missing bindings license check
|
|
Commit Message
Dmitry Rokosov
March 20, 2023, 10 a.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 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 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/
---
scripts/checkpatch.pl | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Comments
On Mon, 2023-03-20 at 13:00 +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 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 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/ > --- > scripts/checkpatch.pl | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) OK but: > diff --git 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/@) && > + not $spdx_license =~ /GPL-2\.0(?:-only|-or-later|\+)? (?:OR|or) BSD-2-Clause/) { I believe this is the only checkpatch use of not <foo> =~ <bar> instead of <foo> !~ <bar> I prefer !~
On Mon, Mar 20, 2023 at 10:12:27AM -0700, Joe Perches wrote: > On Mon, 2023-03-20 at 13:00 +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 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 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/ > > --- > > scripts/checkpatch.pl | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > OK but: > > > diff --git 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/@) && > > + not $spdx_license =~ /GPL-2\.0(?:-only|-or-later|\+)? (?:OR|or) BSD-2-Clause/) { > > I believe this is the only checkpatch use of > not <foo> =~ <bar> > instead of > <foo> !~ <bar> > > I prefer !~ > You are totally right. Only this place uses such strange comparing. Let me fix it and prepare new version quickly :)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 78cc595b98ce..de669d29f60c 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/@) && + not $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",