Patchwork [09/12] mtd: onenand: remove redundant offset check

login
register
mail settings
Submitter Brian Norris
Date Sept. 4, 2013, 6:25 p.m.
Message ID <1378319126-24473-10-git-send-email-computersforpeace@gmail.com>
Download mbox | patch
Permalink /patch/272703/
State New
Headers show

Comments

Brian Norris - Sept. 4, 2013, 6:25 p.m.
The mtd_block_isbad() interface already checks for this.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/onenand/onenand_base.c | 4 ----
 1 file changed, 4 deletions(-)

Patch

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index b3f41f2..7b7c1d2 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -2556,10 +2556,6 @@  static int onenand_block_isbad(struct mtd_info *mtd, loff_t ofs)
 {
 	int ret;
 
-	/* Check for invalid offset */
-	if (ofs > mtd->size)
-		return -EINVAL;
-
 	onenand_get_device(mtd, FL_READING);
 	ret = onenand_block_isbad_nolock(mtd, ofs, 0);
 	onenand_release_device(mtd);