summaryrefslogtreecommitdiff
path: root/yaffs_packedtags2.c
diff options
context:
space:
mode:
authorcharles <charles>2009-01-16 00:45:47 +0000
committercharles <charles>2009-01-16 00:45:47 +0000
commit60882d1d699c66850dee55278ba840744b5f87a3 (patch)
tree59c86a3eb96b80a7b923e52f8e18c6fa91d1dad0 /yaffs_packedtags2.c
parent8642921e20e15e95736ea7821f450ac2cb6d92b2 (diff)
Improve handling of ecc on tags
Diffstat (limited to 'yaffs_packedtags2.c')
-rw-r--r--yaffs_packedtags2.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/yaffs_packedtags2.c b/yaffs_packedtags2.c
index 957ed8b..3f9a815 100644
--- a/yaffs_packedtags2.c
+++ b/yaffs_packedtags2.c
@@ -163,15 +163,11 @@ void yaffs_UnpackTags2TagsPart(yaffs_ExtendedTags * t, yaffs_PackedTags2TagsPart
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_ExtendedTags * t, yaffs_PackedTags2 * pt)
&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);