Lines Matching refs:len

20 static uint mtd_len_to_pages(struct mtd_info *mtd, u64 len)  in mtd_len_to_pages()  argument
22 do_div(len, mtd->writesize); in mtd_len_to_pages()
24 return len; in mtd_len_to_pages()
37 static void mtd_dump_buf(const u8 *buf, uint len, uint offset) in mtd_dump_buf() argument
41 for (i = 0; i < len; ) { in mtd_dump_buf()
55 const u8 *buf, u64 len, bool woob) in mtd_dump_device_buf() argument
59 int npages = mtd_len_to_pages(mtd, len); in mtd_dump_device_buf()
76 mtd_dump_buf(&buf[len + oob_off], in mtd_dump_device_buf()
82 len, start_off); in mtd_dump_device_buf()
83 mtd_dump_buf(buf, len, start_off); in mtd_dump_device_buf()
171 for (i = 0; i < op->len; i++) in mtd_oob_write_is_empty()
277 u64 start_off, off, len, remaining, default_len; in do_mtd() local
305 len = argc > 1 ? simple_strtoul(argv[1], NULL, 16) : in do_mtd()
307 if (!mtd_is_aligned_with_min_io_size(mtd, len)) { in do_mtd()
308 len = round_up(len, mtd->writesize); in do_mtd()
310 mtd->writesize, len); in do_mtd()
313 remaining = len; in do_mtd()
314 npages = mtd_len_to_pages(mtd, len); in do_mtd()
318 buf = kmalloc(len + oob_len, GFP_KERNEL); in do_mtd()
329 read ? "Reading" : "Writing", len, npages, start_off, in do_mtd()
334 read ? "Reading" : "Writing", len, start_off); in do_mtd()
337 io_op.len = has_pages ? mtd->writesize : len; in do_mtd()
340 io_op.oobbuf = woob ? &buf[len] : NULL; in do_mtd()
376 mtd_dump_device_buf(mtd, start_off, buf, len, woob); in do_mtd()
392 u64 off, len; in do_mtd() local
396 len = argc > 1 ? simple_strtoul(argv[1], NULL, 16) : mtd->size; in do_mtd()
404 if (!mtd_is_aligned_with_block_size(mtd, len)) { in do_mtd()
411 off, off + len - 1, mtd_div_by_eb(len, mtd)); in do_mtd()
415 erase_op.len = len; in do_mtd()
418 while (erase_op.len) { in do_mtd()
429 erase_op.len -= erase_op.fail_addr - erase_op.addr; in do_mtd()
430 erase_op.len -= mtd->erasesize; in do_mtd()