]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
CFI: fix warning: variable ... set but not used
authorWolfgang Denk <wd@denx.de>
Wed, 5 Oct 2011 20:48:12 +0000 (22:48 +0200)
committerWolfgang Denk <wd@denx.de>
Sun, 9 Oct 2011 21:24:49 +0000 (23:24 +0200)
Fix:
cfi_mtd.c: In function 'cfi_mtd_init':
cfi_mtd.c:226:19: warning: variable 'mtd_list' set but not used [-Wunused-but-set-variable]
cfi_mtd.c: In function 'cfi_mtd_init':
cfi_mtd.c:225:6: warning: unused variable 'devices_found'
cfi_mtd.c: In function 'cfi_mtd_init':
cfi_mtd.c:226:19: warning: variable 'mtd_list' set but not used [-Wunused-but-set-variable]
[-Wunused-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Stefan Roese <sr@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
common/cmd_mtdparts.c
drivers/mtd/cfi_mtd.c

index 5481c885d3ea1bb92303d5396d5f626d7c5337e2..2c2e4e09735aed78d734620ed5eb3057d0e1dfaf 100644 (file)
@@ -838,7 +838,10 @@ static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_
        struct mtdids *id;
        const char *mtd_id;
        unsigned int mtd_id_len;
-       const char *p, *pend;
+       const char *p;
+#ifdef DEBUG
+       const char *pend;
+#endif
        LIST_HEAD(tmp_list);
        struct list_head *entry, *n;
        u16 num_parts;
@@ -868,10 +871,12 @@ static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_
                return 1;
        }
 
+#ifdef DEBUG
+       pend = strchr(p, ';');
+#endif
        debug("dev type = %d (%s), dev num = %d, mtd-id = %s\n",
                        id->type, MTD_DEV_TYPE(id->type),
                        id->num, id->mtd_id);
-       pend = strchr(p, ';');
        debug("parsing partitions %.*s\n", (pend ? pend - p : strlen(p)), p);
 
 
index cbcc165c7efd4df7fcbfbf4135f8427e337628ad..8d74fa94128a7348de33a4051ba3ef3f13d805a6 100644 (file)
@@ -222,8 +222,10 @@ int cfi_mtd_init(void)
        struct mtd_info *mtd;
        flash_info_t *fi;
        int error, i;
+#ifdef CONFIG_MTD_CONCAT
        int devices_found = 0;
        struct mtd_info *mtd_list[CONFIG_SYS_MAX_FLASH_BANKS];
+#endif
 
        for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) {
                fi = &flash_info[i];
@@ -253,7 +255,9 @@ int cfi_mtd_init(void)
                if (add_mtd_device(mtd))
                        return -ENOMEM;
 
+#ifdef CONFIG_MTD_CONCAT
                mtd_list[devices_found++] = mtd;
+#endif
        }
 
 #ifdef CONFIG_MTD_CONCAT