From: Wolfgang Denk Date: Sat, 07 Aug 2010 22:12:01 +0200 Subject: [U-Boot] [PATCH v3 3/4] mtdparts: add new sub-command "spread" In-Reply-To: <1278366212-24023-4-git-send-email-bengardiner@nanometrics.ca> References: <1275494319-29010-1-git-send-email-bengardiner@nanometrics.ca> <1278366212-24023-4-git-send-email-bengardiner@nanometrics.ca> Message-ID: <20100807201201.92E22B715A@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > CC: Harald Welte > > --- > > 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 -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "There was no difference between the behavior of a god and the operations of pure chance..." - Thomas Pynchon, _Gravity's Rainbow_