lkml.org 
[lkml]   [2012]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] checkpatch.pl: thou shalt not use () or (...) in function declarations
Date
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


\
 
 \ /
  Last update: 2012-03-22 16:33    [W:1.235 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site