Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752602AbdDDDna (ORCPT ); Mon, 3 Apr 2017 23:43:30 -0400 Received: from smtprelay0047.hostedemail.com ([216.40.44.47]:41348 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752202AbdDDDn3 (ORCPT ); Mon, 3 Apr 2017 23:43:29 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:960:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2898:3138:3139:3140:3141:3142:3352:3622:3868:3871:4321:5007:10004:10400:10848:11026:11232:11658:11914:12048:12740:12760:12895:13069:13311:13357:13439:14659:14721:21080:30051:30054:30070: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:1,LUA_SUMMARY:none X-HE-Tag: stage43_3ac181cf67825 X-Filterd-Recvd-Size: 2113 Message-ID: <1491277402.27353.68.camel@perches.com> Subject: Re: [PATCH v2 6/6] hpet: fix style issue about braces and alignment From: Joe Perches To: Corentin Labbe , clemens@ladisch.de, arnd@arndb.de, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org Date: Mon, 03 Apr 2017 20:43:22 -0700 In-Reply-To: <20170403121559.1397-7-clabbe.montjoie@gmail.com> References: <20170403121559.1397-1-clabbe.montjoie@gmail.com> <20170403121559.1397-7-clabbe.montjoie@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.3-0ubuntu0.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 Content-Length: 1210 Lines: 41 On Mon, 2017-04-03 at 14:15 +0200, Corentin Labbe wrote: > This patch fix all style issue for braces and alignment [] > diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c [] > @@ -255,9 +255,9 @@ static int hpet_open(struct inode *inode, struct file *file) > > for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) > for (i = 0; i < hpetp->hp_ntimer; i++) > - if (hpetp->hp_dev[i].hd_flags & HPET_OPEN) > + if (hpetp->hp_dev[i].hd_flags & HPET_OPEN) { > continue; > - else { > + } else { > devp = &hpetp->hp_dev[i]; > break; > } Perhaps this is clearer as: for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) { for (i = 0; i < hpetp->hp_ntimer; i++) { if (!(hpetp->hp_dev[i].hd_flags & HPET_OPEN)) { devp = &hpetp->hp_dev[i]; break; } } } > @@ -304,9 +304,9 @@ hpet_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) > devp->hd_irqdata = 0; > spin_unlock_irq(&hpet_lock); > > - if (data) > + if (data) { > break; > - else if (file->f_flags & O_NONBLOCK) { > + } else if (file->f_flags & O_NONBLOCK) { break; else is almost always better as break and reduced indentation