[U-Boot] [PATCH 2/6] Separate flash read and write operations

Guennadi Liakhovetski lg at denx.de
Sun Aug 31 18:04:53 CEST 2008


On Sun, 31 Aug 2008, Wolfgang Denk wrote:

> Dear Guennadi Liakhovetski,
> 
> In message <Pine.LNX.4.64.0808271746001.6718 at axis700.grange> you wrote:
> 
> Your
> 
> > Subject: Re: [U-Boot] [PATCH 2/6] Separate flash read and write operations
> 
> does not make a good  commit  comment  -  you  should  at  least  add
> "fw_env:"  or  similar  so  eveybody know which "flash read and write
> operations" you are talking about.

ok

> > The flash_io function was used for both read and write operations, whereby
> > very little code was shared between the two modes. By breaking this function
> > we simplify the code and save one level of identation.
> 
> If I see this correctly, you did not implement any functional changes
> or bug fixes, i. e. it was just  a  code  restructuring  because  you
> didn't like the current style and preferred another one?

This also applies to my previous reply. I probably failed to explain this 
clearly in the introductory 0/6 email. The patches 1-5 are preparatory for 
the main "add NAND support" patch. Thus also separating read and write 
makes the NAND conversion much easier. The previous flash_io function was 
pretty long, implemented read and write and they share _very_ little code 
- only open and close IIRC. With NAND extra code would be added to both 
read and write parts and would make the whole function much longer and 
much less readable yet. Apart from that it would add many more indentation 
levels, believe me, this would be ugly.

So, no, this is not because I didn't like somebody else's coding style. 
This is because with NAND addition this function would become an 
absolutely unreadable monster. So, I would consider this patch a 
readability improvement.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.

DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de


More information about the U-Boot mailing list