# HG changeset patch # User charles # Date 1232066747 0 # Node ID 467bb4a77339a40d383dcf9e18974b74df182f13 # Parent 08307f2d7546791787def6409493c3a17f5b175d Improve handling of ecc on tags diff --git a/yaffs_packedtags2.c b/yaffs_packedtags2.c --- a/yaffs_packedtags2.c +++ b/yaffs_packedtags2.c @@ -163,15 +163,11 @@ void yaffs_UnpackTags2TagsPart(yaffs_Ext void yaffs_UnpackTags2(yaffs_ExtendedTags * t, yaffs_PackedTags2 * pt) { - yaffs_UnpackTags2TagsPart(t,&pt->t); - + yaffs_ECCResult eccResult = YAFFS_ECC_RESULT_NO_ERROR; + if (pt->t.sequenceNumber != 0xFFFFFFFF) { /* Page is in use */ -#ifdef YAFFS_IGNORE_TAGS_ECC - { - t->eccResult = YAFFS_ECC_RESULT_NO_ERROR; - } -#else +#ifndef YAFFS_IGNORE_TAGS_ECC { yaffs_ECCOther ecc; int result; @@ -186,21 +182,25 @@ void yaffs_UnpackTags2(yaffs_ExtendedTag &pt->ecc, &ecc); switch(result){ case 0: - t->eccResult = YAFFS_ECC_RESULT_NO_ERROR; + eccResult = YAFFS_ECC_RESULT_NO_ERROR; break; case 1: - t->eccResult = YAFFS_ECC_RESULT_FIXED; + eccResult = YAFFS_ECC_RESULT_FIXED; break; case -1: - t->eccResult = YAFFS_ECC_RESULT_UNFIXED; + eccResult = YAFFS_ECC_RESULT_UNFIXED; break; default: - t->eccResult = YAFFS_ECC_RESULT_UNKNOWN; + eccResult = YAFFS_ECC_RESULT_UNKNOWN; } } #endif } + yaffs_UnpackTags2TagsPart(t,&pt->t); + + t->eccResult = eccResult; + yaffs_DumpPackedTags2(pt); yaffs_DumpTags2(t);