Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755053AbdDRWie (ORCPT ); Tue, 18 Apr 2017 18:38:34 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:33056 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751075AbdDRWib (ORCPT ); Tue, 18 Apr 2017 18:38:31 -0400 Subject: Re: [PATCH v2 2/3] mtd: dataflash: Improve coding style in jedec_probe() To: Joe Perches , Andrey Smirnov , linux-mtd@lists.infradead.org References: <20170418142127.23301-1-andrew.smirnov@gmail.com> <20170418142127.23301-2-andrew.smirnov@gmail.com> <32615ada-eddc-3911-17bf-32f6897c77e1@gmail.com> <1492554972.8661.51.camel@perches.com> Cc: cphealy@gmail.com, David Woodhouse , Brian Norris , Boris Brezillon , Richard Weinberger , Cyrille Pitchen , linux-kernel@vger.kernel.org From: Marek Vasut Message-ID: Date: Wed, 19 Apr 2017 00:38:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <1492554972.8661.51.camel@perches.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1538 Lines: 51 On 04/19/2017 12:36 AM, Joe Perches wrote: > 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++) { > But in a separate patch please, so it's bisectable. I don't want to slap such change into this patch. -- Best regards, Marek Vasut