Merge branch 'mainlining'
[yaffs2.git] / yaffs_mtdif2_multi.c
index 555f937..9dcccb8 100644 (file)
@@ -51,10 +51,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;
 
@@ -71,8 +70,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);
+        }
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
        ops.mode = MTD_OOB_AUTO;
@@ -121,10 +121,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) {
 
@@ -169,8 +168,8 @@ int nandmtd2_read_chunk_tags(struct yaffs_dev *dev, int nand_chunk,
                if (tags) {
                        struct yaffs_packed_tags2_tags_only *pt2tp;
                        pt2tp =
-                           (struct yaffs_packed_tags2_tags_only *)&data[dev->
-                                                                        data_bytes_per_chunk];
+                               (struct yaffs_packed_tags2_tags_only *)
+                               &data[dev->data_bytes_per_chunk];
                        yaffs_unpack_tags2_tags_only(tags, pt2tp);
                }
        } else {
@@ -205,8 +204,9 @@ 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,
@@ -226,14 +226,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;
@@ -250,11 +250,13 @@ 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;
 }
+