]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: thordown: Reorder variable declaration
authorMarek Vasut <marex@denx.de>
Fri, 1 Sep 2023 09:49:53 +0000 (11:49 +0200)
committerMarek Vasut <marex@denx.de>
Fri, 15 Sep 2023 21:38:02 +0000 (23:38 +0200)
Move the variable declaration around to improve code readability.
No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
cmd/thordown.c

index 838764ccef79b98ae9f9b029b90090c1cbe53695..0d8dcee53147f2e875d8bbc28d020c01d66fc513 100644 (file)
 
 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);