All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RFC] Removing wrong judgement of checkpatch.pl for return as function
@ 2009-11-03  1:49 Hitoshi Mitake
  2009-11-06 22:28 ` Andy Whitcroft
  0 siblings, 1 reply; 5+ messages in thread
From: Hitoshi Mitake @ 2009-11-03  1:49 UTC (permalink / raw)
  To: Andy Whitcroft, linux-kernel


Hi,

I found a strange behaviour of checkpatch.pl.

The C statement:
	return (type)value;
is regarded as return like a function form by checkpatch.pl.
So checkpatch.pl causes "Return is not a function." error
when processing statements like this.

I think statements like above are innocence. These are only doing type cast.
This patch removes the behaviour of checkpatch.pl.

But I don't have confidence about coding style of Linux kernel.
Is my thought correct? Or the behaviour of current checkpatch.pl is correct?
Request for comment.

Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>

---
 scripts/checkpatch.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index bc4114f..04a876c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2117,7 +2117,7 @@ sub process {
 		}
 
 # Return is not a function.
-		if (defined($stat) && $stat =~ /^.\s*return(\s*)(\(.*);/s) {
+		if (defined($stat) && $stat =~ /^.\s*return(\s*)(\(.*)\);/s) {
 			my $spacing = $1;
 			my $value = $2;
 
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-11-12 12:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-03  1:49 [PATCH][RFC] Removing wrong judgement of checkpatch.pl for return as function Hitoshi Mitake
2009-11-06 22:28 ` Andy Whitcroft
2009-11-07  1:14   ` Hitoshi Mitake
2009-11-12 12:49     ` Andy Whitcroft
2009-11-12 12:58       ` Hitoshi Mitake

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.