From patchwork Fri Nov 10 06:32:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 118506 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp7545510qgn; Thu, 9 Nov 2017 22:32:56 -0800 (PST) X-Google-Smtp-Source: ABhQp+QMk3254TwI027u4lG+nrgikizcogzaCOKnGIIVdpw5YBLvald4g3Pz/nqQKLjR3fmZJM20 X-Received: by 10.98.242.66 with SMTP id y2mr3255263pfl.150.1510295576535; Thu, 09 Nov 2017 22:32:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510295576; cv=none; d=google.com; s=arc-20160816; b=FoA/l+cCFq+x1djjVhvSLIUZ1UpcgSVL7xg8W/u1C7hCjQ3WB9mQQNFPf8orV+E0cK EbIfLtLIU8FFQZL8zmk1FkVNLtSeXLEbtdRlEQ0sPkxxGaBzeLbI/XhqWRR1xJ058hvO Gvg3WvsLcvLfoWsFMOoYhOg1jD3pBsZ6EIOVyktw3Kx8GsMKXRNmV3e23atbUaaziTGg uUmmNzoBvOeD24771a+xe3mEa12G62lA4ZFId1uE1XiYZ07KdhWD8DJg6qvYV/Qi0NhA op5TWq4AR1DGkprW4l9HNk/EVLcvSXZqZnUos/XvC/ZX0JMduHX7QwRSmcon0Fo9GBq3 7Npw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=E02uyTCy6//1ESXSROOTXFwx8dIVI9nUUcWpVlgr7Ig=; b=EiEa0ZS+zxhe/4cqiHGjPtCAP57BffhFpkQCms99s1hlJVeQsVz0j2+ky8Ae6jliPp f+RZu22rfq3JPdNbScRjdcnTycSLnQM418HizrCQUrEnhDYIvshWRJV6Tc+JFnI5lbT4 lIQIhxXxRJ8Zf4MoUTcGsaGLu6bMKr7nFvjYtfLrA943o39in7IURSxTsvJizJVmDY0i nqPa/Kg5WQBLeA8vd0g9IaQXKangAcVJYLHz5pNJIAm88LAheMA7Do74BXmUysHsjwDI yy4cD/7y2gMor36kLdDhtCP2M91MQNaGkvSpY5McvBrzB7m5XK7meuQaBudc8V2GT0n6 T55g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bgQoZk/R; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bb5si7675436plb.22.2017.11.09.22.32.56; Thu, 09 Nov 2017 22:32:56 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=bgQoZk/R; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755196AbdKJGcy (ORCPT + 26 others); Fri, 10 Nov 2017 01:32:54 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:53911 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754868AbdKJGcw (ORCPT ); Fri, 10 Nov 2017 01:32:52 -0500 Received: by mail-wm0-f53.google.com with SMTP id g141so505350wmg.2 for ; Thu, 09 Nov 2017 22:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=E02uyTCy6//1ESXSROOTXFwx8dIVI9nUUcWpVlgr7Ig=; b=bgQoZk/Rk/HranKVexjz5l4VJS33VVmfOZrRM54VMhjKmTMh3n+VfevTwm+uu01sdy hHjt7aH+CT7fp/1GY4z34KpRxnV6/qop6Xreh6fxuFBAYFTCXerdOygtYQBLBtZ0jcop I4DgrRCAslqI/hpNt0qDPSfJSq5yUP8wMqlKw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=E02uyTCy6//1ESXSROOTXFwx8dIVI9nUUcWpVlgr7Ig=; b=OT7Hq3QBXGoYBQyeQ7+T/E6dc3d5mp8SfV/2z3cuq+yV4GsXpBaKmu2+SO9BB90WOi YcoLm2IhbEd19ERwNs+Mx2/SX/whFrPKQR8IklnOePDbh/EBVON53jk2ajY5JPK467yk 2ZNr7drNsxoGgz7bgRzxNH9e0LgAtNYOwpiP2erNqDJkvCpWsWXB/N/c85XBY17bPxPe LdmtxVbsYDuwwGA05vS6ZGHBA9g+zWYKl4leVz4KHoksip+LjrrFjK2aRQ3RHxx03A+Y UtG7btTnlW0vnrMiD/ODdtNq8T+qGBU+W5F0DiksdJaxnhoAMg7lV+Pz5i5vbbDKPdKS S4RQ== X-Gm-Message-State: AJaThX5ykT3FKcFUYbvMB3IWKaO4xCs9kwF45XoBh+HhydcsPaGFzhzh FHqWTdPKo9ptNGH2ykVHzTm8Ew== X-Received: by 10.28.239.12 with SMTP id n12mr226517wmh.140.1510295571837; Thu, 09 Nov 2017 22:32:51 -0800 (PST) Received: from localhost.localdomain (li1530-42.members.linode.com. [139.162.245.42]) by smtp.gmail.com with ESMTPSA id t189sm385229wmf.43.2017.11.09.22.32.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Nov 2017 22:32:50 -0800 (PST) From: Leo Yan To: Andy Whitcroft , Joe Perches , linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH] checkpatch: Fix checks for Kconfig help text Date: Fri, 10 Nov 2017 14:32:37 +0800 Message-Id: <1510295557-11950-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If one patch has Kconfig section with only one 'config', then variable '$is_start' will be set by first 'config' line and '$is_end' set by the second 'config' line. But patches often has only one 'config' line so we have no chance to set '$is_end', as result below condition is invalid and it skips check for Kconfig description: if ($is_start && $is_end && $length < $min_conf_desc_length) { ...... } When script runs to this condition sentence it means the Kconfig section parsing has been completed, whatever '$is_end' is true or not. So removes '$is_end' from condition sentence. Another change is to change '$min_conf_desc_length' from 4 to 1; so can pass the check if the Kconfig description has at least one line. Signed-off-by: Leo Yan --- scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 3453df9..ba724b0 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -51,7 +51,7 @@ my $configuration_file = ".checkpatch.conf"; my $max_line_length = 80; my $ignore_perl_version = 0; my $minimum_perl_version = 5.10.0; -my $min_conf_desc_length = 4; +my $min_conf_desc_length = 1; my $spelling_file = "$D/spelling.txt"; my $codespell = 0; my $codespellfile = "/usr/share/codespell/dictionary.txt"; @@ -2796,7 +2796,7 @@ sub process { } $length++; } - if ($is_start && $is_end && $length < $min_conf_desc_length) { + if ($is_start && $length < $min_conf_desc_length) { WARN("CONFIG_DESCRIPTION", "please write a paragraph that describes the config symbol fully\n" . $herecurr); }