From 07af81beaa81a0c9b1a3764cb2f7227dd5fcfa78 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Thu, 3 Aug 2017 18:38:13 +0900 Subject: [PATCH] cmd: usbdown: fix build error without CONFIG_SET_DFU_ALT_INFO 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 --- cmd/usbdown.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/usbdown.c b/cmd/usbdown.c index 8dca3d3..05500c4 100644 --- a/cmd/usbdown.c +++ b/cmd/usbdown.c @@ -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); -- 2.7.4