]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: remove multiplied-by-2 block logic
authorBrian Norris <computersforpeace@gmail.com>
Wed, 31 Jul 2013 00:52:56 +0000 (17:52 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 30 Aug 2013 15:43:44 +0000 (16:43 +0100)
commit6e149944aab7a0c48c1c45c46c49e18c3a7ff321
tree6b1635ffb97cb0dbf92fb76b775667805650529a
parentcb8ea69e932fa9c0b6b72b1262a1f0e7fc06aeca
mtd: nand: remove multiplied-by-2 block logic

The parent commit cb8ea69e932fa9c0b6b72b1262a1f0e7fc06aeca ("mtd: nand: add
accessors, macros for in-memory BBT") makes the following comment obsolete:

/*
 * Note that numblocks is 2 * (real numblocks) here, see i+=2
 * below as it makes shifting and masking less painful
 */

I don't think it ever could have been "less painful" to have to shift an
extra bit (or 2, or 3) at various points in nand_bbt.c (and even
outside, since we leak our in-memory format). But now it is certainly
more painful, since we have nice macros and functions to retrieve the
relevant portions of the BBT.

This patch removes any points where the block number is
doubled/halved/otherwise-shifted, instead representing the block number
in its most natural form: as the actual block number.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/nand_bbt.c