From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752018AbcAFRwx (ORCPT ); Wed, 6 Jan 2016 12:52:53 -0500 Received: from smtprelay0180.hostedemail.com ([216.40.44.180]:38134 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751595AbcAFRwu (ORCPT ); Wed, 6 Jan 2016 12:52:50 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:800:960:968:973: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:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3871:4321:5007:6261:7514:7903:8603:10004:10400:10848:11026:11232:11658:11914:12043:12438:12517:12519:12555:12740:13069:13311:13357:13894:14659:21080:30012:30054:30080:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:5,LUA_SUMMARY:none X-HE-Tag: chair33_6fa7cb1abbb35 X-Filterd-Recvd-Size: 2250 Message-ID: <1452102761.24575.44.camel@perches.com> Subject: Re: [PATCH] staging: wilc1000: Removed unnecessary braces From: Joe Perches To: Anjali Menon , gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Wed, 06 Jan 2016 09:52:41 -0800 In-Reply-To: <1452086991-6997-1-git-send-email-cse.anjalimenon@gmail.com> References: <1452086991-6997-1-git-send-email-cse.anjalimenon@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.3-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 On Wed, 2016-01-06 at 18:59 +0530, Anjali Menon wrote: > Removed unnecessary braces for single statement blocks to > fix the warning detected by checkpatch.pl > > WARNING: braces {} are not necessary for single statement blocks > > Signed-off-by: Anjali Menon > --- >  drivers/staging/wilc1000/wilc_wlan_cfg.c | 3 +-- >  1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c b/drivers/staging/wilc1000/wilc_wlan_cfg.c > index a34a81c..afb5d2c 100644 > --- a/drivers/staging/wilc1000/wilc_wlan_cfg.c > +++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c > @@ -251,9 +251,8 @@ static int wilc_wlan_cfg_set_bin(u8 *frame, u32 offset, u16 id, u8 *b, u32 size) >   >   if ((b != NULL) && (size != 0)) { >   memcpy(&buf[4], b, size); > - for (i = 0; i < size; i++) { > + for (i = 0; i < size; i++) >   checksum += buf[i + 4]; > - } >   } >   >   buf[size + 4] = checksum; Please think of what the code is doing instead of just shutting up checkpatch. Maybe instead of walking the buffer twice, once for the memcpy, another for the checksum, perhaps using a routine to do both at the same time would be better. Maybe something like: if (b && size) { u32 count = size; u8 *to = &buf[4]; while (count--) checksum += (*to++ = *b++); }