Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: nand_bbt: kill NAND_BBT_SCANALLPAGES

Now that the last user of NAND_BBT_SCANALLPAGES has been removed, let's
kill this peculiar BBT feature flag.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

+3 -38
-2
Documentation/DocBook/mtdnand.tmpl
··· 1222 1222 #define NAND_BBT_VERSION 0x00000100 1223 1223 /* Create a bbt if none axists */ 1224 1224 #define NAND_BBT_CREATE 0x00000200 1225 - /* Search good / bad pattern through all pages of a block */ 1226 - #define NAND_BBT_SCANALLPAGES 0x00000400 1227 1225 /* Write bbt if neccecary */ 1228 1226 #define NAND_BBT_WRITE 0x00001000 1229 1227 /* Read and write back block contents when writing bbt */
+3 -34
drivers/mtd/nand/nand_bbt.c
··· 412 412 } 413 413 } 414 414 415 - /* Scan a given block full */ 416 - static int scan_block_full(struct mtd_info *mtd, struct nand_bbt_descr *bd, 417 - loff_t offs, uint8_t *buf, size_t readlen, 418 - int scanlen, int numpages) 419 - { 420 - int ret, j; 421 - 422 - ret = scan_read_oob(mtd, buf, offs, readlen); 423 - /* Ignore ECC errors when checking for BBM */ 424 - if (ret && !mtd_is_bitflip_or_eccerr(ret)) 425 - return ret; 426 - 427 - for (j = 0; j < numpages; j++, buf += scanlen) { 428 - if (check_pattern(buf, scanlen, mtd->writesize, bd)) 429 - return 1; 430 - } 431 - return 0; 432 - } 433 - 434 415 /* Scan a given block partially */ 435 416 static int scan_block_fast(struct mtd_info *mtd, struct nand_bbt_descr *bd, 436 417 loff_t offs, uint8_t *buf, int numpages) ··· 458 477 struct nand_bbt_descr *bd, int chip) 459 478 { 460 479 struct nand_chip *this = mtd->priv; 461 - int i, numblocks, numpages, scanlen; 480 + int i, numblocks, numpages; 462 481 int startblock; 463 482 loff_t from; 464 - size_t readlen; 465 483 466 484 pr_info("Scanning device for bad blocks\n"); 467 485 468 - if (bd->options & NAND_BBT_SCANALLPAGES) 469 - numpages = 1 << (this->bbt_erase_shift - this->page_shift); 470 - else if (bd->options & NAND_BBT_SCAN2NDPAGE) 486 + if (bd->options & NAND_BBT_SCAN2NDPAGE) 471 487 numpages = 2; 472 488 else 473 489 numpages = 1; 474 - 475 - /* We need only read few bytes from the OOB area */ 476 - scanlen = 0; 477 - readlen = bd->len; 478 490 479 491 if (chip == -1) { 480 492 numblocks = mtd->size >> this->bbt_erase_shift; ··· 493 519 494 520 BUG_ON(bd->options & NAND_BBT_NO_OOB); 495 521 496 - if (bd->options & NAND_BBT_SCANALLPAGES) 497 - ret = scan_block_full(mtd, bd, from, buf, readlen, 498 - scanlen, numpages); 499 - else 500 - ret = scan_block_fast(mtd, bd, from, buf, numpages); 501 - 522 + ret = scan_block_fast(mtd, bd, from, buf, numpages); 502 523 if (ret < 0) 503 524 return ret; 504 525
-2
include/linux/mtd/bbm.h
··· 91 91 * with NAND_BBT_CREATE. 92 92 */ 93 93 #define NAND_BBT_CREATE_EMPTY 0x00000400 94 - /* Search good / bad pattern through all pages of a block */ 95 - #define NAND_BBT_SCANALLPAGES 0x00000800 96 94 /* Write bbt if neccecary */ 97 95 #define NAND_BBT_WRITE 0x00002000 98 96 /* Read and write back block contents when writing bbt */