Clean up obsolete CVS version stamps and some other messiness.
[yaffs2.git] / direct / basic-test / yaffs_ramem2k.c
index 7f88b7c94a5ec018506a4812352a0dedfcffab86..715ae77c97fd95b90088ddd73850fd9187430e92 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
  *
- * Copyright (C) 2002-2010 Aleph One Ltd.
+ * Copyright (C) 2002-2011 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
  *
  * Created by Charles Manning <charles@aleph1.co.uk>
@@ -16,8 +16,6 @@
  */
 
 
-const char *yaffs_ramem2k_c_version = "$Id: yaffs_ramem2k.c,v 1.8 2010-02-18 01:18:04 charles Exp $";
-
 #ifndef __KERNEL__
 #define CONFIG_YAFFS_RAM_ENABLED
 #else
@@ -135,7 +133,7 @@ static int  CheckInit(void)
        ned.nBlocks = nBlocks = nandemul2k_CalcNBlocks();
 
        
-       ned.block = YMALLOC(sizeof(nandemul_Block*) * nBlocks );
+       ned.block = malloc(sizeof(nandemul_Block*) * nBlocks );
        
        if(!ned.block) return YAFFS_FAIL;
        
@@ -148,7 +146,7 @@ static int  CheckInit(void)
                
                nandemul_Block *blk;
                
-               if(!(blk = ned.block[i] = YMALLOC(sizeof(nandemul_Block))))
+               if(!(blk = ned.block[i] = malloc(sizeof(nandemul_Block))))
                {
                 fail = 1;
                }  
@@ -156,7 +154,7 @@ static int  CheckInit(void)
                {
                        for(j = 0; j < PAGES_PER_BLOCK; j++)
                        {
-                               if((blk->page[j] = YMALLOC(sizeof(nandemul_Page))) == 0)
+                               if((blk->page[j] = malloc(sizeof(nandemul_Page))) == 0)
                                {
                                        fail = 1;
                                }
@@ -173,12 +171,13 @@ static int  CheckInit(void)
                
                for(i = 0; i < nAllocated; i++)
                {
-                       YFREE(ned.block[i]);
+                       kfree(ned.block[i]);
                }
-               YFREE(ned.block);
+               kfree(ned.block);
                
-               T(YAFFS_TRACE_ALWAYS,("Allocation failed, could only allocate %dMB of %dMB requested.\n",
-                  nAllocated/64,sizeInMB));
+               yaffs_trace(YAFFS_TRACE_ALWAYS,
+                       "Allocation failed, could only allocate %dMB of %dMB requested.\n",
+                       nAllocated/64,sizeInMB);
                return 0;
        }
        
@@ -292,11 +291,15 @@ int nandemul2k_EraseBlockInNAND(struct yaffs_dev *dev, int blockNumber)
        
        if(blockNumber < 0 || blockNumber >= ned.nBlocks)
        {
-               T(YAFFS_TRACE_ALWAYS,("Attempt to erase non-existant block %d\n",blockNumber));
+               yaffs_trace(YAFFS_TRACE_ALWAYS,
+                       "Attempt to erase non-existant block %d\n",
+                       blockNumber);
        }
        else if(ned.block[blockNumber]->damaged)
        {
-               T(YAFFS_TRACE_ALWAYS,("Attempt to erase damaged block %d\n",blockNumber));
+               yaffs_trace(YAFFS_TRACE_ALWAYS,
+                       "Attempt to erase damaged block %d\n",
+                       blockNumber);
        }
        else
        {
@@ -346,7 +349,7 @@ int nandemul2k_QueryNANDBlock(struct yaffs_dev *dev, int block_no, enum yaffs_bl
        }
        else if(tags.chunk_used)
        {
-               *state = YAFFS_BLOCK_STATE_NEEDS_SCANNING;
+               *state = YAFFS_BLOCK_STATE_NEEDS_SCAN;
                *seq_number = tags.seq_number;
        }
        return YAFFS_OK;