Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753736AbbEEQLL (ORCPT ); Tue, 5 May 2015 12:11:11 -0400 Received: from smtprelay0026.hostedemail.com ([216.40.44.26]:47534 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2993455AbbEEPoy (ORCPT ); Tue, 5 May 2015 11:44:54 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2828:2892:2909:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:5007:6119:6261:7875:7903:7904:7974:8957:10004:10400:10848:11232:11658:11914:12517:12519:12740:13069: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: stamp49_64a68655af636 X-Filterd-Recvd-Size: 2378 Message-ID: <1430840690.7191.18.camel@perches.com> Subject: Re: [PATCH RFC] checkpatch: flag split arithmetic operations with CHECK From: Joe Perches To: Nicholas Mc Guire Cc: Andy Whitcroft , Nicholas Mc Guire , linux-kernel@vger.kernel.org Date: Tue, 05 May 2015 08:44:50 -0700 In-Reply-To: <20150505140857.GA20288@opentech.at> References: <1430816016-24427-1-git-send-email-hofrat@osadl.org> <20150505094109.GA3654@bark> <20150505140857.GA20288@opentech.at> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 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 Content-Length: 1678 Lines: 35 On Tue, 2015-05-05 at 16:08 +0200, Nicholas Mc Guire wrote: > On Tue, 05 May 2015, Andy Whitcroft wrote: > > On Tue, May 05, 2015 at 10:53:36AM +0200, Nicholas Mc Guire wrote: > > > Simple arithmetic operations should be on one line, if they can be fit, > > > rather than splitting at the operator. As this is not in the CodingStyle it > > > is limited to --strict use of checkpatch.pl and emits a CHECK only. [] > > I assume that these relate to being able to confirm the variant of the > > operator, unary/binary etc. If you look for "annotate_values", after > > that is run there is additional information for each character of the > > current line, tracking the type of the operator. This is used when > > determining spacing for + etc later as unary ones are typically tight > > bound and binary ones spaced out. You might find that useful, if that > > is your issue. And indeed you might find it useful for determining if > > the +/- you find at line end is indeed unary. Running with --debug > > values=1 should dump out the variants information for those. > > > thanks - looks like a useful (somewhat cryptic) starting point > > 15 > . x = y - x > 15 > EEEVVNNVVNNTTT > 15 > ________B____ > > will give it a try to generalize it for all basic binary operators. Look at the code for "# Check operator spacing" around line 3600. It's a pretty big block of ~300 lines of code, but this new test should go in there. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/