Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D7CAC6FD1C for ; Mon, 20 Mar 2023 22:40:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229808AbjCTWkz convert rfc822-to-8bit (ORCPT ); Mon, 20 Mar 2023 18:40:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbjCTWkw (ORCPT ); Mon, 20 Mar 2023 18:40:52 -0400 Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5253C32E5A for ; Mon, 20 Mar 2023 15:40:51 -0700 (PDT) Received: from omf12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A6E501202AC; Mon, 20 Mar 2023 22:40:49 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf12.hostedemail.com (Postfix) with ESMTPA id EEBE517; Mon, 20 Mar 2023 22:40:46 +0000 (UTC) Message-ID: Subject: Re: [PATCH v3] checkpatch: add missing bindings license check From: Joe Perches To: Dmitry Rokosov , krzysztof.kozlowski@linaro.org, robh@kernel.org, apw@canonical.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com, Andrew Morton Cc: kernel@sberdevices.ru, linux-kernel@vger.kernel.org, rockosov@gmail.com Date: Mon, 20 Mar 2023 15:40:46 -0700 In-Reply-To: <20230320203350.13696-1-ddrokosov@sberdevices.ru> References: <20230320203350.13696-1-ddrokosov@sberdevices.ru> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Rspamd-Queue-Id: EEBE517 X-Stat-Signature: 4mu3pe9mq17qtkie6rgkc69zjrpaoy1s X-Rspamd-Server: rspamout05 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19e0rNjjBnNCLCdKXeMepoKqGghTFLRgzA= X-HE-Tag: 1679352046-599620 X-HE-Meta: U2FsdGVkX1/Dx1KRG3TbIvIP1xhFDOMwg5Jmm5iP0RRU6gEj6atYBqcySl1U2wL/m+ctt9ZzK6mNGZLblwAA1Q== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2023-03-20 at 23:33 +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 > --- Assuming the devicetree people are good with this change: Acked-by: Joe Perches > 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/ > --- [] > 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/@) && > + $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",