@@ -362,12 +362,9 @@ static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
/*
* INFTL_format: format a Erase Unit by erasing ALL Erase Zones in the Erase
- * Unit and Update INFTL metadata. Each erase operation is
- * checked with check_free_sectors.
- *
+ * Unit and Update INFTL metadata. *
* Return: 0 when succeed, -1 on error.
*
- * ToDo: 1. Is it necessary to check_free_sector after erasing ??
*/
int INFTL_formatblock(struct INFTLrecord *inftl, int block)
{
@@ -401,13 +398,6 @@ int INFTL_formatblock(struct INFTLrecord *inftl, int block)
goto fail;
}
- /*
- * Check the "freeness" of Erase Unit before updating metadata.
- * FixMe: is this check really necessary? Since we have check
- * the return code after the erase operation.
- */
- if (check_free_sectors(inftl, instr->addr, instr->len, 1) != 0)
- goto fail;
}
uci.EraseMark = cpu_to_le16(ERASE_MARK);
Removes unneeded call to check_free_sectors internally in the function,INFTL_formatblock. This call is no longer needed due to us checking to see if erasing the block against the structure pointer passed to the function,inftl internal variable state is equal to the macro,MTD_ERASE_FAILED to see if the block has failed in being erased successfully.Due to this we can remove the no longer needed check to check_free_sectors and comments related to questioning the reason for it's use with the check against MTD_ERASE_FAILED for inftl's state variable already checking for successfully erasing of the mtd block. Signed-off-by: Nicholas Krause <xerofoify@gmail.com> --- drivers/mtd/inftlmount.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)