diff options
author | Heiko Schocher <heiko.schocher@invitel.hu> | 2010-03-24 13:22:50 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-03-31 15:13:31 +0200 |
commit | 2d2018f3db5ed834bc1ee208a2c6212fdf00bca1 (patch) | |
tree | 752976b7fa76cea187185c7e7b3a24eb80098b87 | |
parent | f3dfbb681620798d212f7e4edfda6c578fe79870 (diff) | |
download | u-boot-imx-2d2018f3db5ed834bc1ee208a2c6212fdf00bca1.zip u-boot-imx-2d2018f3db5ed834bc1ee208a2c6212fdf00bca1.tar.gz u-boot-imx-2d2018f3db5ed834bc1ee208a2c6212fdf00bca1.tar.bz2 |
jffs2, suen3: Fix compiler warning
$ ./MAKEALL suen3
jffs2_1pass.c: In function 'get_fl_mem':
jffs2_1pass.c:399: warning: unused variable 'id'
jffs2_1pass.c: In function 'get_node_mem':
jffs2_1pass.c:423: warning: unused variable 'id'
Signed-off-by: Heiko Schocher <hs@denx.de>
Tested-by: Tom <Tom.Rix@windriver.com>
-rw-r--r-- | fs/jffs2/jffs2_1pass.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c index 93651f5..c4f7445 100644 --- a/fs/jffs2/jffs2_1pass.c +++ b/fs/jffs2/jffs2_1pass.c @@ -398,23 +398,26 @@ static inline void *get_fl_mem(u32 off, u32 size, void *ext_buf) { struct mtdids *id = current_part->dev->id; + switch(id->type) { #if defined(CONFIG_CMD_FLASH) - if (id->type == MTD_DEV_TYPE_NOR) { + case MTD_DEV_TYPE_NOR: return get_fl_mem_nor(off, size, ext_buf); - } + break; #endif - #if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND) - if (id->type == MTD_DEV_TYPE_NAND) + case MTD_DEV_TYPE_NAND: return get_fl_mem_nand(off, size, ext_buf); + break; #endif - #if defined(CONFIG_CMD_ONENAND) - if (id->type == MTD_DEV_TYPE_ONENAND) + case MTD_DEV_TYPE_ONENAND: return get_fl_mem_onenand(off, size, ext_buf); + break; #endif - - printf("get_fl_mem: unknown device type, using raw offset!\n"); + default: + printf("get_fl_mem: unknown device type, " \ + "using raw offset!\n"); + } return (void*)off; } @@ -422,23 +425,27 @@ static inline void *get_node_mem(u32 off, void *ext_buf) { struct mtdids *id = current_part->dev->id; + switch(id->type) { #if defined(CONFIG_CMD_FLASH) - if (id->type == MTD_DEV_TYPE_NOR) + case MTD_DEV_TYPE_NOR: return get_node_mem_nor(off, ext_buf); + break; #endif - #if defined(CONFIG_JFFS2_NAND) && \ defined(CONFIG_CMD_NAND) - if (id->type == MTD_DEV_TYPE_NAND) + case MTD_DEV_TYPE_NAND: return get_node_mem_nand(off, ext_buf); + break; #endif - #if defined(CONFIG_CMD_ONENAND) - if (id->type == MTD_DEV_TYPE_ONENAND) + case MTD_DEV_TYPE_ONENAND: return get_node_mem_onenand(off, ext_buf); + break; #endif - - printf("get_node_mem: unknown device type, using raw offset!\n"); + default: + printf("get_fl_mem: unknown device type, " \ + "using raw offset!\n"); + } return (void*)off; } |