From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753212AbbDGDwy (ORCPT ); Mon, 6 Apr 2015 23:52:54 -0400 Received: from smtprelay0166.hostedemail.com ([216.40.44.166]:54526 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753047AbbDGDww (ORCPT ); Mon, 6 Apr 2015 23:52:52 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3352:3622:3865:3871:3874:4321:4605:5007:6261:7904:10004:10400:10848:11232:11658:11914:12517:12519:12555:12663:12740:13019:13069:13073:13141:13230:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: suit59_702213f10e001 X-Filterd-Recvd-Size: 1936 Message-ID: <1428378769.20888.12.camel@perches.com> Subject: Re: [PATCH 1/1] checkpatch: improve operator spacing check From: Joe Perches To: Sam Bobroff , Andrew Morton Cc: linux-kernel@vger.kernel.org, apw@canonical.com Date: Mon, 06 Apr 2015 20:52:49 -0700 In-Reply-To: <203326aa74b4de17ebbc27acfde0790f5ec48504.1428377753.git.sam.bobroff@au1.ibm.com> References: <203326aa74b4de17ebbc27acfde0790f5ec48504.1428377753.git.sam.bobroff@au1.ibm.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 =~ /^$;+$/) {