From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933695AbeAHTsR (ORCPT + 1 other); Mon, 8 Jan 2018 14:48:17 -0500 Received: from smtprelay0192.hostedemail.com ([216.40.44.192]:49725 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932750AbeAHTsQ (ORCPT ); Mon, 8 Jan 2018 14:48:16 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: glove34_822a89a5ff65f X-Filterd-Recvd-Size: 2386 Message-ID: <1515440892.9619.52.camel@perches.com> Subject: Re: [PATCH 2/3] drivers/fbtft: Remove unnecessary braces from if/else From: Joe Perches To: Dan Carpenter 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?= Date: Mon, 08 Jan 2018 11:48:12 -0800 In-Reply-To: <20180108192646.jqr4hdif2i5cpxr6@mwanda> References: <1515405997-12563-1-git-send-email-linux-kernel@luisgerhorst.de> <20180108150339.3jstz64fbawef45i@mwanda> <1515436021.9619.36.camel@perches.com> <20180108192646.jqr4hdif2i5cpxr6@mwanda> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 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 Return-Path: On Mon, 2018-01-08 at 22:26 +0300, Dan Carpenter wrote: > 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. Hey Dan. btw: I completely agree with this > > > 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. I don't fine any examples that match your suggestion above in drivers/staging/fbtft. Perhaps because there aren't many multi line if statements. All of the blocks that use braces are required because one or more of the if/else blocks contain multiple statements. There are counterexamples in the subsystem. cheers, Joe