* [PATCH] checkpatch: do not exit in main process subroutine
@ 2013-03-28 3:43 zhangwei(Jovi)
2013-03-30 10:30 ` zhangwei(Jovi)
0 siblings, 1 reply; 4+ messages in thread
From: zhangwei(Jovi) @ 2013-03-28 3:43 UTC (permalink / raw)
To: Andy Whitcroft, Joe Perches, linux-kernel
Currently checkpatch program exit when process empty file,
This will cause issue when @ARGV include many files ready to check.
For example, there may have Module.symvers empty file in kernel directory.
[root@jovi ~]# scripts/checkpatch.pl -f kernel/*
then many file "after" empty file will not be check by script.
so disallow exit in main process subroutine.
Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@huawei.com>
---
scripts/checkpatch.pl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b28cc38..6924733 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3634,19 +3634,19 @@ sub process {
# If we have no input at all, then there is nothing to report on
# so just keep quiet.
if ($#rawlines == -1) {
- exit(0);
+ return $clean;
}
# In mailback mode only produce a report in the negative, for
# things that appear to be patches.
if ($mailback && ($clean == 1 || !$is_patch)) {
- exit(0);
+ return $clean;
}
# This is not a patch, and we are are in 'no-patch' mode so
# just keep quiet.
if (!$chk_patch && !$is_patch) {
- exit(0);
+ return $clean;
}
if (!$is_patch) {
--
1.7.9.7
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] checkpatch: do not exit in main process subroutine
2013-03-28 3:43 [PATCH] checkpatch: do not exit in main process subroutine zhangwei(Jovi)
@ 2013-03-30 10:30 ` zhangwei(Jovi)
2013-03-31 4:30 ` Joe Perches
2013-04-01 3:55 ` Joe Perches
0 siblings, 2 replies; 4+ messages in thread
From: zhangwei(Jovi) @ 2013-03-30 10:30 UTC (permalink / raw)
To: Andy Whitcroft, Joe Perches, linux-kernel
On 2013/3/28 11:43, zhangwei(Jovi) wrote:
> Currently checkpatch program exit when process empty file,
> This will cause issue when @ARGV include many files ready to check.
>
> For example, there may have Module.symvers empty file in kernel directory.
>
> [root@jovi ~]# scripts/checkpatch.pl -f kernel/*
>
> then many file "after" empty file will not be check by script.
> so disallow exit in main process subroutine.
>
> Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@huawei.com>
Joe, Ping?
> ---
> scripts/checkpatch.pl | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index b28cc38..6924733 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3634,19 +3634,19 @@ sub process {
> # If we have no input at all, then there is nothing to report on
> # so just keep quiet.
> if ($#rawlines == -1) {
> - exit(0);
> + return $clean;
> }
>
> # In mailback mode only produce a report in the negative, for
> # things that appear to be patches.
> if ($mailback && ($clean == 1 || !$is_patch)) {
> - exit(0);
> + return $clean;
> }
>
> # This is not a patch, and we are are in 'no-patch' mode so
> # just keep quiet.
> if (!$chk_patch && !$is_patch) {
> - exit(0);
> + return $clean;
> }
>
> if (!$is_patch) {
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] checkpatch: do not exit in main process subroutine
2013-03-30 10:30 ` zhangwei(Jovi)
@ 2013-03-31 4:30 ` Joe Perches
2013-04-01 3:55 ` Joe Perches
1 sibling, 0 replies; 4+ messages in thread
From: Joe Perches @ 2013-03-31 4:30 UTC (permalink / raw)
To: zhangwei(Jovi); +Cc: Andy Whitcroft, linux-kernel
On Sat, 2013-03-30 at 18:30 +0800, zhangwei(Jovi) wrote:
> On 2013/3/28 11:43, zhangwei(Jovi) wrote:
> > Currently checkpatch program exit when process empty file,
> > This will cause issue when @ARGV include many files ready to check.
> >
> > For example, there may have Module.symvers empty file in kernel directory.
> >
> > [root@jovi ~]# scripts/checkpatch.pl -f kernel/*
> >
> > then many file "after" empty file will not be check by script.
> > so disallow exit in main process subroutine.
> >
> > Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@huawei.com>
> Joe, Ping?
Off on a holiday. Will check later.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] checkpatch: do not exit in main process subroutine
2013-03-30 10:30 ` zhangwei(Jovi)
2013-03-31 4:30 ` Joe Perches
@ 2013-04-01 3:55 ` Joe Perches
1 sibling, 0 replies; 4+ messages in thread
From: Joe Perches @ 2013-04-01 3:55 UTC (permalink / raw)
To: zhangwei(Jovi); +Cc: Andy Whitcroft, linux-kernel
On Sat, 2013-03-30 at 18:30 +0800, zhangwei(Jovi) wrote:
> On 2013/3/28 11:43, zhangwei(Jovi) wrote:
> > Currently checkpatch program exit when process empty file,
> > This will cause issue when @ARGV include many files ready to check.
[]
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > @@ -3634,19 +3634,19 @@ sub process {
> > # If we have no input at all, then there is nothing to report on
> > # so just keep quiet.
> > if ($#rawlines == -1) {
> > - exit(0);
> > + return $clean;
> > }
I think instead this should be something like adding
if (!is_patch && $#rawlines == -1) {
return $clean;
}
though maybe expecting checkpatch to avoid empty files
when fed a directory list is unrealistic.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-01 3:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-28 3:43 [PATCH] checkpatch: do not exit in main process subroutine zhangwei(Jovi)
2013-03-30 10:30 ` zhangwei(Jovi)
2013-03-31 4:30 ` Joe Perches
2013-04-01 3:55 ` Joe Perches
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.