From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753893AbdDRWga (ORCPT ); Tue, 18 Apr 2017 18:36:30 -0400 Received: from smtprelay0142.hostedemail.com ([216.40.44.142]:60818 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751131AbdDRWg1 (ORCPT ); Tue, 18 Apr 2017 18:36:27 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:371:372:379:541:599:960: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:2897:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3874:4321:4605:4823:5007:6119:7875:9040:10004:10400:10848:11026:11232:11473:11658:11914:12043:12296:12740:12760:12895:13069:13095:13311:13357:13439:14659:14721:21080:21433:30029:30034:30054:30070:30075:30080: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: flesh64_8e68fe9de0e00 X-Filterd-Recvd-Size: 2545 Message-ID: <1492554972.8661.51.camel@perches.com> Subject: Re: [PATCH v2 2/3] mtd: dataflash: Improve coding style in jedec_probe() From: Joe Perches To: Marek Vasut , Andrey Smirnov , linux-mtd@lists.infradead.org Cc: cphealy@gmail.com, David Woodhouse , Brian Norris , Boris Brezillon , Richard Weinberger , Cyrille Pitchen , linux-kernel@vger.kernel.org In-Reply-To: <32615ada-eddc-3911-17bf-32f6897c77e1@gmail.com> References: <20170418142127.23301-1-andrew.smirnov@gmail.com> <20170418142127.23301-2-andrew.smirnov@gmail.com> <32615ada-eddc-3911-17bf-32f6897c77e1@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" Date: Tue, 18 Apr 2017 15:36:12 -0700 Mime-Version: 1.0 X-Mailer: Evolution 3.22.6-1ubuntu1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-04-18 at 20:25 +0200, Marek Vasut wrote: > On 04/18/2017 04:21 PM, Andrey Smirnov wrote: > > As per request from Marek Vasut, change the following: > > Does that really have to be in the commit message ? ^_^' > > > - Replace indentation between type and name of local variable from > > tabs to spaces > > > > - Replace magic number 0x1F with CFI_MFR_ATMEL macro > > > > - Replace variable 'tmp' with 'ret' and 'i' where appropriate > > > > - Reformat multi-line comments and add newlines where appropriate > > > > No functional change intended. > > Appreciated, thanks! trivia: > > diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c [] > > @@ -768,9 +771,9 @@ static struct flash_info *jedec_probe(struct spi_device *spi) > > jedec = jedec << 8; > > jedec |= id[2]; > > > > - for (tmp = 0, info = dataflash_data; > > - tmp < ARRAY_SIZE(dataflash_data); > > - tmp++, info++) { > > + for (i = 0, info = dataflash_data; > > + i < ARRAY_SIZE(dataflash_data); > > + i++, info++) { > > if (info->jedec_id == jedec) { > > pr_debug("%s: OTP, sector protect%s\n", > > dev_name(&spi->dev), This loop could be written without the i variable. for (info = dataflash_data; info < dataflash_data + ARRAY_SIZE(dataflash_data); info++) {