From patchwork Mon Mar 20 20:33:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 72440 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1429505wrt; Mon, 20 Mar 2023 13:46:58 -0700 (PDT) X-Google-Smtp-Source: AK7set8rhsChq3XaGBP9piacSI3nDR+RusMleZtJ6YFNijzEePqnH8a4riWDkVo2aIJ/Efp8Le8b X-Received: by 2002:a05:6a20:489:b0:d3:84ca:11b with SMTP id 9-20020a056a20048900b000d384ca011bmr16015039pzc.40.1679345218677; Mon, 20 Mar 2023 13:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679345218; cv=none; d=google.com; s=arc-20160816; b=oQ0LWpoeHO7ZwNBctBkeOBpPwzfKAbRNwFNXFOqT9TrLLSvDPPOIXaTQof2MnoAeBt rV0b6hZ6qnRWfzSSoT/d6o5Mwhf1m2qlL88Kbk7dyb/UZuYv2uknpICiZBtc5xGDyxDD 8WTBVevQ5TVRG3Tkz/pQo2+q+sIv/LF20/XA4BYrxGatmjrv+3pJ7pFtB9Q/tiAkEw+0 YUjSW4RVc69NvO65ZgKOIlGYrp8M+x6UMUXhs5VYKMrTZnfnkZ3qI6mKOWuL9SKK2Jv+ KqBx2w4K6DUaokCF3K6cJV1f4NGzlwaFEbf3cAujMazkyCrGPkhRorV3o2akepjN3ryp oc/w== 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=DFzqPpTMUf1xZTOArO7q4XeqATyxAxZahKRgAMFPTfk=; b=igSUs9Aijmk+100SeqSWgdYPFIs9TBaec4/DXIxsGW80ERf2eozI8YsAJ24GOKF3dw 2ivlQ6wlODGo16uIRxfFET1l4LT6GD/Cqf0A73GE3pcPOBQbWLn72mG2hOhLS+cvUMwQ oudclAai/hYvR0xqxoVEcuhcdGu5C8NgL5n9VKSCkMskWkL55aoHF3d8aCgSskHtMx8m SYrCP87pGGlxSfLho7f8wFAMgng82chwupiQcvrVNdNjCUlZFoWvGj+tdlAmhF0+rsVe CiR9WJoKDtPr9dMgcjgBtAyPT7+zWhSlwOCYC/8rzKYdhB4MpxaAw7v1yUnju89xIO/D re/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b="f+o/ipMr"; 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 123-20020a630381000000b00500a71d8b47si11370272pgd.214.2023.03.20.13.46.41; Mon, 20 Mar 2023 13:46:58 -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="f+o/ipMr"; 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 S229744AbjCTUeU (ORCPT + 99 others); Mon, 20 Mar 2023 16:34:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbjCTUeO (ORCPT ); Mon, 20 Mar 2023 16:34:14 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC373468A for ; Mon, 20 Mar 2023 13:34:04 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 2F1AC5FD10; Mon, 20 Mar 2023 23:34:00 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1679344440; bh=DFzqPpTMUf1xZTOArO7q4XeqATyxAxZahKRgAMFPTfk=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=f+o/ipMrcwfkV861m/R4vi8KJqdlVx8zDL93KbIu7iq/WT5JYU/kyUuuXSjGOPI87 1w6m6BgdERW1NvOQdZoFs0/o/QJh4sr5CaLPRLnPt77yWNS0MN5rww7SDIbZCh+K91 lgc6jtdQn/kgPSuygaPw8cwkHi2V7Qp3ImowHKzqJZIoJQNV2AkiyINCl/7eYKXq1n o7qhg/jTyG/UrlMNA5tBq5/GyPxWOFB5+wj6q9yXtM7zNUn31YDseQzUF7mVLvCVlJ ddPTqBjpuVCBFyCXbuNkiVUtJbDDPFykn4aAcj701tvFnUHmdVelde9aWY6zSTqhjc gNcNRikgXlNbQ== 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 23:33:58 +0300 (MSK) From: Dmitry Rokosov To: , , , , , CC: , , , Dmitry Rokosov Subject: [PATCH v3] checkpatch: add missing bindings license check Date: Mon, 20 Mar 2023 23:33:50 +0300 Message-ID: <20230320203350.13696-1-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 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/20 09:56:00 #20977321 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: 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?1760921092249024886?= 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 Acked-by: Joe Perches Acked-by: Krzysztof Kozlowski --- 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",