]> git.karo-electronics.de Git - karo-tx-linux.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)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 6 Aug 2013 13:56:31 +0000 (16:56 +0300)
commit80a8f2c1fa5ef6501b7288567c0b9de6283f8289
tree6b1635ffb97cb0dbf92fb76b775667805650529a
parentc8baa450f59cd4a63d319a2e230ba7c857cc6d36
mtd: nand: remove multiplied-by-2 block logic

The previous patch 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>
drivers/mtd/nand/nand_bbt.c