All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] checkpatch.pl: thou shalt not use () or (...) in function declarations
@ 2012-03-22 15:27 Phil Carmody
  2012-03-22 15:49 ` richard -rw- weinberger
  2012-03-22 16:22 ` Jiri Slaby
  0 siblings, 2 replies; 20+ messages in thread
From: Phil Carmody @ 2012-03-22 15:27 UTC (permalink / raw)
  To: apw; +Cc: hpa, ext-phil.2.carmody, linux-kernel

After HPA's wonderful lkml post, referenced, it seems worth trying to
detect this robomatically.

Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
---
 scripts/checkpatch.pl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a3b9782..3993011 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1881,6 +1881,10 @@ sub process {
 				substr($ctx, 0, $name_len + 1, '');
 				$ctx =~ s/\)[^\)]*$//;
 
+				if ($ctx =~ /^\s*(?:\.\.\.)?\s*$/) {
+					# HPA explains why: http://lwn.net/Articles/487493/
+					ERROR("(...) and () are not sufficiently informative function declarations\n$hereline");
+				}
 				for my $arg (split(/\s*,\s*/, $ctx)) {
 					if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/s || $arg =~ /^($Ident)$/s) {
 
-- 
1.7.2.5


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

end of thread, other threads:[~2012-04-16  6:13 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-22 15:27 [PATCH 1/1] checkpatch.pl: thou shalt not use () or (...) in function declarations Phil Carmody
2012-03-22 15:49 ` richard -rw- weinberger
2012-03-22 16:33   ` Joe Perches
2012-03-22 16:22 ` Jiri Slaby
2012-03-22 16:49   ` Valdis.Kletnieks
2012-03-22 16:55     ` Jiri Slaby
2012-03-22 17:00       ` Jiri Slaby
2012-03-22 17:17       ` Valdis.Kletnieks
2012-03-22 19:00         ` Joe Perches
2012-03-22 16:53   ` H. Peter Anvin
2012-03-22 16:56     ` Jiri Slaby
2012-03-22 17:48     ` Phil Carmody
2012-03-22 19:10       ` Peter Seebach
2012-03-22 20:01         ` Phil Carmody
2012-03-22 17:17   ` Nick Bowler
2012-03-22 17:19     ` Nick Bowler
2012-03-26 10:03     ` Pedro Alves
2012-04-16  6:11       ` H. Peter Anvin
2012-03-22 17:32   ` Phil Carmody
2012-04-15 18:18   ` Phil Carmody

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.