yaffs Fixed some bugs in direct/timothy_tests/mirror_tests
[yaffs2.git] / yaffs_mtdif2_single.c
index 00040cd..d1643df 100644 (file)
@@ -47,10 +47,9 @@ int nandmtd2_write_chunk_tags(struct yaffs_dev *dev, int nand_chunk,
        void *packed_tags_ptr =
            dev->param.no_tags_ecc ? (void *)&pt.t : (void *)&pt;
 
-       T(YAFFS_TRACE_MTD,
-         (TSTR
-          ("nandmtd2_write_chunk_tags chunk %d data %p tags %p"
-           TENDSTR), nand_chunk, data, tags));
+       yaffs_trace(YAFFS_TRACE_MTD,
+               "nandmtd2_write_chunk_tags chunk %d data %p tags %p",
+               nand_chunk, data, tags);
 
        addr = ((loff_t) nand_chunk) * dev->param.total_bytes_per_chunk;
 
@@ -67,8 +66,9 @@ int nandmtd2_write_chunk_tags(struct yaffs_dev *dev, int nand_chunk,
                                                            dev->
                                                            data_bytes_per_chunk);
                yaffs_pack_tags2_tags_only(pt2tp, tags);
-       } else
+       } else {
                yaffs_pack_tags2(&pt, tags, !dev->param.no_tags_ecc);
+        }
 
        ops.mode = MTD_OOB_AUTO;
        ops.ooblen = (dev->param.inband_tags) ? 0 : packed_tags_size;
@@ -103,10 +103,9 @@ int nandmtd2_read_chunk_tags(struct yaffs_dev *dev, int nand_chunk,
        void *packed_tags_ptr =
            dev->param.no_tags_ecc ? (void *)&pt.t : (void *)&pt;
 
-       T(YAFFS_TRACE_MTD,
-         (TSTR
-          ("nandmtd2_read_chunk_tags chunk %d data %p tags %p"
-           TENDSTR), nand_chunk, data, tags));
+       yaffs_trace(YAFFS_TRACE_MTD,
+               "nandmtd2_read_chunk_tags chunk %d data %p tags %p",
+               nand_chunk, data, tags);
 
        if (dev->param.inband_tags) {
 
@@ -170,8 +169,8 @@ int nandmtd2_mark_block_bad(struct yaffs_dev *dev, int block_no)
 {
        struct mtd_info *mtd = yaffs_dev_to_mtd(dev);
        int retval;
-       T(YAFFS_TRACE_MTD,
-         (TSTR("nandmtd2_mark_block_bad %d" TENDSTR), block_no));
+       yaffs_trace(YAFFS_TRACE_MTD,
+               "nandmtd2_mark_block_bad %d", block_no);
 
        retval =
            mtd->block_markbad(mtd,
@@ -191,14 +190,14 @@ int nandmtd2_query_block(struct yaffs_dev *dev, int block_no,
        struct mtd_info *mtd = yaffs_dev_to_mtd(dev);
        int retval;
 
-       T(YAFFS_TRACE_MTD, (TSTR("nandmtd2_query_block %d" TENDSTR), block_no));
+       yaffs_trace(YAFFS_TRACE_MTD, "nandmtd2_query_block %d", block_no);
        retval =
            mtd->block_isbad(mtd,
                             block_no * dev->param.chunks_per_block *
                             dev->param.total_bytes_per_chunk);
 
        if (retval) {
-               T(YAFFS_TRACE_MTD, (TSTR("block is bad" TENDSTR)));
+               yaffs_trace(YAFFS_TRACE_MTD, "block is bad");
 
                *state = YAFFS_BLOCK_STATE_DEAD;
                *seq_number = 0;
@@ -215,11 +214,12 @@ int nandmtd2_query_block(struct yaffs_dev *dev, int block_no,
                        *state = YAFFS_BLOCK_STATE_EMPTY;
                }
        }
-       T(YAFFS_TRACE_MTD,
-         (TSTR("block is bad seq %d state %d" TENDSTR), *seq_number, *state));
+       yaffs_trace(YAFFS_TRACE_MTD,
+               "block is bad seq %d state %d", *seq_number, *state);
 
        if (retval == 0)
                return YAFFS_OK;
        else
                return YAFFS_FAIL;
 }
+