]> git.sur5r.net Git - u-boot/blobdiff - fs/yaffs2/yaffs_guts.c
Convert CONFIG_ENV_IS_IN_FAT to Kconfig
[u-boot] / fs / yaffs2 / yaffs_guts.c
index 00d1c5a91e9db1b89459021e9d4cac59a96d742f..32e6ff2a040660ad22e43f19fc38920fdede1a02 100644 (file)
@@ -219,18 +219,11 @@ static void yaffs_handle_chunk_wr_ok(struct yaffs_dev *dev, int nand_chunk,
                                     const u8 *data,
                                     const struct yaffs_ext_tags *tags)
 {
-       dev = dev;
-       nand_chunk = nand_chunk;
-       data = data;
-       tags = tags;
 }
 
 static void yaffs_handle_chunk_update(struct yaffs_dev *dev, int nand_chunk,
                                      const struct yaffs_ext_tags *tags)
 {
-       dev = dev;
-       nand_chunk = nand_chunk;
-       tags = tags;
 }
 
 void yaffs_handle_chunk_error(struct yaffs_dev *dev,
@@ -321,9 +314,8 @@ static int yaffs_check_chunk_erased(struct yaffs_dev *dev, int nand_chunk)
        int retval = YAFFS_OK;
        u8 *data = yaffs_get_temp_buffer(dev);
        struct yaffs_ext_tags tags;
-       int result;
 
-       result = yaffs_rd_chunk_tags_nand(dev, nand_chunk, data, &tags);
+       yaffs_rd_chunk_tags_nand(dev, nand_chunk, data, &tags);
 
        if (tags.ecc_result > YAFFS_ECC_RESULT_NO_ERROR)
                retval = YAFFS_FAIL;
@@ -349,9 +341,8 @@ static int yaffs_verify_chunk_written(struct yaffs_dev *dev,
        int retval = YAFFS_OK;
        struct yaffs_ext_tags temp_tags;
        u8 *buffer = yaffs_get_temp_buffer(dev);
-       int result;
 
-       result = yaffs_rd_chunk_tags_nand(dev, nand_chunk, buffer, &temp_tags);
+       yaffs_rd_chunk_tags_nand(dev, nand_chunk, buffer, &temp_tags);
        if (memcmp(buffer, data, dev->data_bytes_per_chunk) ||
            temp_tags.obj_id != tags->obj_id ||
            temp_tags.chunk_id != tags->chunk_id ||
@@ -816,8 +807,6 @@ struct yaffs_tnode *yaffs_find_tnode_0(struct yaffs_dev *dev,
        int required_depth;
        int level = file_struct->top_level;
 
-       dev = dev;
-
        /* Check sane level and chunk Id */
        if (level < 0 || level > YAFFS_TNODES_MAX_LEVEL)
                return NULL;
@@ -1485,7 +1474,6 @@ static struct yaffs_cache *yaffs_grab_chunk_cache(struct yaffs_dev *dev)
        struct yaffs_obj *the_obj;
        int usage;
        int i;
-       int pushout;
 
        if (dev->param.n_caches < 1)
                return NULL;
@@ -1506,7 +1494,6 @@ static struct yaffs_cache *yaffs_grab_chunk_cache(struct yaffs_dev *dev)
                the_obj = dev->cache[0].object;
                usage = -1;
                cache = NULL;
-               pushout = -1;
 
                for (i = 0; i < dev->param.n_caches; i++) {
                        if (dev->cache[i].object &&
@@ -1516,7 +1503,6 @@ static struct yaffs_cache *yaffs_grab_chunk_cache(struct yaffs_dev *dev)
                                usage = dev->cache[i].last_use;
                                the_obj = dev->cache[i].object;
                                cache = &dev->cache[i];
-                               pushout = i;
                        }
                }
 
@@ -3176,8 +3162,6 @@ static void yaffs_check_obj_details_loaded(struct yaffs_obj *in)
        struct yaffs_obj_hdr *oh;
        struct yaffs_dev *dev;
        struct yaffs_ext_tags tags;
-       int result;
-       int alloc_failed = 0;
 
        if (!in || !in->lazy_loaded || in->hdr_chunk < 1)
                return;
@@ -3186,7 +3170,7 @@ static void yaffs_check_obj_details_loaded(struct yaffs_obj *in)
        in->lazy_loaded = 0;
        buf = yaffs_get_temp_buffer(dev);
 
-       result = yaffs_rd_chunk_tags_nand(dev, in->hdr_chunk, buf, &tags);
+       yaffs_rd_chunk_tags_nand(dev, in->hdr_chunk, buf, &tags);
        oh = (struct yaffs_obj_hdr *)buf;
 
        in->yst_mode = oh->yst_mode;
@@ -3196,8 +3180,6 @@ static void yaffs_check_obj_details_loaded(struct yaffs_obj *in)
        if (in->variant_type == YAFFS_OBJECT_TYPE_SYMLINK) {
                in->variant.symlink_variant.alias =
                    yaffs_clone_str(oh->alias);
-               if (!in->variant.symlink_variant.alias)
-                       alloc_failed = 1;       /* Not returned */
        }
        yaffs_release_temp_buffer(dev, buf);
 }
@@ -3221,20 +3203,18 @@ static void yaffs_load_name_from_oh(struct yaffs_dev *dev, YCHAR *name,
                } else {
                        yaffs_strncpy(name, oh_name + 1, buff_size - 1);
                }
-       } else {
-#else
-       dev = dev;
-       {
-#endif
-               yaffs_strncpy(name, oh_name, buff_size - 1);
+
+               return;
        }
+#endif
+
+       yaffs_strncpy(name, oh_name, buff_size - 1);
 }
 
 static void yaffs_load_oh_from_name(struct yaffs_dev *dev, YCHAR *oh_name,
                                    const YCHAR *name)
 {
 #ifdef CONFIG_YAFFS_AUTO_UNICODE
-
        int is_ascii;
        YCHAR *w;
 
@@ -3265,13 +3245,12 @@ static void yaffs_load_oh_from_name(struct yaffs_dev *dev, YCHAR *oh_name,
                        *oh_name = 0;
                        yaffs_strncpy(oh_name + 1, name, YAFFS_MAX_NAME_LENGTH - 2);
                }
-       } else {
-#else
-       dev = dev;
-       {
-#endif
-               yaffs_strncpy(oh_name, name, YAFFS_MAX_NAME_LENGTH - 1);
+
+               return;
        }
+#endif
+
+       yaffs_strncpy(oh_name, name, YAFFS_MAX_NAME_LENGTH - 1);
 }
 
 /* UpdateObjectHeader updates the header on NAND for an object.
@@ -3285,7 +3264,6 @@ int yaffs_update_oh(struct yaffs_obj *in, const YCHAR *name, int force,
        struct yaffs_dev *dev = in->my_dev;
        int prev_chunk_id;
        int ret_val = 0;
-       int result = 0;
        int new_chunk_id;
        struct yaffs_ext_tags new_tags;
        struct yaffs_ext_tags old_tags;
@@ -3309,8 +3287,8 @@ int yaffs_update_oh(struct yaffs_obj *in, const YCHAR *name, int force,
        prev_chunk_id = in->hdr_chunk;
 
        if (prev_chunk_id > 0) {
-               result = yaffs_rd_chunk_tags_nand(dev, prev_chunk_id,
-                                                 buffer, &old_tags);
+               yaffs_rd_chunk_tags_nand(dev, prev_chunk_id,
+                                         buffer, &old_tags);
 
                yaffs_verify_oh(in, oh, &old_tags, 0);
                memcpy(old_name, oh->name, sizeof(oh->name));
@@ -4444,7 +4422,6 @@ int yaffs_get_obj_name(struct yaffs_obj *obj, YCHAR *name, int buffer_size)
        } else if (obj->short_name[0]) {
                yaffs_strcpy(name, obj->short_name);
        } else if (obj->hdr_chunk > 0) {
-               int result;
                u8 *buffer = yaffs_get_temp_buffer(obj->my_dev);
 
                struct yaffs_obj_hdr *oh = (struct yaffs_obj_hdr *)buffer;
@@ -4452,9 +4429,9 @@ int yaffs_get_obj_name(struct yaffs_obj *obj, YCHAR *name, int buffer_size)
                memset(buffer, 0, obj->my_dev->data_bytes_per_chunk);
 
                if (obj->hdr_chunk > 0) {
-                       result = yaffs_rd_chunk_tags_nand(obj->my_dev,
-                                                         obj->hdr_chunk,
-                                                         buffer, NULL);
+                       yaffs_rd_chunk_tags_nand(obj->my_dev,
+                                                obj->hdr_chunk,
+                                                buffer, NULL);
                }
                yaffs_load_name_from_oh(obj->my_dev, name, oh->name,
                                        buffer_size);