
Dear Ben Gardiner,
In message 1278366212-24023-4-git-send-email-bengardiner@nanometrics.ca you wrote:
This patch introduces the 'spread' sub-command of the mtdparts command. This command will modify the existing mtdparts variable by increasing the size of the partitions such that 1) each partition's net size is at least as large as the size specified in the mtdparts variable and 2) each partition starts on a good block.
The new subcommand is implemented by iterating over the mtd device partitions and collecting a bad blocks count in each -- including any trailing bad blocks -- and then modifying that partitions's part_info structure and checking if the modification affects the next partition.
Signed-off-by: Ben Gardiner bengardiner@nanometrics.ca CC: Harald Welte laforge@gnumonks.org
V2:
- formatting: spaces after 'if' and 'for'
- trailing whitespace removed
- check for null mtd->block_isbad before dereferencing
V3:
- rebased to 54841ab50c20d6fa6c9cc3eb826989da3a22d934 of git://git.denx.de/u-boot.git
- fix more checkpatch errors
- update copyright statement of cmd_mtdparts.c to include openmoko's copyright of the 'dynamic partitions' functionality using commit e05835df019027391f58f9d8ce5e1257d6924798 of git://git.openmoko.org/u-boot.git as reference.
NAK. Please add this to the commit message, and add Harald's SoB line instead.
+#if defined(CONFIG_CMD_MTDPARTS_SPREAD) +/** Increase the size of the given partition so that it's net size is at least
- as large as the size member and such that the next parition would start on a
- good blcok if it were adjacent to this partition
- @param mtd the mtd device
- @param part the partition
- @param next_offset pointer to the offset of the next partition after this
partition's size has been modified (output)
- */
Incorrect multiline comment style.
- for (i = part->offset;
i - bb_delta < part->offset + part->size;
i += mtd->erasesize) {
if (mtd->block_isbad(mtd, i))
bb_delta += mtd->erasesize;
- }
Indentation by TAB only, please.
- /* Absorb bad blocks immeadiately following this
* partition also into the partition, such that
* the next partition starts with a good block.
*/
Incorrect multiline comment style. More follow. Please fix globally.
Best regards,
Wolfgang Denk