lkml.org 
[lkml]   [2017]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 2/3] mtd: dataflash: Improve coding style in jedec_probe()
From
Date
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

\
 
 \ /
  Last update: 2017-04-19 00:38    [W:0.063 / U:7.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site