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

2008-08-31 Thread Wolfgang Denk
Dear Guennadi Liakhovetski, In message <[EMAIL PROTECTED]> you wrote: > > Yes, the original code was: ... > int flash_io(int mode) > { > fd = open(path, mode); > > if (mode == O_RDONLY) { That's not true. You intentionally omit the error handling part here. > close(fd); > }

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

2008-08-31 Thread Guennadi Liakhovetski
On Sun, 31 Aug 2008, Wolfgang Denk wrote: > Dear Guennadi Liakhovetski, > > In message <[EMAIL PROTECTED]> you wrote: > > > > 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 m

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

2008-08-31 Thread Wolfgang Denk
Dear Guennadi Liakhovetski, In message <[EMAIL PROTECTED]> you wrote: > > 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

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

2008-08-31 Thread Guennadi Liakhovetski
On Sun, 31 Aug 2008, Wolfgang Denk wrote: > Dear Guennadi Liakhovetski, > > In message <[EMAIL PROTECTED]> you wrote: > > Your > > > Subject: Re: [U-Boot] [PATCH 2/6] Separate flash read and write operations > > does not make a good commit comment - y

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

2008-08-31 Thread Wolfgang Denk
Dear Guennadi Liakhovetski, In message <[EMAIL PROTECTED]> 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 &q

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

2008-08-27 Thread Guennadi Liakhovetski
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. Signed-off-by: Guennadi Liakhovetski <[EMAIL PROTECTED]> --- tools/env/fw_env.c | 280 +++