* [PATCH][try #2] checkpatch: clear the report buffer after processing a file
@ 2008-01-15 9:45 Li Zefan
2008-01-17 18:30 ` Andy Whitcroft
0 siblings, 1 reply; 2+ messages in thread
From: Li Zefan @ 2008-01-15 9:45 UTC (permalink / raw)
To: apw; +Cc: Randy Dunlap, LKML
When checking multiple files, the report buffer is not cleared
after processing a file, thus the report will be printed again
and again, mixing up with other reports.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
scripts/checkpatch.pl | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 579f50f..a88f7a1 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -624,16 +624,15 @@ sub possible {
my $prefix = '';
-my @report = ();
sub report {
my $line = $prefix . $_[0];
$line = (split('\n', $line))[0] . "\n" if ($terse);
- push(@report, $line);
+ push(our @report, $line);
}
sub report_dump {
- @report;
+ our @report;
}
sub ERROR {
report("ERROR: $_[0]\n");
@@ -670,6 +669,7 @@ sub process {
my $signoff = 0;
my $is_patch = 0;
+ our @report = ();
our $cnt_lines = 0;
our $cnt_error = 0;
our $cnt_warn = 0;
--
1.5.3.rc7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][try #2] checkpatch: clear the report buffer after processing a file
2008-01-15 9:45 [PATCH][try #2] checkpatch: clear the report buffer after processing a file Li Zefan
@ 2008-01-17 18:30 ` Andy Whitcroft
0 siblings, 0 replies; 2+ messages in thread
From: Andy Whitcroft @ 2008-01-17 18:30 UTC (permalink / raw)
To: Li Zefan; +Cc: Randy Dunlap, LKML
On Tue, Jan 15, 2008 at 05:45:23PM +0800, Li Zefan wrote:
>
> When checking multiple files, the report buffer is not cleared
> after processing a file, thus the report will be printed again
> and again, mixing up with other reports.
>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Yep, this is clearly broken. Never used it with more than one file. We
also accumulate the files in the current version. I'll fix that up as I
merge this.
Thanks for the patch.
-apw
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-17 18:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-15 9:45 [PATCH][try #2] checkpatch: clear the report buffer after processing a file Li Zefan
2008-01-17 18:30 ` Andy Whitcroft
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox