From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Mon, 23 Feb 2015 17:40:19 -0700 Subject: [U-Boot] [PATCH 1/3] part: Add support for list filtering on bootable partitions In-Reply-To: <1424379221-2378-2-git-send-email-sjoerd.simons@collabora.co.uk> References: <1424379221-2378-1-git-send-email-sjoerd.simons@collabora.co.uk> <1424379221-2378-2-git-send-email-sjoerd.simons@collabora.co.uk> Message-ID: <54EBC873.7030206@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 02/19/2015 01:53 PM, Sjoerd Simons wrote: > Add an optional -bootable parameter to the part list commands to only > put the list of bootable partitions in the environment variable > diff --git a/common/cmd_part.c b/common/cmd_part.c > + for (i = 2; i < argc; i++) { > + if (argv[i][0] == '-') { > + if (!strcmp(argv[i], "-bootable")) { > + bootable = true; > + } else { > + printf("Unknown option %s\n", argv[i]); > + return CMD_RET_USAGE; > + } > + } else if (var == NULL) { > + var = argv[i]; > + } else { > + printf("duplicated varname\n"); > + return CMD_RET_USAGE; > + } > + } I'd prefer that to validate the command-line doesn't have multiple variable names, or the variable name specified before the -bootable flag, so that only the following options are valid: ... var ... -bootable var and not: ... var1 var2 ... var -bootable etc. This could be tightened up later I suppose. Other than that, this series looks good at a quick glance, so: Acked-by: Stephen Warren