Major whitespace/style changes to match Linux checkpatch.pl code style
[yaffs2.git] / yaffs_mtdif1.c
index 2aad44ef1541f35c6defcbf7f4050c54efcfaa9d..f4d35fc5a659900f62f191d3b0f366fb4c88329a 100644 (file)
@@ -26,7 +26,7 @@
 #include "yportenv.h"
 #include "yaffs_guts.h"
 #include "yaffs_packedtags1.h"
-#include "yaffs_tagscompat.h"  // for yaffs_CalcTagsECC
+#include "yaffs_tagscompat.h"  /* for yaffs_CalcTagsECC */
 
 #include "linux/kernel.h"
 #include "linux/version.h"
@@ -34,9 +34,9 @@
 #include "linux/mtd/mtd.h"
 
 /* Don't compile this module if we don't have MTD's mtd_oob_ops interface */
-#if (MTD_VERSION_CODE > MTD_VERSION(2,6,17))
+#if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17))
 
-const char *yaffs_mtdif1_c_version = "$Id: yaffs_mtdif1.c,v 1.8 2008-07-23 03:35:12 charles Exp $";
+const char *yaffs_mtdif1_c_version = "$Id: yaffs_mtdif1.c,v 1.9 2009-03-06 17:20:52 wookey Exp $";
 
 #ifndef CONFIG_YAFFS_9BYTE_TAGS
 # define YTAG1_SIZE 8
@@ -89,9 +89,9 @@ static struct nand_ecclayout nand_oob_16 = {
  * Returns YAFFS_OK or YAFFS_FAIL.
  */
 int nandmtd1_WriteChunkWithTagsToNAND(yaffs_Device *dev,
-       int chunkInNAND, const __u8 * data, const yaffs_ExtendedTags * etags)
+       int chunkInNAND, const __u8 *data, const yaffs_ExtendedTags *etags)
 {
-       struct mtd_info * mtd = dev->genericDevice;
+       struct mtd_info *mtd = dev->genericDevice;
        int chunkBytes = dev->nDataBytesPerChunk;
        loff_t addr = ((loff_t)chunkInNAND) * chunkBytes;
        struct mtd_oob_ops ops;
@@ -146,7 +146,7 @@ int nandmtd1_WriteChunkWithTagsToNAND(yaffs_Device *dev,
 
 /* Return with empty ExtendedTags but add eccResult.
  */
-static int rettags(yaffs_ExtendedTags * etags, int eccResult, int retval)
+static int rettags(yaffs_ExtendedTags *etags, int eccResult, int retval)
 {
        if (etags) {
                memset(etags, 0, sizeof(*etags));
@@ -169,9 +169,9 @@ static int rettags(yaffs_ExtendedTags * etags, int eccResult, int retval)
  * Returns YAFFS_OK or YAFFS_FAIL.
  */
 int nandmtd1_ReadChunkWithTagsFromNAND(yaffs_Device *dev,
-       int chunkInNAND, __u8 * data, yaffs_ExtendedTags * etags)
+       int chunkInNAND, __u8 *data, yaffs_ExtendedTags *etags)
 {
-       struct mtd_info * mtd = dev->genericDevice;
+       struct mtd_info *mtd = dev->genericDevice;
        int chunkBytes = dev->nDataBytesPerChunk;
        loff_t addr = ((loff_t)chunkInNAND) * chunkBytes;
        int eccres = YAFFS_ECC_RESULT_NO_ERROR;
@@ -189,7 +189,7 @@ int nandmtd1_ReadChunkWithTagsFromNAND(yaffs_Device *dev,
        ops.datbuf = data;
        ops.oobbuf = (__u8 *)&pt1;
 
-#if (MTD_VERSION_CODE < MTD_VERSION(2,6,20))
+#if (MTD_VERSION_CODE < MTD_VERSION(2, 6, 20))
        /* In MTD 2.6.18 to 2.6.19 nand_base.c:nand_do_read_oob() has a bug;
         * help it out with ops.len = ops.ooblen when ops.datbuf == NULL.
         */
@@ -284,7 +284,7 @@ int nandmtd1_ReadChunkWithTagsFromNAND(yaffs_Device *dev,
  */
 int nandmtd1_MarkNANDBlockBad(struct yaffs_DeviceStruct *dev, int blockNo)
 {
-       struct mtd_info * mtd = dev->genericDevice;
+       struct mtd_info *mtd = dev->genericDevice;
        int blocksize = dev->nChunksPerBlock * dev->nDataBytesPerChunk;
        int retval;
 
@@ -298,7 +298,7 @@ int nandmtd1_MarkNANDBlockBad(struct yaffs_DeviceStruct *dev, int blockNo)
  *
  * Returns YAFFS_OK or YAFFS_FAIL.
  */
-static int nandmtd1_TestPrerequists(struct mtd_info * mtd)
+static int nandmtd1_TestPrerequists(struct mtd_info *mtd)
 {
        /* 2.6.18 has mtd->ecclayout->oobavail */
        /* 2.6.21 has mtd->ecclayout->oobavail and mtd->oobavail */
@@ -323,9 +323,9 @@ static int nandmtd1_TestPrerequists(struct mtd_info * mtd)
  * Always returns YAFFS_OK.
  */
 int nandmtd1_QueryNANDBlock(struct yaffs_DeviceStruct *dev, int blockNo,
-       yaffs_BlockState * pState, __u32 *pSequenceNumber)
+       yaffs_BlockState *pState, __u32 *pSequenceNumber)
 {
-       struct mtd_info * mtd = dev->genericDevice;
+       struct mtd_info *mtd = dev->genericDevice;
        int chunkNo = blockNo * dev->nChunksPerBlock;
        loff_t addr = (loff_t)chunkNo * dev->nDataBytesPerChunk;
        yaffs_ExtendedTags etags;
@@ -346,16 +346,13 @@ int nandmtd1_QueryNANDBlock(struct yaffs_DeviceStruct *dev, int blockNo,
                yaffs_trace(YAFFS_TRACE_BAD_BLOCKS,
                        "block %d is marked bad\n", blockNo);
                state = YAFFS_BLOCK_STATE_DEAD;
-       }
-       else if (etags.eccResult != YAFFS_ECC_RESULT_NO_ERROR) {
+       } else if (etags.eccResult != YAFFS_ECC_RESULT_NO_ERROR) {
                /* bad tags, need to look more closely */
                state = YAFFS_BLOCK_STATE_NEEDS_SCANNING;
-       }
-       else if (etags.chunkUsed) {
+       } else if (etags.chunkUsed) {
                state = YAFFS_BLOCK_STATE_NEEDS_SCANNING;
                seqnum = etags.sequenceNumber;
-       }
-       else {
+       } else {
                state = YAFFS_BLOCK_STATE_EMPTY;
        }