[PATCH v2 07/17] cmd: thordown: Reorder variable declaration

Mattijs Korpershoek mkorpershoek at baylibre.com
Mon Sep 4 09:40:07 CEST 2023


On ven., sept. 01, 2023 at 11:49, Marek Vasut <marex at denx.de> wrote:

> Move the variable declaration around to improve code readability.
> No functional change.
>
> Signed-off-by: Marek Vasut <marex at denx.de>

Reviewed-by: Mattijs Korpershoek <mkorpershoek at baylibre.com>

> ---
> Cc: Angus Ainslie <angus at akkea.ca>
> Cc: Dmitrii Merkurev <dimorinny at google.com>
> Cc: Eddie Cai <eddie.cai.linux at gmail.com>
> Cc: Kever Yang <kever.yang at rock-chips.com>
> Cc: Lukasz Majewski <lukma at denx.de>
> Cc: Miquel Raynal <miquel.raynal at bootlin.com>
> Cc: Mattijs Korpershoek <mkorpershoek at baylibre.com>
> Cc: Nishanth Menon <nm at ti.com>
> Cc: Patrice Chotard <patrice.chotard at foss.st.com>
> Cc: Patrick Delaunay <patrick.delaunay at foss.st.com>
> Cc: Philipp Tomsich <philipp.tomsich at vrull.eu>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Stefan Roese <sr at denx.de>
> Cc: kernel at puri.sm
> ---
> V2: No change
> ---
>  cmd/thordown.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/cmd/thordown.c b/cmd/thordown.c
> index 838764ccef7..0d8dcee5314 100644
> --- a/cmd/thordown.c
> +++ b/cmd/thordown.c
> @@ -15,22 +15,23 @@
>  
>  int do_thor_down(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
>  {
> +	char *interface, *devstring;
> +	int controller_index;
> +	int ret;
> +
>  	if (argc < 4)
>  		return CMD_RET_USAGE;
>  
> -	char *usb_controller = argv[1];
> -	char *interface = argv[2];
> -	char *devstring = argv[3];
> -
> -	int ret;
> -
>  	puts("TIZEN \"THOR\" Downloader\n");
>  
> +	interface = argv[2];
> +	devstring = argv[3];
> +
>  	ret = dfu_init_env_entities(interface, devstring);
>  	if (ret)
>  		goto done;
>  
> -	int controller_index = simple_strtoul(usb_controller, NULL, 0);
> +	controller_index = simple_strtoul(argv[1], NULL, 0);
>  	ret = usb_gadget_initialize(controller_index);
>  	if (ret) {
>  		pr_err("USB init failed: %d\n", ret);
> -- 
> 2.40.1


More information about the U-Boot mailing list