From patchwork Fri Nov 10 06:42: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: 118507 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp7552868qgn; Thu, 9 Nov 2017 22:42:55 -0800 (PST) X-Google-Smtp-Source: ABhQp+SkNYXkz2yvIGBBEXOviFxGzczNloX6+QMnesuCKAeTAb4R6ylDcwO9Y89W2JixWJ6Mi+qU X-Received: by 10.84.228.193 with SMTP id y1mr3136352pli.404.1510296175653; Thu, 09 Nov 2017 22:42:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510296175; cv=none; d=google.com; s=arc-20160816; b=sA9p7pbEtTdBuG3ZtSciYTIIy1RidwZSh/1tqRcnq+bWVqwizywhIySw775Ux6/FB7 DIFb/fdlzuPCUYAHyBsMu5g6AtHC1C4grRA7m7SZ65KisjYeD5LWJB0OyTai2DkBfzWb qGePafzC8TfGLk1Nbl9splPxGH0xxld53mRD0w17N3+JPZASswa0DALs/qEl/L5mpJZC fN203ewhIIchICHLfpdJD1A96Q/NoJf5v7Crt7FuPcpnEhTFHrgPNyefrj6x0WB+6cga K4VDmM7tNTzIu8DpbtOKkXIlskoOcuePYHJQMuQjc4V6QyWD+y+n8tb62PqOFLyXCiAT 1IRw== 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=q2kUU1pA5AmHHaHGTu5DOAdVANr6uhj2JJdIO/HNOsg=; b=FQ963pueHgN8rq6nmJX3yaQtWgKt2pMsm8seHORHqwiIBljbGUoc2m7KAZKu0waZfk hmnN8Xte08jC6y4swAWerBDaIjYgcpa+ZvlKHgwpv7VnN3q5GshKd3mOmT4ta0v+5dMW P1WCGWFxH1BIqR8UmJm8tqozptqPwoz59QGm6Vqa7w5VZL66ez79qrHrhN7mCtt/7Qc0 ifc1Mnx/SkRoPl8mvn3lzgSl6YPuHkuH8fMxZ9EQAecocQ+ofyHC3viWaI6+J9z/oViP bz3pSOdn90XhMLKQq0zMHwAHIGYgqQ98Zdp4dAs/793HF1mRhuQbz6dv2Rnnr9XSp1wi gQJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q3f2maAg; 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 u2si8073740pls.461.2017.11.09.22.42.55; Thu, 09 Nov 2017 22:42:55 -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=Q3f2maAg; 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 S1755938AbdKJGmw (ORCPT + 26 others); Fri, 10 Nov 2017 01:42:52 -0500 Received: from mail-wr0-f175.google.com ([209.85.128.175]:47189 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755831AbdKJGmt (ORCPT ); Fri, 10 Nov 2017 01:42:49 -0500 Received: by mail-wr0-f175.google.com with SMTP id k61so7687111wrc.4 for ; Thu, 09 Nov 2017 22:42:48 -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=q2kUU1pA5AmHHaHGTu5DOAdVANr6uhj2JJdIO/HNOsg=; b=Q3f2maAgBhro5t+JQmjPB3bugWTdX23rVaTSfoS2JOVrDdaZ8LdZqEB02dx0V5bWAF dO5aEKOXD0V7RIChJRhlpxuEVg4SK8I86QzmtXpeyhMrvZVPpmf5icR28W/ZKdLLGoNe z986JhbbZ7lzwu7LEC4nUZVkwbaDzujLne2lE= 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=q2kUU1pA5AmHHaHGTu5DOAdVANr6uhj2JJdIO/HNOsg=; b=GbF4I1fl2iJ2fr5YIdaqNWFicLRD8kGQY1eFMUM1mwDhu8k03fsjwZ8PZItSTD2JuW HvHTiSU2gDBxFtrc32awqfGOfQvTqbyBg45Sr0u/Gmie4FXyCTo/GT9Mzia1xq+kDFZc qSky2aucNoQIZHlYnx/LIQqthDboOD4tguoi7ax3A8BvPnL8qos7kRjETnaIn/EuvU5m RfkaRLCddVkFnimqybhZKkfU0w2AXzbd7r1xr5GWX8QoSRtMkpnJ6Hg724oD+n207Tf+ ttifK9AHbLt2troZVSfrjWcWBG34+GlOeEYQrrw4nmXtB6dVfwrAzw1QDzqXWiygUp4a aj7g== X-Gm-Message-State: AJaThX7VmH8BwooPZv3LaYOfHzcw3S2TFSu4c+/nUCsW2jr2vc6+sUiq Zs4BFj8QyLzan5K37lNMl6lnOg== X-Received: by 10.223.128.162 with SMTP id 31mr2492016wrl.258.1510296167773; Thu, 09 Nov 2017 22:42:47 -0800 (PST) Received: from localhost.localdomain (li1530-42.members.linode.com. [139.162.245.42]) by smtp.gmail.com with ESMTPSA id e8sm1243865wmf.46.2017.11.09.22.42.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Nov 2017 22:42:46 -0800 (PST) From: Leo Yan To: Andy Whitcroft , Joe Perches , linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v2] checkpatch: Fix checks for Kconfig help text Date: Fri, 10 Nov 2017 14:42:37 +0800 Message-Id: <1510296157-13041-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, the check script variable '$is_start' will be set by first 'config' line and the variable '$is_end' is to be set by the second 'config' line. But patches often only has 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 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); }