From patchwork Fri Jul 21 11:03:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yingjoe Chen X-Patchwork-Id: 108467 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp493974obm; Fri, 21 Jul 2017 04:03:55 -0700 (PDT) X-Received: by 10.99.8.135 with SMTP id 129mr6931182pgi.273.1500635035191; Fri, 21 Jul 2017 04:03:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500635035; cv=none; d=google.com; s=arc-20160816; b=QYgqHPhU6KzXShyjdVi3bAM42ytmd0hr4/oGAT5n6DXTgCrEeEMoZlxkiT6um7pI/8 /5p4DqkmpuTt+xI92f+pFfP/1J9XWH3lUR8tb3IqTu1c/+HC4bcBkxLAKUm66ZFxrTJE w7Ye3Iix1qBvcwUZvpiby1yvZZqluRscdcoCafhLujF63Yboq/3gHMGVPRyhxjgPDr+W RTOuk817lCLWlrCyPMIwfw/kTd14WfRxiiRkvebhNcp9JwiPUswJwQAHmhA6huCw1qrO n3pknXPBDInnT5rdfCK2kulC75c4Gt6PdwqQ0gWOVooN7TVovoiPUOGETm/GRDyRJP3b gn3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=HGLX7/xBZUbi1FVt+vUCRnhlCfoNLk5UsLIZHLOvb08=; b=eKzDqCB5R9TtJ92lezFtdVfjMPhQu3MjdcJL+TP3k2vH63k6sRkMJGtbGAv6ExC5GU 3DuM7roX6Yw9MZ6a8RF1i4WMVAWwTiXT/sEqvHPemomz1DgmVJj+YfW51uD3XYlyMxBy krWmsXGyueFDoT1VwU/OvXQg55S4wVYPDrjfw/fCeVICvMKDMOJ3sW/Kito7ee8+eDrP L3FB9Ur0NYyuXr4KAGKqLGC6JZUlXuBMzLeU8bxhhNxfOAYZGkq/LhUKjYnVVW2Gkp2c fty+ylh2lWTmgiMRlwtGUkOObuQtFSd5ntVbordsfKMG2VIuaKgU+TDmAYIAk/9hfMVN P4sA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k22si2141604pgf.319.2017.07.21.04.03.54; Fri, 21 Jul 2017 04:03:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753910AbdGULDw (ORCPT + 25 others); Fri, 21 Jul 2017 07:03:52 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:61162 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751658AbdGULDu (ORCPT ); Fri, 21 Jul 2017 07:03:50 -0400 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 211570632; Fri, 21 Jul 2017 19:03:46 +0800 Received: from mtkexhb02.mediatek.inc (172.21.101.103) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 21 Jul 2017 19:03:45 +0800 Received: from localhost.localdomain (172.21.77.4) by mtkexhb02.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Fri, 21 Jul 2017 19:03:46 +0800 From: Yingjoe Chen To: Andy Whitcroft , Joe Perches CC: "linux-kernel@vger.kernel.org" , srv_heupstream , Andi Kleen , Paul Bolle , , Yingjoe Chen Subject: [PATCH] checkpatch: testing more config for Kconfig help text Date: Fri, 21 Jul 2017 19:03:37 +0800 Message-ID: <1500635017-1471-1-git-send-email-yingjoe.chen@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Current help text check only check a config option if it is followed by another config. Adding check for help text if the next entry is menuconfig, choice/ endchoice, comment, menu/endmenu, if/endif, source or end of file. Change-Id: I9f0b29cebb93df2cadaf77d1027208fd01efd976 Signed-off-by: Yingjoe Chen --- Hi, This was sent in Jun 2016[1]. I think we should check every configs for help text. Please let me know if there's anything need to change. Thanks Joe.C [1] https://lkml.org/lkml/2016/6/24/360 --- scripts/checkpatch.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 1.7.9.5 diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 2287a0b..f778702 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2778,6 +2778,12 @@ sub process { next if ($f =~ /^-/); last if (!$file && $f =~ /^\@\@/); + if ($f !~ /^[+\- ]/) { + # End of file + $is_end = 1; + last; + } + if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate)\s*\"/) { $is_start = 1; } elsif ($lines[$ln - 1] =~ /^\+\s*(?:---)?help(?:---)?$/) { @@ -2788,7 +2794,7 @@ sub process { $f =~ s/#.*//; $f =~ s/^\s+//; next if ($f =~ /^$/); - if ($f =~ /^\s*config\s/) { + if ($f =~ /^(?:config\s|menuconfig\s|choice\s|endchoice\s*$|comment\s|menu\s|endmenu\s*$|if\s|endif\s*$|source\s)/) { $is_end = 1; last; }