lkml.org 
[lkml]   [2020]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mtd: spi-nor: Simplify loop in spi_nor_read_id()
On Wed, Feb 19, 2020 at 08:06:08AM +0000, Tudor.Ambarus@microchip.com wrote:
[...]
> > static const struct flash_info *spi_nor_read_id(struct spi_nor *nor)
> > {
> > - int tmp;
> > + int tmp, i;
>
> while cleaning this function, would you rename tmp with ret?

Good idea, I'll do that in v2.

> > u8 *id = nor->bouncebuf;
>
> and please drop this tab between u8 and *id

The same with the other variables in this functions? They have tabs
between the type and the pointer star / name as well.

>
> > const struct flash_info *info;
>
> Also, IMO, the definition of variables should be done with the focus of
> avoiding stack padding. With this in mind, I would first define the pointers
> and then the ints and smaller types. But there are others than prefer defining
> the variables in a tree/reverse-tree way, depending of the length of the line.
> There's no agreement on this, either way if fine, do as you prefer.

I have no preference here. I think I'll keep it as is for now.


Thanks for the review,
Jonathan Neuschäfer
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-02-21 17:29    [W:0.071 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site