[PATCH 1/3] mtd:Remove unneeded to comments and call to check_free_sectors in the function, INFTL_formatblock

Nicholas Krause xerofoify at gmail.com
Tue Mar 3 21:01:23 PST 2015


Removes two no longer needed fix mes related to a unnessary call to check_free_sectors
in the function,INFTL_formatblock and the unneeded call to check_free_sectors. This call
to check_free_sectors is no longer needed as we check if the sectors are free by checking
the state of the erase info structure pointer, insr's state to be not equal to MTD_ERASE_FAILED
as this is the same as calling check_free_sectors to check for the sectors being no longer
allocated or in use.

Signed-off-by: Nicholas Krause <xerofoify at gmail.com>
---
 drivers/mtd/inftlmount.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
index 1388c8d..8f16de1 100644
--- a/drivers/mtd/inftlmount.c
+++ b/drivers/mtd/inftlmount.c
@@ -367,7 +367,6 @@ static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
  *
  * 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)
 {
@@ -400,14 +399,6 @@ int INFTL_formatblock(struct INFTLrecord *inftl, int block)
 				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);
-- 
2.1.0




More information about the linux-mtd mailing list