From: Joe Perches <joe@perches.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Ian W MORRISON <ianwmorrison@gmail.com>
Cc: "Fabian Wolff" <fabian.wolff@fau.de>,
"Máté Horváth" <horvatmate@gmail.com>,
devel@driverdev.osuosl.org, linux-kernel@i4.cs.fau.de,
"Greg KH" <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org,
"Hans de Goede" <hdegoede@redhat.com>
Subject: Re: [PATCH 1/7] staging: rtl8723bs: wifi_regd.c: put spaces around binary operators
Date: Wed, 14 Jun 2017 06:25:50 -0700 [thread overview]
Message-ID: <1497446750.18751.50.camel@perches.com> (raw)
In-Reply-To: <20170614121908.dcemi5scxlmgbpo4@mwanda>
On Wed, 2017-06-14 at 15:19 +0300, Dan Carpenter wrote:
> On Wed, Jun 14, 2017 at 09:49:10PM +1000, Ian W MORRISON wrote:
> > On 14 June 2017 at 00:36, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > > Kernel style is to have spaces around the operators. This is staging
> > > code so we do all the style fixes. We don't always update older drivers
> > > but sometimes we do. No one is planning to change those drivers though
> > > so I guess the answer is no we're not going to update those unless you
> > > are?
> > >
> >
> > Thanks for the explanation. I assume submitting changes for the
> > drivers I identified would only be seen as minor corrections to 'the
> > chaff' resulting in unnecessary churn. If however it is expected that
> > corrections should be made when identified then I'm willing to prepare
> > a patch set. I'm happy to take advice either way.
>
> I would just leave the old drivers as-is.
There would be some value in converting them, if only to
note what functions are identical across multiple drivers
and could be consolidated.
> Having spaces around operators has always been kernel style, but it's
> only fairly recently that checkpatch.pl started to complain.
Not really. Linux is a relatively old project.
The CodingStyle for spaces around operators was added about
ten years ago. Bit shifts were and still are not mentioned.
Messages for spaces around arithmetic were not emitted because
so much old code had various styles and it would have been a
lot of churn to update with many complaints from various
maintainers. checkpatch today would emit about a quarter
million error messages for spacing on the kernel source tree.
That's a lot of whitespace churn.
There is a lot of code in drivers and a few other areas that
hasn't been touched in those ten years that doesn't follow
today's commonly accepted coding styles.
CodingStyle still doesn't mention a lot of style nits and bits.
About spacing around bit shifts:
This is just a --strict preference that several people had
expressed a desire to warn about spaces around arithmetic
and bit operators.
It was added a couple years ago to checkpatch but not to
CodingStyle.
The --strict test applies by default to net/and drivers/net
because DaveM is pretty style conscious and asks for rework
when patches don't have the style he prefers.
And the --strict test applies to drivers/staging as well
because it gives more opportunities for first-time patch
submitters to send cleanup style patches (and GregKH can
be a stickler too).
> We keep making checkpatch.pl more stict as time goes on.
I try to add things to checkpatch only when there seems to
be a general consensus about a style or when a significant
percentage of code throughout the kernel already follows a
specific style.
Actively developed Kernel code now has a fairly uniform
style and additions to checkpatch seem less necessary.
One area where checkpatch could use some enhancing is in
tracking indentation better.
checkpatch doesn't emit warnings with indentation like:
statement(1);
statement(2);
where the statements should be aligned on the same tabstop.
I'm playing with it but patches welcome...
> I think that's good
> because some reviewers will make you redo patches for style issues so
> having checkpatch.pl complain early on means you don't have redo the
> patch. But it also means that old code will never be checkpatch.pl
> clean because we keep adding new checkpatch warnings.
>
> And it's fine that old code has checkpatch warnings. The point of
> checkpatch is to check new patches not to churn through old code. As a
> reviewer, I find that checkpatch saves my time because I can often tell
> people to run it instead of listing all the style complaints.
All very true.
next prev parent reply other threads:[~2017-06-14 13:25 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-12 10:46 [PATCH 0/7] staging: rtl8723bs: wifi_regd.c: fix checkpatch errors and warnings Fabian Wolff
2017-06-12 10:46 ` [PATCH 1/7] staging: rtl8723bs: wifi_regd.c: put spaces around binary operators Fabian Wolff
2017-06-13 12:58 ` Greg KH
2017-06-13 13:11 ` Greg KH
2017-06-13 21:01 ` [PATCH v2 0/5] staging: rtl8723bs: wifi_regd.c: fix checkpatch errors and warnings Fabian Wolff
2017-06-13 21:01 ` [PATCH v2 1/5] staging: rtl8723bs: wifi_regd.c: put spaces around binary operators Fabian Wolff
2017-06-13 21:01 ` [PATCH v2 2/5] staging: rtl8723bs: wifi_regd.c: fix comment formatting Fabian Wolff
2017-06-13 21:01 ` [PATCH v2 3/5] staging: rtl8723bs: wifi_regd.c: remove superfluous spaces from pointer arguments Fabian Wolff
2017-06-13 21:01 ` [PATCH v2 4/5] staging: rtl8723bs: wifi_regd.c: adjust alignment to match open parenthesis Fabian Wolff
2017-06-13 21:01 ` [PATCH v2 5/5] staging: rtl8723bs: wifi_regd.c: insert blank line after declarations Fabian Wolff
2017-06-13 13:36 ` [PATCH 1/7] staging: rtl8723bs: wifi_regd.c: put spaces around binary operators Ian W MORRISON
2017-06-13 14:36 ` Dan Carpenter
2017-06-14 11:49 ` Ian W MORRISON
2017-06-14 12:19 ` Dan Carpenter
2017-06-14 13:25 ` Joe Perches [this message]
2017-06-12 10:46 ` [PATCH 2/7] staging: rtl8723bs: wifi_regd.c: fix checkpatch.pl warning 'Statements should start on a tabstop' Fabian Wolff
2017-06-12 10:46 ` [PATCH 3/7] staging: rtl8723bs: wifi_regd.c: fix comment formatting Fabian Wolff
2017-06-12 10:46 ` [PATCH 4/7] staging: rtl8723bs: wifi_regd.c: remove superfluous braces Fabian Wolff
2017-06-12 10:46 ` [PATCH 5/7] staging: rtl8723bs: wifi_regd.c: remove superfluous spaces from pointer arguments Fabian Wolff
2017-06-12 10:46 ` [PATCH 6/7] staging: rtl8723bs: wifi_regd.c: adjust alignment to match open parenthesis Fabian Wolff
2017-06-12 10:46 ` [PATCH 7/7] staging: rtl8723bs: wifi_regd.c: insert blank line after declarations Fabian Wolff
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=1497446750.18751.50.camel@perches.com \
--to=joe@perches.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=fabian.wolff@fau.de \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=horvatmate@gmail.com \
--cc=ianwmorrison@gmail.com \
--cc=linux-kernel@i4.cs.fau.de \
--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