Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752438AbdFNNZ4 (ORCPT ); Wed, 14 Jun 2017 09:25:56 -0400 Received: from smtprelay0188.hostedemail.com ([216.40.44.188]:50338 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751726AbdFNNZz (ORCPT ); Wed, 14 Jun 2017 09:25:55 -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:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1535:1543:1593:1594:1605:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2828:2895:3138:3139:3140:3141:3142:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4031:4321:5007:6119:7807:7903:7904:8957:9010:10004:10400:10848:11232:11658:11914:12050:12294:12663:12740:12895:13161:13180:13181:13229:13255:13439:13894:14096:14097:14181:14659:14721:21080:21324:21433:21451:21627:30006:30012:30054:30064:30070:30083:30085:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:6,LUA_SUMMARY:none X-HE-Tag: news03_6d6ce3b945e09 X-Filterd-Recvd-Size: 5197 Message-ID: <1497446750.18751.50.camel@perches.com> Subject: Re: [PATCH 1/7] staging: rtl8723bs: wifi_regd.c: put spaces around binary operators From: Joe Perches To: Dan Carpenter , Ian W MORRISON Cc: Fabian Wolff , =?ISO-8859-1?Q?M=E1t=E9_Horv=E1th?= , devel@driverdev.osuosl.org, linux-kernel@i4.cs.fau.de, Greg KH , linux-kernel@vger.kernel.org, Hans de Goede Date: Wed, 14 Jun 2017 06:25:50 -0700 In-Reply-To: <20170614121908.dcemi5scxlmgbpo4@mwanda> References: <1497264376-18840-1-git-send-email-fabian.wolff@fau.de> <1497264376-18840-2-git-send-email-fabian.wolff@fau.de> <20170613143607.h4fzq3otjg45zhr3@mwanda> <20170614121908.dcemi5scxlmgbpo4@mwanda> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3780 Lines: 95 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 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.