X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=yaffs_verify.c;h=55884b97484726beb2d3060ee74e5000d1e289a1;hb=b70ea39d4f2547564197afa8866b388301765583;hp=c12894dc2c45ac09f4fa0991e63df4bc8f692460;hpb=79d0e028d5b777b2e4cf55d96b737cb024988abe;p=yaffs2.git diff --git a/yaffs_verify.c b/yaffs_verify.c index c12894d..55884b9 100644 --- a/yaffs_verify.c +++ b/yaffs_verify.c @@ -163,8 +163,8 @@ void yaffs_verify_blocks(struct yaffs_dev *dev) } /* - * Verify the object header. oh must be valid, but obj and tags may be NULL in which - * case those tests will not be performed. + * Verify the object header. oh must be valid, but obj and tags may be NULL in + * which case those tests will not be performed. */ void yaffs_verify_oh(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh, struct yaffs_ext_tags *tags, int parent_check) @@ -268,7 +268,6 @@ void yaffs_verify_file(struct yaffs_obj *obj) if (tn) { u32 the_chunk = yaffs_get_group_base(dev, tn, i); if (the_chunk > 0) { - /* T(~0,(TSTR("verifying (%d:%d) %d"TENDSTR),obj_id,i,the_chunk)); */ yaffs_rd_chunk_tags_nand(dev, the_chunk, NULL, &tags); if (tags.obj_id != obj_id || tags.chunk_id != i) @@ -415,11 +414,8 @@ void yaffs_verify_objects(struct yaffs_dev *dev) for (i = 0; i < YAFFS_NOBJECT_BUCKETS; i++) { list_for_each(lh, &dev->obj_bucket[i].list) { - if (lh) { - obj = - list_entry(lh, struct yaffs_obj, hash_link); - yaffs_verify_obj(obj); - } + obj = list_entry(lh, struct yaffs_obj, hash_link); + yaffs_verify_obj(obj); } } } @@ -454,12 +450,10 @@ void yaffs_verify_obj_in_dir(struct yaffs_obj *obj) /* Iterate through the objects in each hash entry */ list_for_each(lh, &obj->parent->variant.dir_variant.children) { - if (lh) { - list_obj = list_entry(lh, struct yaffs_obj, siblings); - yaffs_verify_obj(list_obj); - if (obj == list_obj) - count++; - } + list_obj = list_entry(lh, struct yaffs_obj, siblings); + yaffs_verify_obj(list_obj); + if (obj == list_obj) + count++; } if (count != 1) { @@ -493,16 +487,14 @@ void yaffs_verify_dir(struct yaffs_obj *directory) /* Iterate through the objects in each hash entry */ list_for_each(lh, &directory->variant.dir_variant.children) { - if (lh) { - list_obj = list_entry(lh, struct yaffs_obj, siblings); - if (list_obj->parent != directory) { - yaffs_trace(YAFFS_TRACE_ALWAYS, - "Object in directory list has wrong parent %p", - list_obj->parent); - YBUG(); - } - yaffs_verify_obj_in_dir(list_obj); + list_obj = list_entry(lh, struct yaffs_obj, siblings); + if (list_obj->parent != directory) { + yaffs_trace(YAFFS_TRACE_ALWAYS, + "Object in directory list has wrong parent %p", + list_obj->parent); + YBUG(); } + yaffs_verify_obj_in_dir(list_obj); } }