From: Joe Perches <joe@perches.com>
To: Nicholas Mc Guire <der.herr@hofr.at>
Cc: Andy Whitcroft <apw@canonical.com>,
Nicholas Mc Guire <hofrat@osadl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] checkpatch: flag split arithmetic operations with CHECK
Date: Tue, 05 May 2015 08:44:50 -0700 [thread overview]
Message-ID: <1430840690.7191.18.camel@perches.com> (raw)
In-Reply-To: <20150505140857.GA20288@opentech.at>
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.
next prev parent reply other threads:[~2015-05-05 16:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-05 8:53 [PATCH RFC] checkpatch: flag split arithmetic operations with CHECK Nicholas Mc Guire
2015-05-05 9:41 ` Andy Whitcroft
2015-05-05 14:08 ` Nicholas Mc Guire
2015-05-05 15:44 ` Joe Perches [this message]
2015-05-05 18:40 ` Nicholas Mc Guire
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=1430840690.7191.18.camel@perches.com \
--to=joe@perches.com \
--cc=apw@canonical.com \
--cc=der.herr@hofr.at \
--cc=hofrat@osadl.org \
--cc=linux-kernel@vger.kernel.org \
/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