]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: move SCANLASTPAGE handling to the correct code block
authorBrian Norris <computersforpeace@gmail.com>
Sat, 21 Jan 2012 04:38:03 +0000 (20:38 -0800)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 26 Mar 2012 23:16:04 +0000 (00:16 +0100)
commit517f58127a5ad023b85e6906258230afac319fa6
treeae3316d7790e13ac7412309b9ca2ba8dde95c118
parent1a87a9e99d2de29faa2743fc8d0e00ddaffc78d6
mtd: nand: move SCANLASTPAGE handling to the correct code block

As nand_default_block_markbad() is becoming more complex, it helps to
have code appear only in its relevant codepath(s). Here, the calculation
of `ofs' based on NAND_BBT_SCANLASTPAGE is only useful on paths where we
write bad block markers to OOB. We move the condition/calculation closer
to the `write' operation and update the comment to more correctly
describe the operation.

The variable `wr_ofs' is also used to help isolate our calculation of
the "write" offset from the usage of `ofs' to represent the eraseblock
offset. This will become useful when we reorder operations in the next
patch.

This patch should make no functional change.

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_base.c