[U-Boot] [PATCH 1/3] cmd: fpga: Reorder the arguments parsing code

Michal Simek michal.simek at xilinx.com
Wed May 30 15:07:11 UTC 2018


On 29.5.2018 16:22, Siva Durga Prasad Paladugu wrote:
> This patch modifies the arguments parsing code by parsing
> based on requested operation for fpga loadfs and then
> parses the most common/basic args for other fpga load
> commands. This makes it easy for new command extensions
> or additions especially the commands with more args.
> 
> Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu at xilinx.com>
> ---
>  cmd/fpga.c | 31 +++++++++++++++++++------------
>  1 file changed, 19 insertions(+), 12 deletions(-)
> 
> diff --git a/cmd/fpga.c b/cmd/fpga.c
> index 14ad4e5..0981826 100644
> --- a/cmd/fpga.c
> +++ b/cmd/fpga.c
> @@ -60,15 +60,31 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
>  	if (datastr)
>  		fpga_data = (void *)simple_strtoul(datastr, NULL, 16);
>  
> -	switch (argc) {
> +	if (argc > 9 && argc < 3) {

&& is completely broken here.
Also there is an option to use fpga and fpgadata variable and 2 args are
valid too.

Thanks,
Michal


More information about the U-Boot mailing list