block2mtd: dubious assignment
Subsystems (2)
PATCH 1/1 block2mtd: dubious assignment
When block2mtd_erase fails, a duplicated assignment instantly changes instr->state from MTD_ERASE_FAILED to MTD_ERASE_DONE.
It looks to me like this might not be intended, or is it?
--- drivers/mtd/devices/block2mtd.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/mtd/devices/block2mtd.c +0 -1
@@ -91,7 +91,6 @@ static int block2mtd_erase(struct mtd_info *mtd, struct erase_info *instr) }else instr->state =MTD_ERASE_DONE ; - instr->state =MTD_ERASE_DONE ;mtd_erase_callback (instr);return err; }
Signature · 1 line
1.7.2.2
Quoted 5 lines · Nicolas Kaiser
When
block2mtd_erasefails, a duplicated assignment instantly changesinstr->statefromMTD_ERASE_FAILEDtoMTD_ERASE_DONE.It looks to me like this might not be intended, or is it?
Definitely not. Just proves how well block device errors are tested.
Quoted 1 line
Signed-off-by Nicolas Kaiser <[email protected]>
Artem, can I leave this patch to you as well?
Jörn
Signature · 2 lines
Eighty percent of success is showing up. -- Woody Allen
Quoted 5 lines · Jörn Engel
Quoted 4 lines · Nicolas Kaiser
When
block2mtd_erasefails, a duplicated assignment instantly changesinstr->statefromMTD_ERASE_FAILEDtoMTD_ERASE_DONE.
Quoted 8 lines
Quoted 1 line
It looks to me like this might not be intended, or is it?
Definitely not. Just proves how well block device errors are tested.
Quoted 1 line
Signed-off-by Nicolas Kaiser <[email protected]>Acked-by Joern Engel <[email protected]>Artem, can I leave this patch to you as well?
Yes, I'll put it to my l2 tree of course, thanks.
Signature · 2 lines
Best Regards, Artem Bityutskiy (Битюцкий Артём)