Skip to content

Commit d5c2792

Browse files
RobertCElliottintel-lab-lkp
authored andcommitted
checkpatch: discard processed lines
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) torvalds#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) torvalds#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 <[email protected]>
1 parent 7189633 commit d5c2792

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

scripts/checkpatch.pl

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,21 +1977,25 @@ sub raw_line {
19771977
$cnt++;
19781978

19791979
my $line;
1980+
my $consumed;
19801981
while ($cnt) {
19811982
$line = $rawlines[$offset++];
1983+
$consumed++;
19821984
next if (defined($line) && $line =~ /^-/);
19831985
$cnt--;
19841986
}
19851987

1986-
return $line;
1988+
return ($line, $consumed);
19871989
}
19881990

19891991
sub get_stat_real {
19901992
my ($linenr, $lc) = @_;
19911993

1992-
my $stat_real = raw_line($linenr, 0);
1994+
my ($stat_real, $consumed) = raw_line($linenr, 0);
19931995
for (my $count = $linenr + 1; $count <= $lc; $count++) {
1994-
$stat_real = $stat_real . "\n" . raw_line($count, 0);
1996+
my ($more, $consumed) = raw_line($count, 0);
1997+
$stat_real = $stat_real . "\n" . $more;
1998+
$count += $consumed - 1;
19951999
}
19962000

19972001
return $stat_real;
@@ -2002,7 +2006,8 @@ sub get_stat_here {
20022006

20032007
my $herectx = $here . "\n";
20042008
for (my $n = 0; $n < $cnt; $n++) {
2005-
$herectx .= raw_line($linenr, $n) . "\n";
2009+
my ($more, $consumed) = raw_line($linenr, $n);
2010+
$herectx .= $more . "\n";
20062011
}
20072012

20082013
return $herectx;
@@ -4373,7 +4378,7 @@ sub process {
43734378
}
43744379

43754380
my (undef, $sindent) = line_stats("+" . $s);
4376-
my $stat_real = raw_line($linenr, $cond_lines);
4381+
my ($stat_real, $consumed) = raw_line($linenr, $cond_lines);
43774382

43784383
# Check if either of these lines are modified, else
43794384
# this is not this patch's fault.
@@ -5470,7 +5475,7 @@ sub process {
54705475
$herectx = $here . "\n";
54715476
my $cnt = statement_rawlines($if_stat);
54725477
for (my $n = 0; $n < $cnt; $n++) {
5473-
my $rl = raw_line($linenr, $n);
5478+
my ($rl, $consumed) = raw_line($linenr, $n);
54745479
$herectx .= $rl . "\n";
54755480
last if $rl =~ /^[ \+].*\{/;
54765481
}
@@ -5667,8 +5672,9 @@ sub process {
56675672
my $cond_lines = 1 + $#newlines;
56685673
my $stat_real = '';
56695674

5670-
$stat_real = raw_line($linenr, $cond_lines)
5671-
. "\n" if ($cond_lines);
5675+
my $consumed;
5676+
($stat_real, $consumed) = raw_line($linenr, $cond_lines)
5677+
. "\n" if ($cond_lines);
56725678
if (defined($stat_real) && $cond_lines > 1) {
56735679
$stat_real = "[...]\n$stat_real";
56745680
}
@@ -7074,7 +7080,7 @@ sub process {
70747080
my $cnt = statement_rawlines($stat);
70757081
my $herectx = $here . "\n";
70767082
for (my $n = 0; $n < $cnt; $n++) {
7077-
my $rl = raw_line($linenr, $n);
7083+
my ($rl, $consumed) = raw_line($linenr, $n);
70787084
$herectx .= $rl . "\n";
70797085
$ok = 1 if ($rl =~ /^[ \+]\{/);
70807086
$ok = 1 if ($rl =~ /\{/ && $n == 0);

0 commit comments

Comments
 (0)