
Dear Ben Gardiner,
In message 1278366212-24023-5-git-send-email-bengardiner@nanometrics.ca you wrote:
This patch adds a new 'mtdparts add' variant: add.e (with a synomym add.i). This command variant adds a new partition to the mtdparts variable but also increases the partitions size by skipping bad blocks and aggregating any additional bad blocks found at the end of the partition.
Signed-off-by: Ben Gardiner bengardiner@nanometrics.ca
V2:
- formatting: spaces after 'if' and 'for'
- trailing whitespace removed
V3:
- rebased to 54841ab50c20d6fa6c9cc3eb826989da3a22d934 of git://git.denx.de/u-boot.git
- fix more checkpatch errors
- updating copyright to include addition of add.e command
NAK for this like for the previous patches.
+#if defined(CONFIG_CMD_MTDPARTS_SPREAD)
s = strchr(argv[1], '.');
s == NULL if there is no '.' in the argument.
if (get_mtd_info(dev->id->type, dev->id->num, &mtd))
return 1;
+#endif
- if ((dev_tmp = device_find(dev->id->type, dev->id->num)) == NULL) {
+#if defined(CONFIG_CMD_MTDPARTS_SPREAD)
if (!strcmp(s, ".e") || !strcmp(s, ".i")) {
So here you might dereference a NULL pointer. Sounds like a Bad Thing to me. Please add error checking / handling.
+#if defined(CONFIG_CMD_MTDPARTS_SPREAD)
- "mtdparts add.e <mtd-dev> <size>[@<offset>] [<name>] [ro]\n"
- " - add partition, padding size by skipping bad blocks\n"
+#endif
Also document the ".i" version.
Best regards,
Wolfgang Denk