Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8224321rwb; Wed, 23 Nov 2022 17:56:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf6CdeKO4DIAHz0ojsefmQZAJCczJIb387BLbljFqyoMU0XDsq41vzeylRWW+mZU3MquH1nX X-Received: by 2002:a17:906:5e49:b0:7ae:38fd:45e9 with SMTP id b9-20020a1709065e4900b007ae38fd45e9mr24951855eju.496.1669254974900; Wed, 23 Nov 2022 17:56:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669254974; cv=none; d=google.com; s=arc-20160816; b=RqBlW7ZiyW1glfa7ZnNLETF3MlT2hf5RiApIuIbJS14dxiccjompPBd7brLDjOxVMz mhxM4+j2c9ZZSR+jksJdQP9WCT+OYDLlxkoX5ShzcQX2SeFvvgqb8L83+7Uyh5dpLdd/ NOrxF0UvIooOpDLlHBlpOeZ+wkF3f0zVzylPnudmCoRTvoGuSeOQXpGWyE38AScuMzEt v4UKwAdvg1aiDmrJOZR+QT6uCr82Isg1Ngt5kxj7gM9DnSxH/bZL9ENHP+SWcKCxtUY6 wBGtbN7N2QKlY9bTzcqBZTy9/++7l24934avNqZ8ueOd+0JuxajvVBn9W2fazXSZupFP 4EYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=BZUQt/bCD4IKnKqeZTEBp/853xfmgBepJvKYYeg2tVU=; b=OPY6pTJjLhN0/afbDBmOfxkBkAanClcO2HNNaG0SYVjniXnwFl1UDK4MjCVVDA2JLs DEjvnVsZiXkrX3dEIuP08FWPXoJH87vdoKhcCJ9wZwdDapz4DY6K9YrrDQ/dxGtkAqCc 4ZJxFHTXPqzvTR+kzP/YxkczAVkuUKalbys+iHubAvAKr/U80DMIT1qeKIkCojGvzDY1 xG9VJ2QrW8A31gyxZrPTbi2kNUiYOlUIj8l1ghznCzldPY8mWp0gpK3i4XIgrZDg2Fj4 BNFQ9KXE5s+MyxpGXQBaqZIoJEPgeDn+EvB9pcZH5lllRTzWVON59fiFw6/KS67clx84 hSNg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hz5-20020a1709072ce500b007832270e88fsi16136525ejc.681.2022.11.23.17.55.53; Wed, 23 Nov 2022 17:56:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229685AbiKXBH1 convert rfc822-to-8bit (ORCPT + 89 others); Wed, 23 Nov 2022 20:07:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbiKXBHX (ORCPT ); Wed, 23 Nov 2022 20:07:23 -0500 Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B199107E41 for ; Wed, 23 Nov 2022 17:07:19 -0800 (PST) Received: from omf17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 208CE80A07; Thu, 24 Nov 2022 01:07:18 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf17.hostedemail.com (Postfix) with ESMTPA id F017E17; Thu, 24 Nov 2022 01:06:15 +0000 (UTC) Message-ID: Subject: Re: [PATCH v2 4/5] checkpatch: discard processed lines From: Joe Perches To: Robert Elliott , apw@canonical.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com Cc: linux-kernel@vger.kernel.org Date: Wed, 23 Nov 2022 17:07:13 -0800 In-Reply-To: <20221123011202.939319-5-elliott@hpe.com> References: <20220815041548.43744-1-elliott@hpe.com> <20221123011202.939319-1-elliott@hpe.com> <20221123011202.939319-5-elliott@hpe.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Rspamd-Queue-Id: F017E17 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Stat-Signature: gxojzz9ugihcx1jd7hsaf7rwwxdoqgw7 X-Rspamd-Server: rspamout08 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1/1dH/31XdCAQqn1/+dOIJFSDgsLu2+34c= X-HE-Tag: 1669251975-79764 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 On Tue, 2022-11-22 at 19:12 -0600, Robert Elliott wrote: > Advance the line numbers so messages don't repeat previously > processed lines. I am concerned that this would create new breakage on existing patch content. Please show me this does not. > > 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)fu > #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);