From: Rafał Miłecki <[email protected]>

Use "erasesize" instead of "blocklen" in flash_write_buf()'s loop. This
change touches code executed for bad NAND blocks so it doesn't affect
any behaviour (for NAND flashes "blocklen" and "erasesize" are equal).

This just makes code a bit more consistent as "erasesize" is what is
used all around inside the writing loop.

Signed-off-by: Rafał Miłecki <[email protected]>
---
 tools/env/fw_env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 425faf380fb..c69da0b926a 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -1096,7 +1096,7 @@ static int flash_write_buf(int dev, int fd, void *buf, 
size_t count)
                }
 
                if (rc) {       /* block is bad */
-                       blockstart += blocklen;
+                       blockstart += erasesize;
                        continue;
                }
 
-- 
2.51.0

Reply via email to