From patchwork Wed Nov 23 01:11:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elliott, Robert (Servers)" X-Patchwork-Id: 24646 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2528832wrr; Tue, 22 Nov 2022 17:16:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf5HWeg7BEDbsVYSppofKxBavmunE2Vfz9DggntMDjDfiHRsjS1onS41A0aq73Bj0e5kk0Yy X-Received: by 2002:a17:90a:9908:b0:213:b6c7:53e1 with SMTP id b8-20020a17090a990800b00213b6c753e1mr34683065pjp.35.1669166203796; Tue, 22 Nov 2022 17:16:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669166203; cv=none; d=google.com; s=arc-20160816; b=cTvHT4g7yBr1v91wMQQTLWcaf7O4azYmdmvyJer4PLxmaxNYlXOZXTGfdEazZv96d2 NQBPesx2FrGDAfTt3ABxj1GNyWHBcWprFxFrx0AJSkkd9gkFOD/TBjngO1KSLM0r0grx VTieaRXPizIhWxdYwmAceIlgNGGbf2Q8HIMSIzZVgJUc4ajtcyORk9pfZF74vgYGEmxA AsQRM3BMmeqO9Sqm8YMJTwpImR0tlyYTmeU2lESTdrOR2mCb9roJkKiMvxvSUc+saUFw SGRT7pTESNKNm3kloyXr3af0EVHIBj4AQGLEsRhGj9hgebuOYbvdBtURB/XSTBofSgGM kvnw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uivm2Ei4DOSRQnGcYSbHK0a5R+84Xf4SNedCaI18Zjg=; b=ByTQL6E4mWrgkbCIaPTgGbXs5akBEvgMVKybY/pxdPIf7Q0m7gu2TgwBqrXF2K6ZjN JY6h732pFgCtE8VdpL1J+LrZdKnOJ+bJqSzUcIb86HitpMAHj9jw/kNvo/jdsMjKo7MY 9LCuJDlTBLtNmDXLw3i+SJTK3i9H6tRoJ1t1jVzyDcOp4AePt5ygf4ya3oXsW8Apo8Z4 A7MNLMIMPePJOydIaWPyyqH/7yJm2V7PQaYDAcJ+vs0dMnlX/so3bQpxD/ZbXRtqb2fb Ux0vJYUcsjUjq2mSTqwwQv5A3G+9Xnd8SWpGxxWGjBRA8i/QAqPr3llqU6GsnP2cJwsE UWrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=ZlJbDUan; 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=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020a63e043000000b0046f4d395e6dsi15815769pgj.573.2022.11.22.17.16.30; Tue, 22 Nov 2022 17:16:43 -0800 (PST) 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=@hpe.com header.s=pps0720 header.b=ZlJbDUan; 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=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235164AbiKWBOR (ORCPT + 99 others); Tue, 22 Nov 2022 20:14:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235516AbiKWBNd (ORCPT ); Tue, 22 Nov 2022 20:13:33 -0500 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28D14E635C for ; Tue, 22 Nov 2022 17:12:24 -0800 (PST) Received: from pps.filterd (m0150242.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AMNgtxi012457; Wed, 23 Nov 2022 01:12:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pps0720; bh=uivm2Ei4DOSRQnGcYSbHK0a5R+84Xf4SNedCaI18Zjg=; b=ZlJbDUanJPxJExx4P9ZRyrAcfWn9sgB6P89l5RY3O6Jv96eCz2vgrZqBpfbWuOWVNrzu 29+bYgCbP1P8x8vBEN/T8rz8cWlr0x/N5K594uIoPs5iHVLchAbPwI0z3Z727SjxIeAl 9jwn2fgthBmEpVx0k5KcpT4Z3nsza2gtpv+G9PrHUlXVH4DYvr5W1nICLTIEjvbSLMvS f6cf0YfVxMuaamXqPeoUfTwbCFOkgW70EshbGbpaY5MCQshp6O8pXQorC24XtmxXomHA JzcOo+Md3TWofHK5Q5xorQzWF7dULrBy+aj/YwTXvfATg2D6HNzRJhix359dd4/bbTB/ eg== Received: from p1lg14881.it.hpe.com (p1lg14881.it.hpe.com [16.230.97.202]) by mx0a-002e3701.pphosted.com (PPS) with ESMTPS id 3m11wabgpj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Nov 2022 01:12:19 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14881.it.hpe.com (Postfix) with ESMTPS id A665E809F5A; Wed, 23 Nov 2022 01:12:18 +0000 (UTC) Received: from adevxp033-sys.us.rdlabs.hpecorp.net (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 5C5018005C6; Wed, 23 Nov 2022 01:12:18 +0000 (UTC) From: Robert Elliott To: apw@canonical.com, joe@perches.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com Cc: linux-kernel@vger.kernel.org, Robert Elliott Subject: [PATCH v2 1/5] checkpatch: improve Kconfig help text patch parsing Date: Tue, 22 Nov 2022 19:11:58 -0600 Message-Id: <20221123011202.939319-2-elliott@hpe.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123011202.939319-1-elliott@hpe.com> References: <20220815041548.43744-1-elliott@hpe.com> <20221123011202.939319-1-elliott@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: wJ5tyofWE0xKsFa1m5XInDX0qX1xzE1p X-Proofpoint-ORIG-GUID: wJ5tyofWE0xKsFa1m5XInDX0qX1xzE1p X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-22_13,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 phishscore=0 impostorscore=0 malwarescore=0 mlxlogscore=998 suspectscore=0 adultscore=0 priorityscore=1501 clxscore=1015 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211230007 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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?1750247621286336972?= X-GMAIL-MSGID: =?utf-8?q?1750247621286336972?= While parsing Kconfig help text, allow the strings that affect parsing (e.g., help, bool, tristate, and prompt) to be in existing text, not just added text (i.e., allow both + and a space character at the beginning of the line). This improves parsing of a patch like: +config CRYPTO_SHA512_S390 + tristate "SHA384 and SHA512 (s390)" + depends on S390 select CRYPTO_HASH help - SHA512 secure hash standard (DFIPS 180-2). + SHA-384 and SHA-512 secure hash algorithms (FIPS 180) - This version of SHA implements a 512 bit hash with 256 bits of - security against collision attacks. + Architecture: s390 - This code also includes SHA-384, a 384 bit hash with 192 bits - of security against collision attacks. + It is available as of z10. Signed-off-by: Robert Elliott --- scripts/checkpatch.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index c8a616a9d034..1d9e563e768a 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3490,11 +3490,11 @@ sub process { next if ($f =~ /^-/); last if ($f !~ /^[\+ ]/); # !patch context - if ($f =~ /^\+\s*(?:bool|tristate|prompt)\s*["']/) { + if ($f =~ /^[\+ ]\s*(?:bool|tristate|prompt)\s*["']/) { $needs_help = 1; next; } - if ($f =~ /^\+\s*help\s*$/) { + if ($f =~ /^[\+ ]\s*help\s*$/) { $has_help = 1; next; } @@ -3519,7 +3519,8 @@ sub process { $help_length < $min_conf_desc_length) { my $stat_real = get_stat_real($linenr, $ln - 1); WARN("CONFIG_DESCRIPTION", - "please write a help paragraph that fully describes the config symbol\n" . "$here\n$stat_real\n"); + "please write $min_conf_desc_length lines of help text that fully describes the config symbol (detected $help_length lines)\n" . + "$here\n$stat_real\n"); } } From patchwork Wed Nov 23 01:11:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elliott, Robert (Servers)" X-Patchwork-Id: 24651 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2529311wrr; Tue, 22 Nov 2022 17:17:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf4aVfNxs5WRwfjnOC2pWANAmw4PdGOnXikCGHsDvZ7UdmqVHKS2VuciFYaM3zpvkuUx2wjh X-Received: by 2002:a17:906:328e:b0:78d:7f22:2c53 with SMTP id 14-20020a170906328e00b0078d7f222c53mr5128373ejw.420.1669166273877; Tue, 22 Nov 2022 17:17:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669166273; cv=none; d=google.com; s=arc-20160816; b=KDfY/Thq72nucDUMszq0/Ku+p4QL6axdsgjWzpPkrqYQYQxm5VmkBW8eLRvQHmHfqu U0n79lAG0+r065aDZy9ncPg8lFTfKyg7s7lrcia4Y55tbw4Q/RczZCuL64GgYumsvC6g xrytZbUDKNAX98YXMH5Mu7/t2Ry6JiZX3aLh3rxyY4Dc833cYr0V9uFvhX9VNOLU1DXC cqJAmERb72/3eGAkHoxgqBO1pH2Ouydx94WaHnlVU94MQcT6XTTJl270OJgeJHwlrqWj 1P821ITcQWzDRuk9VSmASqnoqZBOtpwie44FLtVGkTh426KDYL9xfCRh/Xp6yDdY+XXD 7XYw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=53WUj66kSlTxVlm5E0/810fEfYL6naf3aRf1XIo5+s0=; b=NfJ8hRajsVg886TlrPc2q5oi05PTuJzyBt/3PiOI3F7TcZMrjfhD+r9v0V6wKXHlDm 3Ly3gTtuYacjyOkpqukZGqB2z0+k0aGX61emPjcfWxcY43ZJ17ZZ16REHEzbyEyBouud 2LwDSfmTVJ5C8beoS+TGv302XS4+zxn1oJszcqG2Ict4fft5x8Eod8kwlsu0dx6a3dRq D+153d7UENwhZeKr877+pAQuswtubD9FdpUfMleUICsxqk2C6CqYIXtImU2SFgOyUItP 0+zvi0Vrga37YB89zV/vSJDeW8NgqZ3npkOHedZ79O57Yy+hw32rYxsTc8dHOVaNcP6N MokA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=jcEWBsoQ; 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=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn42-20020a1709070d2a00b0078e319dcca7si13587473ejc.744.2022.11.22.17.17.30; Tue, 22 Nov 2022 17:17:53 -0800 (PST) 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=@hpe.com header.s=pps0720 header.b=jcEWBsoQ; 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=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235163AbiKWBOL (ORCPT + 99 others); Tue, 22 Nov 2022 20:14:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235522AbiKWBNe (ORCPT ); Tue, 22 Nov 2022 20:13:34 -0500 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 941B1E637C for ; Tue, 22 Nov 2022 17:12:24 -0800 (PST) Received: from pps.filterd (m0148663.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AN0uaYm012985; Wed, 23 Nov 2022 01:12:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pps0720; bh=53WUj66kSlTxVlm5E0/810fEfYL6naf3aRf1XIo5+s0=; b=jcEWBsoQEVQB8RnYobxTMMO2hQieHr4zUNoIL3L84rTQ50F+vArtQQmZ6FoCK8xfBxMU QEvrvUp5/sopm0o99IUWwxSernPNDmzOcccv7pKOBcp3K3M89WfJjj+A4jV9gajyBY2o dTf+bVYFAQCDyjgBSD1kSJVK5jGO9jIac0VsGIchKCrfwxagbrznWypuVSazx6P6dVxt loMnHn5+NRALkQUmKn/0q/9aYmTTCZClEO/qc1V74/lzv8dF67GGSRtru56s10n+tlje rsloY9PDP7/PnzPjD3dFRXl8jGXT7ryLv6Ehws396mY9JeDCdPqvkv4Lz2DZ5sEzb/VL Uw== Received: from p1lg14880.it.hpe.com (p1lg14880.it.hpe.com [16.230.97.201]) by mx0a-002e3701.pphosted.com (PPS) with ESMTPS id 3m19cyg342-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Nov 2022 01:12:20 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14880.it.hpe.com (Postfix) with ESMTPS id 3EB568066C3; Wed, 23 Nov 2022 01:12:20 +0000 (UTC) Received: from adevxp033-sys.us.rdlabs.hpecorp.net (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id DC89880037B; Wed, 23 Nov 2022 01:12:19 +0000 (UTC) From: Robert Elliott To: apw@canonical.com, joe@perches.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com Cc: linux-kernel@vger.kernel.org, Robert Elliott Subject: [PATCH v2 2/5] checkpatch: don't sanitise quotes in Kconfig files Date: Tue, 22 Nov 2022 19:11:59 -0600 Message-Id: <20221123011202.939319-3-elliott@hpe.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123011202.939319-1-elliott@hpe.com> References: <20220815041548.43744-1-elliott@hpe.com> <20221123011202.939319-1-elliott@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: o2LeRF8L6v_VKOy71p9bOgqrRcDdy68B X-Proofpoint-GUID: o2LeRF8L6v_VKOy71p9bOgqrRcDdy68B X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-22_13,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 mlxlogscore=642 adultscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211230007 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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?1750247694871918083?= X-GMAIL-MSGID: =?utf-8?q?1750247694871918083?= If Kconfig help text contains a single quote (e.g., can't), checkpatch replaces all characters with X until another quote appears in some later help text. This interferes with processing keywords. Don't sanitise lines if the file is a Kconfig file. Signed-off-by: Robert Elliott --- scripts/checkpatch.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1d9e563e768a..c907d5cf0ac8 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2715,9 +2715,15 @@ sub process { sanitise_line_reset($in_comment); } elsif ($realcnt && $rawline =~ /^(?:\+| |$)/) { - # Standardise the strings and chars within the input to - # simplify matching -- only bother with positive lines. - $line = sanitise_line($rawline); + if (($realfile =~ /Kconfig/) || + (!$is_patch && $filename =~ /Kconfig/)) { + # Kconfig help text is free to use unmatched quotes + $line = $rawline; + } else { + # Standardise the strings and chars within the input to + # simplify matching -- only bother with positive lines. + $line = sanitise_line($rawline); + } } push(@lines, $line); From patchwork Wed Nov 23 01:12:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elliott, Robert (Servers)" X-Patchwork-Id: 24648 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2528881wrr; Tue, 22 Nov 2022 17:16:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf5GJmVaLHaFH7dCZhY778Ll7hCsDwWaqvHr9wZ0ZYfGQIgiyquOnvAdjd3Noo7PdPW8WFnf X-Received: by 2002:a17:906:b28f:b0:7ad:a942:4d6b with SMTP id q15-20020a170906b28f00b007ada9424d6bmr21302928ejz.379.1669166208833; Tue, 22 Nov 2022 17:16:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669166208; cv=none; d=google.com; s=arc-20160816; b=A/IDl4eGExjhmG0AKIMqQfvYV+oWT9cr+SlvFNoGdOnRxmLFDjKHwqVmsgxEfmUhJr OeTyBS1hG7QwepZT/yqTTDfZ1lhXdGU3IBIexlElRkADpA28C07OyN53LJm4lBEUv/u6 ybiI/mk7mgzqPkihyb+tqyGNZ5WvXtk6o852dkfevIzBBFSvR4R79WtaAXNl6HvBLhzZ VrNC6jpiDLaeNj2z6USGUOp6eskMoE4aH5FpOpzFr5xKNA22lUGT8FrhQON0oryKanli pQtcxOLJMtAEX4Je+d3Ikh5RgLRrWyhfvHfhkL8gJSd3n40XcLmWgyr110ijPGbhiZK7 LiZQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ukwxXPbGmLCn1spwphTBIES8Kmvp/s1JITBBYWi1oWM=; b=rTbAaGjBjzX29smWh/3pCcy/B1uaH1rPKEUOun+PGwU00SPOLc9Y4CP3/8+NRhjoCc iCcUNF1cEg1b8aUiYAkFgFanwKczM6TCku1ZehI6YKdiTARw+pNrnLKWYdwqwYOfQeCn LVrA6MVEBq/e/6D8I1w6JBr6bDhroh2BsLC2cjI5L5iXbAqkgE9ZV+93GyksBgvNxij0 ySe1XexUH0Vvm1LMiQ21KaaUHlXImuostZC0jxqZN2KPV7MaktqpSI7gGcyTZqijLWm8 o53Eem37U6GQqPt8I86/7pKZMNpy3ZTu7kE/ynBih7aBGo1aWilB79ysZ/0X4ZKiix3q Xsig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=JM7lzIet; 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=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b20-20020a056402279400b00457e6752422si5953739ede.189.2022.11.22.17.16.24; Tue, 22 Nov 2022 17:16:48 -0800 (PST) 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=@hpe.com header.s=pps0720 header.b=JM7lzIet; 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=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235126AbiKWBOE (ORCPT + 99 others); Tue, 22 Nov 2022 20:14:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235555AbiKWBNh (ORCPT ); Tue, 22 Nov 2022 20:13:37 -0500 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FC64E0AA for ; Tue, 22 Nov 2022 17:12:28 -0800 (PST) Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AMNhDkp003319; Wed, 23 Nov 2022 01:12:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pps0720; bh=ukwxXPbGmLCn1spwphTBIES8Kmvp/s1JITBBYWi1oWM=; b=JM7lzIetQRcwBkmLMXXVKf7U7TqSEA2VZ7GxjorYSPpTB/tgaeAgTHSHwQ/4mDdb2lzl j+bigHyRb7mf43eRbrCxAx5diVukLNWcaL1EnmVIzLFq+o/TugdT43FyIFo8Si9Cewlb GYMk7ZgH4Tf5YeBfgZvzjqG0FPZRfoVE5qpur/k4b68AEuGJsmLmD/mgEzDh9lcYOKZ/ 0+vXcn7czYYzipkyyCGSDqgPOzUhQuj3ej4CmO0twvNszJm/w4ORorrwQw1lpHz4OUUi 2+kq+uCwOHsVbFuJqmdpG2vmaMqfKuH9bzIMQ2V2ImSHGkWz84VhQU8zFlHzSCKXUGq/ bg== Received: from p1lg14878.it.hpe.com (p1lg14878.it.hpe.com [16.230.97.204]) by mx0a-002e3701.pphosted.com (PPS) with ESMTPS id 3m100tcu9t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Nov 2022 01:12:22 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14878.it.hpe.com (Postfix) with ESMTPS id A30952EECF; Wed, 23 Nov 2022 01:12:21 +0000 (UTC) Received: from adevxp033-sys.us.rdlabs.hpecorp.net (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 5BC0E8005C6; Wed, 23 Nov 2022 01:12:21 +0000 (UTC) From: Robert Elliott To: apw@canonical.com, joe@perches.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com Cc: linux-kernel@vger.kernel.org, Robert Elliott Subject: [PATCH v2 3/5] checkpatch: check line length in Kconfig help text Date: Tue, 22 Nov 2022 19:12:00 -0600 Message-Id: <20221123011202.939319-4-elliott@hpe.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123011202.939319-1-elliott@hpe.com> References: <20220815041548.43744-1-elliott@hpe.com> <20221123011202.939319-1-elliott@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: ex98Q3_cjLyTg2i0s1b7KCjL5a6M5tm9 X-Proofpoint-GUID: ex98Q3_cjLyTg2i0s1b7KCjL5a6M5tm9 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-22_13,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=999 adultscore=0 suspectscore=0 spamscore=0 mlxscore=0 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211230007 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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?1750247626317488587?= X-GMAIL-MSGID: =?utf-8?q?1750247626317488587?= Apply the normal --max-line-length=nn line length checks to Kconfig help text. The default of 100 is only triggered by one existing line in a file named Kconfig. Running with --max-line-length=80 reports only a few long lines: - 11 between 90 and 99 characters - 25 betwen 81 and 89 characters 9 of which are due to long URLs. Signed-off-by: Robert Elliott --- scripts/checkpatch.pl | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index c907d5cf0ac8..1b7a98adcaeb 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3496,7 +3496,7 @@ sub process { next if ($f =~ /^-/); last if ($f !~ /^[\+ ]/); # !patch context - if ($f =~ /^[\+ ]\s*(?:bool|tristate|prompt)\s*["']/) { + if ($f =~ /^[\+ ]\s*(?:bool|tristate|string|hex|int|prompt)\s*["']/) { $needs_help = 1; next; } @@ -3515,12 +3515,27 @@ sub process { # and so hopefully shouldn't trigger false # positives, even though some of these are # common words in help texts - if ($f =~ /^(?:config|menuconfig|choice|endchoice| - if|endif|menu|endmenu|source)\b/x) { + if ($f =~ /^(?:config|menuconfig| + choice|endchoice| + comment|if|endif| + menu|endmenu|source)\b/x) { last; } + + # no further checking for lines with these keywords + if ($f =~ /^(?:default|def_bool|depends|select|imply)\b/x) { + next; + } + + my ($length, $indent) = line_stats($f); + if ($length > $max_line_length) { + WARN("CONFIG_DESCRIPTION", + "Kconfig help text line length ($length) too long: $f\n"); + } + $help_length++ if ($has_help); } + if ($needs_help && $help_length < $min_conf_desc_length) { my $stat_real = get_stat_real($linenr, $ln - 1); From patchwork Wed Nov 23 01:12:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elliott, Robert (Servers)" X-Patchwork-Id: 24650 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2529204wrr; Tue, 22 Nov 2022 17:17:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf5bnfGoJ3UGpEubkUy7XJBZrbNySqW3+PH4Z0cJzHWddFNEemyIXqXwFd6G7O7ULnUEz7HL X-Received: by 2002:a17:906:d7b8:b0:79f:9ff6:6576 with SMTP id pk24-20020a170906d7b800b0079f9ff66576mr20939812ejb.414.1669166256888; Tue, 22 Nov 2022 17:17:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669166256; cv=none; d=google.com; s=arc-20160816; b=KDdCKBu51IShPtElBKQFQFErbZ6WQAFwV4OOqwbcKgJhQbcsWTyNxyp6zw2Uv2z2Bj X8OjqYWXw1UubANzkHCWDWuEAj0GKfMc30URiTBSywr4NL7tMx0HXWpJtQXAwk77k0KF I/BXDYklzF/eKeoxZLzaVa2NwSDmxXI66z3yztF9zc56uxymZaeBsGSCh0bJzig/eBZ3 ++wzzT7pA1NcNW1n5q8Rnw8+BdXEedRlhDpN16Bf50yowK8ANfh8LrT7UJSQSOjTCVqY Op36QLOv4ehcrkSIQYjA0VJmnQKjnDkzgp3ZAhxBehWouDvPhz78Qi9lTiWrQY1JRZ60 mHpQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qVouojN9cstmnjrsvce7aW4C98dm2Ear/s92uJ0hoEs=; b=LjeJ7ODjcOxMmh1HsgCPYIN6rHLI7uE2NnhUzzx689g2JsQCfWiKWeWt3Qt1s2Rqf+ tn2Ks+ipzPLPEkvES/cSfr2QxOuQlABGdviYdZWlfqe1bcvEMXhAhgwS6TQ35oakn4Ob ME1vaeYJ1C4THFw6PULdLmTTL6o4RfSABTJO7KFlxdIYmjLjD+nmS1dyydhOmpn5B4vb 5cGGK9rqeNnuqci2xnd+oKfo66JJ9grj/pMyvBF69InWntKtJht81JVQgCTzWak3wrEp Lfyn47svmMaGV8TWS+N71+c5UDfluOVzM8UxH5czFpEcfmfHusVFZ5cniCe1yTpVWY+I q1/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=VnJZms42; 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=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm14-20020a170907948e00b0078da856a4ecsi13923792ejc.391.2022.11.22.17.17.14; Tue, 22 Nov 2022 17:17:36 -0800 (PST) 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=@hpe.com header.s=pps0720 header.b=VnJZms42; 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=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235141AbiKWBOB (ORCPT + 99 others); Tue, 22 Nov 2022 20:14:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235554AbiKWBNh (ORCPT ); Tue, 22 Nov 2022 20:13:37 -0500 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE25926FB for ; Tue, 22 Nov 2022 17:12:27 -0800 (PST) Received: from pps.filterd (m0148664.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AN0xhlB017115; Wed, 23 Nov 2022 01:12:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pps0720; bh=qVouojN9cstmnjrsvce7aW4C98dm2Ear/s92uJ0hoEs=; b=VnJZms42mLdYNRFbc2KOkMN8QmoxNntu4idT2ZmxNvlCGVi4fhBQrQT/42ZwbeYp9dPp GM/lBeAya91wj05de5zEbvoRsVYqt72ivT3BxfycQl1ga3jZIhWTplHus9DIUpHonubl IeoTMudREaXa479IEX0tldp4neIsNSqM/SlTGjhdjQ18B5HmoYGvEthikCl6wDYsD3ij Y1OGxb84IwSaVn1QO0yRywfb+smATogbAk0X4lsYTFii9Lk5HYUPoT/wVDG5wdObrGCB BmtXX5lbRJ4d5OMxxhQhaapH1aoBEbUVbgc7qWhU6UQ0+zSPTgHGC97XWRrGnxwjnM5C 3A== Received: from p1lg14880.it.hpe.com (p1lg14880.it.hpe.com [16.230.97.201]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3m19ebg2x3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Nov 2022 01:12:23 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14880.it.hpe.com (Postfix) with ESMTPS id B3D8D8066C6; Wed, 23 Nov 2022 01:12:22 +0000 (UTC) Received: from adevxp033-sys.us.rdlabs.hpecorp.net (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 6916680037B; Wed, 23 Nov 2022 01:12:22 +0000 (UTC) From: Robert Elliott To: apw@canonical.com, joe@perches.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com Cc: linux-kernel@vger.kernel.org, Robert Elliott Subject: [PATCH v2 4/5] checkpatch: discard processed lines Date: Tue, 22 Nov 2022 19:12:01 -0600 Message-Id: <20221123011202.939319-5-elliott@hpe.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123011202.939319-1-elliott@hpe.com> References: <20220815041548.43744-1-elliott@hpe.com> <20221123011202.939319-1-elliott@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: MM2LWR7p7xorESY3mFSTyIs1UBki2eO5 X-Proofpoint-GUID: MM2LWR7p7xorESY3mFSTyIs1UBki2eO5 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-22_13,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 phishscore=0 mlxlogscore=377 mlxscore=0 adultscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211230007 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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?1750247677089948202?= X-GMAIL-MSGID: =?utf-8?q?1750247677089948202?= Advance the line numbers so messages don't repeat previously processed lines. Before: WARNING: please write 4 lines of help text that fully describes the config symbol (detected 3 lines) #195: FILE: crypto/Kconfig:837: +config CRYPTO_GHASH_CLMUL_NI_INTEL + tristate "GHASH (x86_64 with CLMUL-NI)" depends on X86 && 64BIT + select CRYPTO_CRYPTD + select CRYPTO_CRYPTD + select CRYPTO_CRYPTD help + GCM GHASH hash function (NIST SP800-38D) + GCM GHASH hash function (NIST SP800-38D) Architecture: x86_64 using: + * CLMUL-NI (carry-less multiplication new instructions) + * CLMUL-NI (carry-less multiplication new instructions) + * CLMUL-NI (carry-less multiplication new instructions) +config CRYPTO_GHASH_S390 +config CRYPTO_GHASH_S390 +config CRYPTO_GHASH_S390 +config CRYPTO_GHASH_S390 After: WARNING: please write 4 lines of help text that fully describes the config symbol (detected 3 lines) #195: FILE: crypto/Kconfig:837: +config CRYPTO_GHASH_CLMUL_NI_INTEL + tristate "GHASH (x86_64 with CLMUL-NI)" depends on X86 && 64BIT + select CRYPTO_CRYPTD help + GCM GHASH hash function (NIST SP800-38D) Architecture: x86_64 using: + * CLMUL-NI (carry-less multiplication new instructions) +config CRYPTO_GHASH_S390 Signed-off-by: Robert Elliott --- scripts/checkpatch.pl | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1b7a98adcaeb..d11d58e36ee9 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1971,21 +1971,25 @@ sub raw_line { $cnt++; my $line; + my $consumed; while ($cnt) { $line = $rawlines[$offset++]; + $consumed++; next if (defined($line) && $line =~ /^-/); $cnt--; } - return $line; + return ($line, $consumed); } sub get_stat_real { my ($linenr, $lc) = @_; - my $stat_real = raw_line($linenr, 0); + my ($stat_real, $consumed) = raw_line($linenr, 0); for (my $count = $linenr + 1; $count <= $lc; $count++) { - $stat_real = $stat_real . "\n" . raw_line($count, 0); + my ($more, $consumed) = raw_line($count, 0); + $stat_real = $stat_real . "\n" . $more; + $count += $consumed - 1; } return $stat_real; @@ -1996,7 +2000,8 @@ sub get_stat_here { my $herectx = $here . "\n"; for (my $n = 0; $n < $cnt; $n++) { - $herectx .= raw_line($linenr, $n) . "\n"; + my ($more, $consumed) = raw_line($linenr, $n); + $herectx .= $more . "\n"; } return $herectx; @@ -4323,7 +4328,7 @@ sub process { } my (undef, $sindent) = line_stats("+" . $s); - my $stat_real = raw_line($linenr, $cond_lines); + my ($stat_real, $consumed) = raw_line($linenr, $cond_lines); # Check if either of these lines are modified, else # this is not this patch's fault. @@ -5420,7 +5425,7 @@ sub process { $herectx = $here . "\n"; my $cnt = statement_rawlines($if_stat); for (my $n = 0; $n < $cnt; $n++) { - my $rl = raw_line($linenr, $n); + my ($rl, $consumed) = raw_line($linenr, $n); $herectx .= $rl . "\n"; last if $rl =~ /^[ \+].*\{/; } @@ -5617,8 +5622,9 @@ sub process { my $cond_lines = 1 + $#newlines; my $stat_real = ''; - $stat_real = raw_line($linenr, $cond_lines) - . "\n" if ($cond_lines); + my $consumed; + ($stat_real, $consumed) = raw_line($linenr, $cond_lines) + . "\n" if ($cond_lines); if (defined($stat_real) && $cond_lines > 1) { $stat_real = "[...]\n$stat_real"; } @@ -7024,7 +7030,7 @@ sub process { my $cnt = statement_rawlines($stat); my $herectx = $here . "\n"; for (my $n = 0; $n < $cnt; $n++) { - my $rl = raw_line($linenr, $n); + my ($rl, $consumed) = raw_line($linenr, $n); $herectx .= $rl . "\n"; $ok = 1 if ($rl =~ /^[ \+]\{/); $ok = 1 if ($rl =~ /\{/ && $n == 0); From patchwork Wed Nov 23 01:12:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elliott, Robert (Servers)" X-Patchwork-Id: 24647 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2528847wrr; Tue, 22 Nov 2022 17:16:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf6zibG5ehn2ed/6EL40y6JccTv3zS8vw38rcsqtqaE0mBPkRG0b6QERc4yjuszFLqa+w2Bp X-Received: by 2002:aa7:cb8d:0:b0:467:bc1f:ca16 with SMTP id r13-20020aa7cb8d000000b00467bc1fca16mr24000753edt.269.1669166205806; Tue, 22 Nov 2022 17:16:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669166205; cv=none; d=google.com; s=arc-20160816; b=ae2luzpEBdFeeJzDLIlbOrl+OgGWaOMiOmXFsA0jMMwmTutEMbv0dt5YmPur7KmyKD 9WhmDcaaFAJvzzyuhPimKu05LIZ2i2V5x3oaMK+RBfSP2hJmfMPMknwVfQqyG0ynPL+b 94CmO3gTXjUvSNPt69jFfa8+tdjtNsgjDEASj6pyuBe9rwm1EAcTWzYkvv/cEimOf9eY CRlNUMbOh/JQpDL6SLIVPKzap/H63uOBI4wHa4NK5WEJD1udfXNFMqr6VQI6ax2iZWjC 4aDAFizpC0Fv1YVF+GXCJTLKvxFDxiUIuQJMSmWodOihheIUM2rRpj30vp7Zm8VD2KU9 JPeg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/RlTiZLWuG8bRJv8ZA7ysw/ihW0wSsUpLCj7eFOnAnA=; b=U+V5t5Hc6w3VVr2C79zXlgSPoV53ukhPUmrxT2gxMXEEXQ7Vga3xJ+nnTaCvuj7Cu8 VUOgfPjmFuNdSVMWupAWfarVvnbsrFyqt7E11nXRSEWUZa49x0Ry+NCry/cVBwLQHBYX ppz/hO6pOqZaou8rPwWeUkJgd9ISy9b/2+kSEiTTd2PL33H0Y+0Qh6xxJxJ8D/UyBwnI sjTL58cu+HFAlUhsoev2mJlqulv8+WUfT9u8KM49KYrVwTiUILXo9qJqKan7TyR3NkWx SqLnaya64FH5TUTu76ugYETfBVwrbooCTYgyy0qUXU1RHh8Qg0vhnup41P/3cVe32bvM yuxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=C5WpVZEs; 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=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w22-20020a05640234d600b0045b293121f1si6825557edc.12.2022.11.22.17.16.22; Tue, 22 Nov 2022 17:16:45 -0800 (PST) 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=@hpe.com header.s=pps0720 header.b=C5WpVZEs; 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=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235396AbiKWBOI (ORCPT + 99 others); Tue, 22 Nov 2022 20:14:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235535AbiKWBNf (ORCPT ); Tue, 22 Nov 2022 20:13:35 -0500 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE30A2AFB for ; Tue, 22 Nov 2022 17:12:27 -0800 (PST) Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AMNgJd1029821; Wed, 23 Nov 2022 01:12:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pps0720; bh=/RlTiZLWuG8bRJv8ZA7ysw/ihW0wSsUpLCj7eFOnAnA=; b=C5WpVZEs0T+vQS+oNjlXTSRU7BPRD97eT7MhiLpwwx+I1QhpSVqUrek5RHpSn/RNEARt So9QAbD+e1EofHGqn40qyWg376cn8kj81KpA5tQlkWAAWRQhS160Lyqz8egPb9uaShLx WfRZ9UBIJKCH3k0r+m42N6rn4Ac4CZXYGy6nnyzPc2m1mz+ayCrkPJrYAk6OHPm3glja W7VvAUnCNHNOok3uVFy+0ovTHASwM09IQ3vQopec8XK8jwFN+pdq6AXVBhWjAPSo3ZFe 2Xn7JeTJf9KhTtS6NYragGdz4Z3ObSMHByEZzLxb9PAlRNcp0YLyEea+tpKRpN8OpxBO Cw== Received: from p1lg14879.it.hpe.com (p1lg14879.it.hpe.com [16.230.97.200]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3m13u0tehx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Nov 2022 01:12:24 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14879.it.hpe.com (Postfix) with ESMTPS id C02192FCC1; Wed, 23 Nov 2022 01:12:23 +0000 (UTC) Received: from adevxp033-sys.us.rdlabs.hpecorp.net (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 6E105800369; Wed, 23 Nov 2022 01:12:23 +0000 (UTC) From: Robert Elliott To: apw@canonical.com, joe@perches.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com Cc: linux-kernel@vger.kernel.org, Robert Elliott Subject: [PATCH v2 5/5] checkpatch: ignore a file named b Date: Tue, 22 Nov 2022 19:12:02 -0600 Message-Id: <20221123011202.939319-6-elliott@hpe.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123011202.939319-1-elliott@hpe.com> References: <20220815041548.43744-1-elliott@hpe.com> <20221123011202.939319-1-elliott@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 1-ryaoU6EXcneHyP9pUzEm3YoYVfT46s X-Proofpoint-GUID: 1-ryaoU6EXcneHyP9pUzEm3YoYVfT46s X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-22_13,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=630 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 suspectscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211230007 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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?1750247623397047199?= X-GMAIL-MSGID: =?utf-8?q?1750247623397047199?= If a file named "b" happens to exist, checkpatch complains as it parses the patch lines specifying the filenames. WARNING: patch prefix 'b' exists, appears to be a -p0 patch Squelch that by only complaining if that is a directory, not a regular file, and print the whole path causing concern. WARNING: patch prefix './b' exists, appears to be a -p0 patch Signed-off-by: Robert Elliott --- scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d11d58e36ee9..5a0252265d3f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2834,9 +2834,9 @@ sub process { $p1_prefix = $1; if (!$file && $tree && $p1_prefix ne '' && - -e "$root/$p1_prefix") { + -d "$root/$p1_prefix") { WARN("PATCH_PREFIX", - "patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n"); + "patch prefix '$root/$p1_prefix' exists, appears to be a -p0 patch\n"); } if ($realfile =~ m@^include/asm/@) {