Revert "mtd: mtdram: check offs and len in mtdram->erase"
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Fri Nov 6 10:59:07 PST 2015
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=d489ff42db9179647004ca2b12c614cb71ac81ea
Commit: d489ff42db9179647004ca2b12c614cb71ac81ea
Parent: 7827e3acad2df1c6537e5fe7211d216dabc60399
Author: Brian Norris <computersforpeace at gmail.com>
AuthorDate: Tue Sep 29 17:28:44 2015 -0700
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Tue Sep 29 17:29:17 2015 -0700
Revert "mtd: mtdram: check offs and len in mtdram->erase"
This reverts commit 7827e3acad2df1c6537e5fe7211d216dabc60399.
There are some 64-bit arithmetic issues on some architectures, so let's
wait until we get a better patch for this.
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
drivers/mtd/devices/mtdram.c | 21 ---------------------
1 file changed, 21 deletions(-)
diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c
index 73fa297..8e28508 100644
--- a/drivers/mtd/devices/mtdram.c
+++ b/drivers/mtd/devices/mtdram.c
@@ -32,29 +32,8 @@ MODULE_PARM_DESC(erase_size, "Device erase block size in KiB");
// We could store these in the mtd structure, but we only support 1 device..
static struct mtd_info *mtd_info;
-static int check_offs_len(struct mtd_info *mtd, loff_t ofs, uint64_t len)
-{
- int ret = 0;
-
- /* Start address must align on block boundary */
- if (ofs % mtd->erasesize) {
- pr_debug("%s: unaligned address\n", __func__);
- ret = -EINVAL;
- }
-
- /* Length must align on block boundary */
- if (len % mtd->erasesize) {
- pr_debug("%s: length not block aligned\n", __func__);
- ret = -EINVAL;
- }
-
- return ret;
-}
-
static int ram_erase(struct mtd_info *mtd, struct erase_info *instr)
{
- if (check_offs_len(mtd, instr->addr, instr->len))
- return -EINVAL;
memset((char *)mtd->priv + instr->addr, 0xff, instr->len);
instr->state = MTD_ERASE_DONE;
mtd_erase_callback(instr);
More information about the linux-mtd-cvs
mailing list