summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@free-electrons.com>2018-01-09 09:50:35 +0100
committerBoris Brezillon <boris.brezillon@free-electrons.com>2018-01-16 15:23:22 +0100
commit0aede42e98e0dfc64534617332b6a120cfcfe850 (patch)
tree7d6710c5174875f0032699bcf107fe1a7d7d1fd0 /drivers/mtd/devices
parentmtd: Fallback to ->_read/write_oob() when ->_read/write() is missing (diff)
downloadlinux-0aede42e98e0dfc64534617332b6a120cfcfe850.tar.xz
linux-0aede42e98e0dfc64534617332b6a120cfcfe850.zip
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>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/docg3.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index 5fb5e93d1547..a85af236b44d 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -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;