linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@canonical.com>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: checkpatch.pl: WxV false positive
Date: Mon, 30 Jan 2012 11:18:17 +0000	[thread overview]
Message-ID: <20120130111817.GA18810@localhost> (raw)
In-Reply-To: <20120122214834.6414592c@lenov0n>

On Sun, Jan 22, 2012 at 09:48:34PM -0500, Vivien Didelot wrote:

> In the code below, checkpatch thinks that the asterisk is a
> multiplication, so it is complaining about coding style.
> 
>     ERROR: need consistent spacing around '*' (ctx:WxV)
>     #304: FILE: x86/platform/ts5500/ts5500_adc.c:304:
>     +	.attrs = (struct attribute *[]) {

C types are the pits.  How does the version below handle for you:

    http://people.canonical.com/~apw/checkpatch/checkpatch-next.pl

Relative patch below.

-apw

commit f8a73045dcaac70f9be770cca06f21c762a13878
Author: Andy Whitcroft <apw@canonical.com>
Date:   Sun Jan 29 21:46:04 2012 +0000

    checkpatch: add [] to type extensions
    
    Add [] to a type extensions.  Fixes false positives on:
    
        .attrs = (struct attribute *[]) {
    
    Signed-off-by: Andy Whitcroft <apw@canonical.com>

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d1dd544..64de1bd 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -323,7 +323,7 @@ sub build_types {
 		  }x;
 	$Type	= qr{
 			$NonptrType
-			(?:[\s\*]+\s*const|[\s\*]+|(?:\s*\[\s*\])+)?
+			(?:(?:\s|\*|\[\])+\s*const|(?:\s|\*|\[\])+|(?:\s*\[\s*\])+)?
 			(?:\s+$Inline|\s+$Modifier)*
 		  }x;
 	$Declare	= qr{(?:$Storage\s+)?$Type};

  reply	other threads:[~2012-01-30 11:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-23  2:48 checkpatch.pl: WxV false positive Vivien Didelot
2012-01-30 11:18 ` Andy Whitcroft [this message]
2012-01-30 16:39   ` Vivien Didelot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120130111817.GA18810@localhost \
    --to=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).