Skip to content
Snippets Groups Projects
Commit 419a1fe9 authored by Wolfgang Denk's avatar Wolfgang Denk
Browse files

CFI: fix warning: variable ... set but not used


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: default avatarWolfgang Denk <wd@denx.de>
Cc: Stefan Roese <sr@denx.de>
Acked-by: default avatarStefan Roese <sr@denx.de>
parent 80c6abc3
No related branches found
No related tags found
No related merge requests found
...@@ -838,7 +838,10 @@ static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_ ...@@ -838,7 +838,10 @@ static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_
struct mtdids *id; struct mtdids *id;
const char *mtd_id; const char *mtd_id;
unsigned int mtd_id_len; unsigned int mtd_id_len;
const char *p, *pend; const char *p;
#ifdef DEBUG
const char *pend;
#endif
LIST_HEAD(tmp_list); LIST_HEAD(tmp_list);
struct list_head *entry, *n; struct list_head *entry, *n;
u16 num_parts; u16 num_parts;
...@@ -868,10 +871,12 @@ static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_ ...@@ -868,10 +871,12 @@ static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_
return 1; return 1;
} }
#ifdef DEBUG
pend = strchr(p, ';');
#endif
debug("dev type = %d (%s), dev num = %d, mtd-id = %s\n", debug("dev type = %d (%s), dev num = %d, mtd-id = %s\n",
id->type, MTD_DEV_TYPE(id->type), id->type, MTD_DEV_TYPE(id->type),
id->num, id->mtd_id); id->num, id->mtd_id);
pend = strchr(p, ';');
debug("parsing partitions %.*s\n", (pend ? pend - p : strlen(p)), p); debug("parsing partitions %.*s\n", (pend ? pend - p : strlen(p)), p);
......
...@@ -222,8 +222,10 @@ int cfi_mtd_init(void) ...@@ -222,8 +222,10 @@ int cfi_mtd_init(void)
struct mtd_info *mtd; struct mtd_info *mtd;
flash_info_t *fi; flash_info_t *fi;
int error, i; int error, i;
#ifdef CONFIG_MTD_CONCAT
int devices_found = 0; int devices_found = 0;
struct mtd_info *mtd_list[CONFIG_SYS_MAX_FLASH_BANKS]; struct mtd_info *mtd_list[CONFIG_SYS_MAX_FLASH_BANKS];
#endif
for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) { for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) {
fi = &flash_info[i]; fi = &flash_info[i];
...@@ -253,7 +255,9 @@ int cfi_mtd_init(void) ...@@ -253,7 +255,9 @@ int cfi_mtd_init(void)
if (add_mtd_device(mtd)) if (add_mtd_device(mtd))
return -ENOMEM; return -ENOMEM;
#ifdef CONFIG_MTD_CONCAT
mtd_list[devices_found++] = mtd; mtd_list[devices_found++] = mtd;
#endif
} }
#ifdef CONFIG_MTD_CONCAT #ifdef CONFIG_MTD_CONCAT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment