Clean up obsolete CVS version stamps and some other messiness.
[yaffs2.git] / direct / basic-test / yaffs_ramdisk.c
index babddde3eda963e0a7189d6d3f4df2cb27f52047..3d71e5170e0190aaf7e9c8c378bebe4623b67774 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>
@@ -18,9 +18,6 @@
  * Use this with dev->use_nand_ecc enabled, then ECC overheads are not required.
  */
 
-const char *yaffs_ramdisk_c_version = "$Id: yaffs_ramdisk.c,v 1.6 2010-01-11 04:06:47 charles Exp $";
-
-
 #include "yportenv.h"
 #include "yaffs_trace.h"
 
@@ -79,7 +76,7 @@ static int  CheckInit(struct yaffs_dev *dev)
        
        ramdisk.nBlocks = (SIZE_IN_MB * 1024 * 1024)/(16 * 1024);
        
-       ramdisk.block = YMALLOC(sizeof(yramdisk_block *) * ramdisk.nBlocks);
+       ramdisk.block = malloc(sizeof(yramdisk_block *) * ramdisk.nBlocks);
        
        if(!ramdisk.block) return 0;
        
@@ -90,7 +87,7 @@ static int  CheckInit(struct yaffs_dev *dev)
        
        for(i=0; i <ramdisk.nBlocks && !fail; i++)
        {
-               if((ramdisk.block[i] = YMALLOC(sizeof(yramdisk_block))) == 0)
+               if((ramdisk.block[i] = malloc(sizeof(yramdisk_block))) == 0)
                {
                        fail = 1;
                }
@@ -105,12 +102,13 @@ static int  CheckInit(struct yaffs_dev *dev)
        {
                for(i = 0; i < nAllocated; i++)
                {
-                       YFREE(ramdisk.block[i]);
+                       kfree(ramdisk.block[i]);
                }
-               YFREE(ramdisk.block);
+               kfree(ramdisk.block);
                
-               T(YAFFS_TRACE_ALWAYS,("Allocation failed, could only allocate %dMB of %dMB requested.\n",
-                  nAllocated/64,ramdisk.nBlocks * 528));
+               yaffs_trace(YAFFS_TRACE_ALWAYS,
+                       "Allocation failed, could only allocate %dMB of %dMB requested.\n",
+                       nAllocated/64,ramdisk.nBlocks * 528);
                return 0;
        }
        
@@ -212,7 +210,9 @@ int yramdisk_erase(struct yaffs_dev *dev, int blockNumber)
        
        if(blockNumber < 0 || blockNumber >= ramdisk.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);
                return YAFFS_FAIL;
        }
        else
@@ -231,4 +231,3 @@ int yramdisk_initialise(struct yaffs_dev *dev)
        return YAFFS_OK;
 }
 
-