The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andy Whitcroft <apw@canonical.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	linux-kernel@vger.kernel.org, swetland@google.com,
	devel@linuxdriverproject.org,
	Pradheep Shrinivasan <pradheep.sh@gmail.com>
Subject: Re: [PATCH 1/6] staging:android_pmem.h: Fixes the space and other formating issues pointed out by checkpatch.pl
Date: Fri, 20 Jan 2012 05:15:15 -0800	[thread overview]
Message-ID: <1327065315.6176.24.camel@joe2Laptop> (raw)
In-Reply-To: <CAAq6er0OPkvTCLt1DvHSjyqM4pH7GMb-D78M09cJY+1ZV3miiQ@mail.gmail.com>

On Fri, 2012-01-20 at 11:12 +0000, Andy Whitcroft wrote:
> On Wed, Jan 18, 2012 at 6:54 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > On Wed, Jan 18, 2012 at 11:38:34PM +0530, Pradheep Shrinivasan wrote:
> >>> > > -#define PMEM_IOCTL_MAGIC 'p'
> >> > > +#define PMEM_IOCTL_MAGIC ('p')
> >> > You don't need parenthesis here.  Did checkpatch really complain
> >> > about this?
> >> Yes the check patch does complain about the parenthesis.
> > That seems like a bug in checkpatch.pl.  It's hard to imagine less
> > complex macro than:  #define PMEM_IOCTL_MAGIC 'p'
> I can think of no way in which an unprotected character is different
> to an unprotected integer constant.  So ...
> Does the version here work better for you:
>     http://people.canonical.com/~apw/checkpatch/checkpatch-next.pl

diff here is:

@@ -2838,7 +2849,8 @@
                        if ($dstat ne '' &&
                            $dstat !~ /^(?:$Ident|-?$Constant),$/ &&                    # 10, // foo(),
                            $dstat !~ /^(?:$Ident|-?$Constant);$/ &&                    # foo();
-                           $dstat !~ /^(?:$Ident|-?$Constant)$/ &&                     # 10 // foo()
+                           $dstat !~ /^[!~-]?(?:$Ident|$Constant)$/ &&         # 10 // foo() // !foo // ~foo // -foo
+                           $dstat !~ /^'X'$/ &&                                        # character constants
                            $dstat !~ /$exceptions/ &&
                            $dstat !~ /^\.$Ident\s*=/ &&                                # .foo =
                            $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ &&       # do {...} while (...); // do {...} while (...)

I think the character change test is fine but
the !~- addition/change is suspect.

!~- are precedence level 3 operators
and can be impacted by things like ++
and function calls.


  parent reply	other threads:[~2012-01-20 13:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1326856764-2531-1-git-send-email-pradheep.sh@gmail.com>
     [not found] ` <20120118065620.GE3294@mwanda>
     [not found]   ` <CANz8tm1imZ3njy_uV0tkq0sXwyB5ZLLJsrp4G1zjcBDnJUrjiw@mail.gmail.com>
2012-01-18 18:54     ` [PATCH 1/6] staging:android_pmem.h: Fixes the space and other formating issues pointed out by checkpatch.pl Dan Carpenter
2012-01-20 11:12       ` Andy Whitcroft
2012-01-20 11:54         ` Dan Carpenter
2012-01-20 12:18           ` Andy Whitcroft
2012-01-20 13:29           ` Joe Perches
2012-01-20 13:50             ` Dan Carpenter
2012-01-20 16:28             ` Andy Whitcroft
2012-01-20 13:15         ` Joe Perches [this message]
2012-01-20 13:46           ` Dan Carpenter
2012-01-20 17:12             ` Joe Perches

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=1327065315.6176.24.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@linuxdriverproject.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pradheep.sh@gmail.com \
    --cc=swetland@google.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