qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Who maintains checkpatch.pl now?


From: Peter Chubb
Subject: [Qemu-devel] Who maintains checkpatch.pl now?
Date: Fri, 25 Nov 2011 14:17:22 +1100
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Who maintainss checkpatch.pl now?
checkpatch.pl says to look for CHECKPATCH in the MAINTAINERS file, but
that entry isn't there.  


The issue I'm encountering is that sizeof is not a function, but an
operator, that takes as its operand either a variable or a cast.  As
such there needn't be any parentheses (if the operand is a variable),
and there should a space before the cast.

In the QEMU code at present, the use of whitespace around sizeof varies
from file to file; 
checkpatch.pl complains about

   sizeof (struct foo)
WARNING: space prohibited between function name and open parenthesis '('

If I fix the problem as in the appended patch, I start seeing other
complaints:

ERROR: space prohibited after that '*' (ctx:WxW)
+#define PRIO_PER_WORD (sizeof (uint32_t) * 8 / 4)
                                          ^

Index: qemu-working/scripts/checkpatch.pl
===================================================================
--- qemu-working.orig/scripts/checkpatch.pl     2011-11-10 10:16:43.215022488 
+1100
+++ qemu-working/scripts/checkpatch.pl  2011-11-25 14:02:30.908358997 +1100
@@ -1953,21 +1953,21 @@ sub process {
                }
 
 # check for spaces between functions and their parentheses.
                while ($line =~ /($Ident)\s+\(/g) {
                        my $name = $1;
                        my $ctx_before = substr($line, 0, $-[1]);
                        my $ctx = "$ctx_before$name";
 
                        # Ignore those directives where spaces _are_ permitted.
                        if ($name =~ /^(?:
-                               if|for|while|switch|return|case|
+                               if|for|while|switch|return|case|sizeof|
                                volatile|__volatile__|
                                __attribute__|format|__extension__|
                                asm|__asm__)$/x)
                        {
 
                        # cpp #define statements have non-optional spaces, ie
                        # if there is a space between the name and the open
                        # parenthesis it is simply not a parameter group.
                        } elsif ($ctx_before =~ /^.\s*\#\s*define\s*$/) {
 



--
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
http://www.ertos.nicta.com.au           ERTOS within National ICT Australia



reply via email to

[Prev in Thread] Current Thread [Next in Thread]