cmd: usbdown: fix build error without CONFIG_SET_DFU_ALT_INFO
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 3 Aug 2017 09:38:13 +0000 (18:38 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 20 Oct 2020 01:35:22 +0000 (10:35 +0900)
If CONFIG_SET_DFU_ALT_INFO is not set, there is build error. Fix
the build error with moving dfu related variables and macros to
inside of the config defined area.

Change-Id: Ife977d8cc4da8e3d84a53c8e9cb27280e80d1464
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
cmd/usbdown.c

index 8dca3d3..05500c4 100644 (file)
@@ -230,12 +230,15 @@ static int usb_fill_entity(struct usbdown_entity *usb, char *s, int alt_num,
 static void fill_entity_usbdown(char *interface, char *devstr)
 {
        struct usbdown_entity *usbdown;
-       int alt_num, i, ret, offset = 0;
-       char *alt_setting, *alt_sep, *s, *st, *setting;
+       int alt_num, i, ret;
+       char *s, *st, *setting;
+
+#ifdef CONFIG_SET_DFU_ALT_INFO
+       int offset = 0;
+       char *alt_setting, *alt_sep;
        size_t buf_size = CONFIG_SET_DFU_ALT_BUF_LEN;
        ALLOC_CACHE_ALIGN_BUFFER(char, buf, buf_size);
 
-#ifdef CONFIG_SET_DFU_ALT_INFO
        /* Reuse dfu information. Use the eMMC by default */
        env_set("dfu_alt_boot", CONFIG_DFU_ALT_BOOT_EMMC);
        offset = snprintf(buf, buf_size, "%s", CONFIG_DFU_ALT_BOOT_EMMC);