mtd: Remove duplicate checks on mtd_oob_ops parameter

Some of the check done in custom ->_read/write_oob() implementation are
already done by the core (in mtd_check_oob_ops()).

Suggested-by: Peter Pan <peterpansjtu@gmail.com>
[Remove redundant checks done in mtdpart.c]
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Tested-by: Ladislav Michl <ladis@linux-mips.org>
This commit is contained in:
Boris Brezillon
2018-01-09 09:50:35 +01:00
parent 24ff129222
commit 0aede42e98
4 changed files with 0 additions and 91 deletions

View File

@@ -904,9 +904,6 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t from,
if (ooblen % DOC_LAYOUT_OOB_SIZE)
return -EINVAL;
if (from + len > mtd->size)
return -EINVAL;
ops->oobretlen = 0;
ops->retlen = 0;
ret = 0;
@@ -1441,8 +1438,6 @@ static int doc_write_oob(struct mtd_info *mtd, loff_t ofs,
if (len && ooblen &&
(len / DOC_LAYOUT_PAGE_SIZE) != (ooblen / oobdelta))
return -EINVAL;
if (ofs + len > mtd->size)
return -EINVAL;
ops->oobretlen = 0;
ops->retlen = 0;