linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Sam Bobroff <sam.bobroff@au1.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, apw@canonical.com
Subject: Re: [PATCH 1/1] checkpatch: improve operator spacing check
Date: Mon, 06 Apr 2015 20:52:49 -0700	[thread overview]
Message-ID: <1428378769.20888.12.camel@perches.com> (raw)
In-Reply-To: <203326aa74b4de17ebbc27acfde0790f5ec48504.1428377753.git.sam.bobroff@au1.ibm.com>

On Tue, 2015-04-07 at 13:36 +1000, Sam Bobroff wrote:
> Code such as:
>        x = timercmp(&now, &end, <);
> Will currently trigger a checkpatch error. e.g.
> ERROR: spaces required around that '<'
> 
> This is because the "Ignore operators passed as parameters" check
> looks only for a comma following the operator. Improve the check by
> also looking for a close parenthesis.
> 
> Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>

Seems sensible, thanks.

> ---
> 
>  scripts/checkpatch.pl |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index d124359..f65c4de 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3565,7 +3565,7 @@ sub process {
>  
>  				# Ignore operators passed as parameters.
>  				if ($op_type ne 'V' &&
> -				    $ca =~ /\s$/ && $cc =~ /^\s*,/) {
> +				    $ca =~ /\s$/ && $cc =~ /^\s*[,\)]/) {
>  
>  #				# Ignore comments
>  #				} elsif ($op =~ /^$;+$/) {




      reply	other threads:[~2015-04-07  3:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-07  3:36 [PATCH 1/1] checkpatch: improve operator spacing check Sam Bobroff
2015-04-07  3:52 ` Joe Perches [this message]

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=1428378769.20888.12.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam.bobroff@au1.ibm.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).