From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933120AbeAHT1S (ORCPT + 1 other); Mon, 8 Jan 2018 14:27:18 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:57540 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932155AbeAHT1R (ORCPT ); Mon, 8 Jan 2018 14:27:17 -0500 Date: Mon, 8 Jan 2018 22:26:46 +0300 From: Dan Carpenter To: Joe Perches Cc: Luis Gerhorst , devel@driverdev.osuosl.org, linux-kernel@i4.cs.fau.de, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Jonny =?iso-8859-1?Q?Sch=E4fer?= Subject: Re: [PATCH 2/3] drivers/fbtft: Remove unnecessary braces from if/else Message-ID: <20180108192646.jqr4hdif2i5cpxr6@mwanda> References: <1515405997-12563-1-git-send-email-linux-kernel@luisgerhorst.de> <20180108150339.3jstz64fbawef45i@mwanda> <1515436021.9619.36.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515436021.9619.36.camel@perches.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8768 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801080276 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, Jan 08, 2018 at 10:27:01AM -0800, Joe Perches wrote: > On Mon, 2018-01-08 at 18:03 +0300, Dan Carpenter wrote: > > On Mon, Jan 08, 2018 at 11:06:37AM +0100, Luis Gerhorst wrote: > > > The Linux kernel coding style states that braces should only be used > > > when necessary. > > > > > > This fixes the checkpatch warning > > > > > > WARNING: line over 80 characters > > > + } else if (display->regwidth == 8 && display->buswidth == 9 && par->spi) { > > > > > > introduced by patch #1. > > > > > > > Don't introduce warnings and then fix them in later patches. > > > > Anyway there is another unwritten rule that multi-line indents get curly > > braces. Probably it should be: > > Nope. That'd be your own preferred style. > I copied it from Greg so it's the subsystem style. > If you want it to be followed by others, > please try and get it added to CodingStyle > and use examples to show why it's better > than allowing maintainer preference. > I'm not going to NACK patches which don't follow that rule, so it's not something which is helpful to put in checkpatch.pl. The reason I'm complaining about this patch is that it fixes a patch the author introduces earlier in the patchset. > > } else if (display->regwidth == 8 && display->buswidth == 9 && > > par->spi) { > > My own preferred style here would be to align > the display->regwidth and display->buswidth so > I can differentiate the similarity in naming a > bit more easily. Yeah. I thought about that as well but then it takes up 3 lines... Either way is fine. > > } else if (display->regwidth == 8 && > display->buswidth == 9 && par->spi) { > > I'm not sure at all there is a single best > style for this and it can easily become > situation dependent. > > And so I suggest not adding anything about this > style nit to CodingStyle. Agreed. regards, dan carpenter