cmd: usbdown: fix build error without CONFIG_SET_DFU_ALT_INFO 98/142298/4
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 3 Aug 2017 09:38:13 +0000 (18:38 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 7 Aug 2017 02:10:27 +0000 (02:10 +0000)
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 6e4aede990290c3428ef00dd693a64380962428d..49d42aec9ac120c1cd4c97587b1e4dafcf512bc0 100644 (file)
@@ -227,12 +227,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 */
        setenv("dfu_alt_boot", CONFIG_DFU_ALT_BOOT_EMMC);
        offset = snprintf(buf, buf_size, "%s", CONFIG_DFU_ALT_BOOT_EMMC);