Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1625678

Re: [PATCH v2 2/3] mtd: dataflash: Improve coding style in jedec_probe()

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/3] mtd: dataflash: Improve coding style in jedec_probe()
Date 2017-04-19 00:40 +0200
Message-ID <txJWV-3hZ-3@gated-at.bofh.it> (permalink)
References <txCiK-7dQ-15@gated-at.bofh.it> <txCiL-7dQ-29@gated-at.bofh.it> <txGFI-1tx-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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++) {

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 1/3] mtd: dataflash: Replace C99 type with their kernel counterparts Andrey Smirnov <andrew.smirnov@gmail.com> - 2017-04-18 16:30 +0200
  [PATCH v2 2/3] mtd: dataflash: Improve coding style in jedec_probe() Andrey Smirnov <andrew.smirnov@gmail.com> - 2017-04-18 16:30 +0200
    Re: [PATCH v2 2/3] mtd: dataflash: Improve coding style in  jedec_probe() Marek Vasut <marek.vasut@gmail.com> - 2017-04-18 21:10 +0200
      Re: [PATCH v2 2/3] mtd: dataflash: Improve coding style in  jedec_probe() Marek Vasut <marek.vasut@gmail.com> - 2017-04-19 00:40 +0200
      Re: [PATCH v2 2/3] mtd: dataflash: Improve coding style in  jedec_probe() Joe Perches <joe@perches.com> - 2017-04-19 00:40 +0200
  [PATCH v2 3/3] mtd: dataflash: Make use of "extened device information" Andrey Smirnov <andrew.smirnov@gmail.com> - 2017-04-18 16:30 +0200
    Re: [PATCH v2 3/3] mtd: dataflash: Make use of "extened device  information" Marek Vasut <marek.vasut@gmail.com> - 2017-04-18 21:10 +0200
      Re: [PATCH v2 3/3] mtd: dataflash: Make use of "extened device information" Andrey Smirnov <andrew.smirnov@gmail.com> - 2017-04-19 05:00 +0200
        Re: [PATCH v2 3/3] mtd: dataflash: Make use of "extened device  information" Marek Vasut <marek.vasut@gmail.com> - 2017-04-19 10:50 +0200
          Re: [PATCH v2 3/3] mtd: dataflash: Make use of "extened device information" Andrey Smirnov <andrew.smirnov@gmail.com> - 2017-04-19 17:10 +0200
            Re: [PATCH v2 3/3] mtd: dataflash: Make use of "extened device  information" Marek Vasut <marek.vasut@gmail.com> - 2017-04-19 17:40 +0200
  Re: [PATCH v2 1/3] mtd: dataflash: Replace C99 type with their kernel  counterparts Marek Vasut <marek.vasut@gmail.com> - 2017-04-18 21:10 +0200

csiph-web